|
Hi all,
How to multiple tabs open and close click on buttons.
Actually i want to this scenario :
1.Dynamically add some tab items in browser [ Click on Add button ]
2.Dynamically close all browser tab items ,still open remaining single tab item.[ Click on Close button]
How its possible in Java Script or C#.
Thanks,
A.Aniruddhan
|
|
|
|
|
Aniruddha.A wrote: 1.Dynamically add some tab items in browser
<a href="/path.html" target="_blank">Click me</a>
This code will open the content in a new tab. As for JavaScript, you cannot open a new tab because that is user preference and he gets to do that, such as CTRL + Click. JavaScript gets to open a new tab only, unless a browser-specific feature allows such,
var win = window.open('www.google.com', '_blank');
win.focus();
Code from: http://stackoverflow.com/a/11384018/1762944, but browser can still control this.
Aniruddha.A wrote: .Dynamically close all browser tab items ,still open remaining single tab item.
As mentioned earlier, you do not get to chose this, unless you control the browser-specific API such as Chrome API for tabs — chrome.tabs - Google Chrome and you would then have an extension in the browser that does all of this — and is still not possible through a web application. If you want to create an extension for this, you can refer that documentation I provided and learn how to manage the tabs from your extension. Extensions can have buttons that you can use.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hi
I have been successfully using Lev's assembly for extracting EXIF data from my jpeg photos. I am particularly interested in the GPS data. Unfortunately I get an error when trying to use the code on Adobe DNG files. Can anyone tell me if a more recent source file is available which supports DNG files?
Best
Grahame
|
|
|
|
|
As you are asking about an article from a member who doesn't look to be active here any more, I would suggest that you look for an alternative to this library. You might find something that suits you here[^].
This space for rent
|
|
|
|
|
Thanks Pete. I had a brief look and though it doesn't explicity mention DNG files, I will further investigate. Thank you!
Grahame
|
|
|
|
|
With the author being active, you stand a much better chance of there being enhancements.
This space for rent
|
|
|
|
|
Using VS2015.
I'm trying to write some code that gives a list a solutions, and when clicked, opens that solution in the CURRENT instance of VS.
So far I have this:
public static class AutomateVS
{
[DllImport("ole32.dll")]
private static extern int CreateBindCtx(uint reserved, out IBindCtx ppbc);
public static DTE GetDTE(int processId)
{
string progId = "!VisualStudio.DTE.14.0:" + processId.ToString();
object runningObject = null;
IBindCtx bindCtx = null;
IRunningObjectTable rot = null;
IEnumMoniker enumMonikers = null;
try
{
Marshal.ThrowExceptionForHR(CreateBindCtx(reserved: 0, ppbc: out bindCtx));
bindCtx.GetRunningObjectTable(out rot);
rot.EnumRunning(out enumMonikers);
IMoniker[] moniker = new IMoniker[1];
IntPtr numberFetched = IntPtr.Zero;
while (enumMonikers.Next(1, moniker, numberFetched) == 0)
{
IMoniker runningObjectMoniker = moniker[0];
string name = null;
try
{
if (runningObjectMoniker != null)
{
runningObjectMoniker.GetDisplayName(bindCtx, null, out name);
}
}
catch (UnauthorizedAccessException)
{
}
if (!string.IsNullOrEmpty(name) && name.Contains("!VisualStudio.DTE.14.0:"))
{
rot.GetObject(runningObjectMoniker, out runningObject);
break;
}
if (!string.IsNullOrEmpty(name) && string.Equals(name, progId, StringComparison.Ordinal))
{
Marshal.ThrowExceptionForHR(rot.GetObject(runningObjectMoniker, out runningObject));
break;
}
}
}
finally
{
if (enumMonikers != null)
{
Marshal.ReleaseComObject(enumMonikers);
}
if (rot != null)
{
Marshal.ReleaseComObject(rot);
}
if (bindCtx != null)
{
Marshal.ReleaseComObject(bindCtx);
}
}
return (DTE)runningObject;
}
}
}
and use it like this
var process = System.Diagnostics.Process.GetCurrentProcess();
var id = process.Id;
_envDTE = AutomateVS.GetDTE(id);
if (_envDTE != null)
{
_envDTE.Solution.Open(solutionFile);
}
But it opens in the wrong VS instance. I need it to open in the instance my app is running in.
Anyone know what's wrong?
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Kevin Marois wrote: But it opens in the wrong VS instance. I need it to open in the instance my app is running in. In the wrong instance or in a new instance? Because that is what happens, if you even double click a new file to be opened in Visual Studio.
To open a file in a specific version you would require to have a Visual Studio extension, that communicates with Visual Studio to know where to load the file and then it will load the file there.
If you are interested in Visual Studio extensions, go to this link and get to know how you can develop a simple extension that does this for you.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I created program where when user checks checkbox edit text is enabled, but when I check any of checkboxes nothing happens!!!
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editText2 = (EditText) findViewById(R.id.editText_symbols);
editText3 = (EditText) findViewById(R.id.editText_numbers);
editText4 = (EditText) findViewById(R.id.editText_lowercase);
editText5 = (EditText) findViewById(R.id.editText_uppercase);
editText2.setEnabled(false);
editText3.setEnabled(false);
editText4.setEnabled(false);
editText5.setEnabled(false);
}
public void checkCheckBox(View view)
{
boolean checked = (((CheckBox)view).isChecked());
switch (view.getId())
{
case R.id.checkBox_uppercase:
if(checked)
editText2.setEnabled(true);
else
editText2.setEnabled(false);
break;
case R.id.checkBox_lowercase:
if(checked)
editText3.setEnabled(true);
else
editText3.setEnabled(false);
break;
case R.id.checkBox_numbers:
if(checked)
editText4.setEnabled(true);
else
editText4.setEnabled(false);
break;
case R.id.checkBox_symbols:
if(checked)
editText5.setEnabled(true);
else
editText5.setEnabled(false);
break;
}
}
|
|
|
|
|
Pavlex4 wrote: nothing happens
Maybe because this is not C#?
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
Instead of flooding these forums with every issue you face, why not try to do some actual debugging of your code first? Also, the above code is not C#, it is Android Java.
|
|
|
|
|
How to do this in Java Android Development?
var _pass = new string(
Enumerable.Repeat(_chars, _len)
.Select(s => s[_rnd.Next(s.Length)])
.ToArray());
modified 8-Jan-17 10:38am.
|
|
|
|
|
First, learn Java.
Second, learn C#.
Then translate the one to the other.
We are not here to do your work for you. And since you are clearly trying to get by without thinking for yourself - your other questions are clear evidence of that - I for one am not prepared to do any more for you. Pull your finger out, learn your subject(s) and start thinking.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
The best way to translate this is for you to sit down and work out what this code is currently doing. Once you know what this is doing, it becomes a lot easier to translate it into a different language.
This space for rent
|
|
|
|
|
It was always a weird way to do it, certainly took me a minute more time to read than it should. This is particularly offensive since it has a side-effect in code that pretends to be all "pure" and "elegant" and "look at me I'm using enumerables I'm so hip".
What it really does is make a string from _len random characters from _chars , so just implement that however makes the most sense. Which in Java is probably this:
char[] temp = new char[_len];
for (int i = 0; i < temp.length; i++)
temp[i] = _chars[_rnd.nextInt(_chars.length)];
String _pass = String.valueOf(temp);
|
|
|
|
|
1.- When I use the Visual Studio debugger, if the form is large I can not see the code below. How to hide the form?
2.- I have read that I can stop the execution in the debugger (F9) and that I can press Interrupt, Modify a line and Continue. But he will not let me interrupt. How is made? Because now I have to stop the execution and start again.
Thanks
|
|
|
|
|
If you have two monitors, which you should, then drag the form into one monitor and observe the debugging in the other monitor(the one with the VS IDE running). This works for most forms and website debugging.
I have never needed to interrupt a debugging session....ever. Not to say that someone out there doesn't need to do this. I just isolate the code that needs to be debugged, and set breakpoints there, or start from the beginning of the code path, if I need to broaden my scope.
What I do is set a breakpoint close to where the action that I want to observe is going to take place and then run the application. use F10 to advance line by line, and F11 to step into methods. If you need to observe a collection or object variable then just right click on the variable and select Quick Watch...
Go to Youtube and search for .net VS debugging tips and how to videos, if you think that would help you learn more about this.
Edit: You can also use "Run to cursor" if you want to skip sections of code and not have to debug the code line by line. Just place your cursor somewhere further in the code path, and then right click and select run to cursor. I use this a lot to jump over loops or to skip larger areas of code that I don't need to see.
You can also drag the yellow arrow on the left side of the code viewer to a desired code path that has already executed, and repeat "most" code execution again, if needed. This is not good for all scenarios because variables and values can change during the first pass of the code execution. I use this sometimes when debugging Unit Tests, and I want to run the test again without stepping out of the debugger instance.
Also, look into conditional expressions when debugging as well - where applicable.
modified 8-Jan-17 3:36am.
|
|
|
|
|
905/5000
But what I have asked is that I have read that you can press F9 and for debugging. Then "Interrupt" is pressed, the line of code is modified and "Continue" is pressed. However "Interrupt" is disabled. That's why I have to stop and restart every time and so for years.
On the other hand, to see the hidden code below the form, do I need two monitors? Then it does not serve me because it is not practical and it would be easier an option, which does not exist, to hide the form.
I stay as I was uninformed.
Thanks for your effort, does anyone have more information? I am finding many bugs to Microsoft with so many years, so many resources and so many smart people. A little comment. In the latest version of "Visual Studio" the only difference is that it is called 2015, the rest is the same.
And if you read my blog about Windows 10 you'd be surprised at the number of glitches, apart from being a spyware program in its entirety.
Congratulations to all of you. I have taken note of a great sentence that I have been given:
"It is a question of being in the right place and at the right time to do what is right."
|
|
|
|
|
It's not really clear if you know this, but F9 doesn't stop the code from running. It sets a breakpoint on the line the cursor is on in the code editor. When execution gets to that line the code stops running at that point. That's when you can inspect variable contents, stack trace, and see what's going on.
|
|
|
|
|
I checked what they told me about the configuration in "Tools", everything is correct but "Interrupt" is disabled and I can not edit and continue. As long as I have a while I will look at the link that passed me this fellow. Thank you
|
|
|
|
|
Regequion wrote: And if you read my blog Well, we probably would if it was not so well hidden.
|
|
|
|
|
- As Slacker007 said, use another monitor. If that isn't available, try re-sizing if available.
- I believe what you're looking for is Edit and Continue. You need to enable it in Tools > Options > Debugging > Edit and Continue.
More information can be found here. Best of luck!
|
|
|
|
|
I have many functions that employ some global variables that are common to all such functions, such as the language variable, to display error messages in the proper language.
I want to make various compiled dlls which in turn employs those functions. If those variables are in a global structure, when I create a main that uses the dll, in the main i have to define that structure or include the same .cs and, in that way, there are two different copies of that structure with the same name. That produces the error CS0433.
I can define a structure in the dll and in the Main I can use it, making a copy of the Main variables to the dll structure. But then if on the Main changes one of the variables, The dll does not have the updated value, I have to do it with every dll I use. Now you think the problem is bigger if there is more than one dll. That is impractical.
I continue with the problem not solved and raised in:
Https://www.codeproject.com/Forums/1649/Csharp.aspx?fid=1649&df=90&mpp=25&sort=Position&spc=Relaxed&view=Normal&fr=51#xx0xx
Can anyone make a practical example? Thank you.
|
|
|
|
|
Regequion wrote: Can anyone make a practical example Most unlikely since what you are trying to do does not make sense. As I told you before in your original question, you need to rethink your design. If a DLL requires special parameters supplied by the main program then you need to add a method to the DLL to receive those parameters and use them to produce whatever customised results are required. There is no reason why you should ever require two versions of the same source module or structure to make this work.
|
|
|
|
|
I'm already rethinking my design, what I do not know is how to do it. This matter is not well finished technically.
Focusing and exposing this topic is difficult.
1.- I have some functions in .cs files that I use in both Main and functions .cs and DLLs. These functions use a structure with some variables of general use. In order to compile those functions for the Main or if I want to create a dll, the structure must exist for functions such as in a .cs file. Imagine that in the cs the structure is called Name_Common.Cls_Common.StCommon
2.- When using Main, I need to add the definition of that structure of the same .cs That already produces the mentioned error of ambiguity. But if I want with an alias to refer to the structure of the dlls, I have to enter the variables every time from Main in each structure of each dll, being in Main with alias: using Name_Common_Main = Dll.Name_Common for the first dll. But, and for the second dll? I can not add another using or if? And those variables, when they are not global, when they change their value will not be updated.
I'm stuck, mentally and by software. How do people do?
|
|
|
|