|
Atul23 wrote: Send me exact steps to create plugin for VS2005.
English is probably not your mother tongue, but this is still a rude thing to ask for, no one will do this work for you.
You can find an article here[^] that shows how to build a VS plugin.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hello
im not a c# expert thats why i came here!!
okay i am using virtual earth in a browser control.
i can call the javascript functions in it from a button with no worries, it works...
such as
executeScript(SetCenterAndZoom,lat1,long1,zoom1);
and if its in a button it works.
but when i make my own function like this..
private void addanotherpoint()
{
executeScript(SetCenterAndZoom,lat1,long1,zoom1);
}
this throws an System.InvalidCastException
i am sooo stumped how do i fix this???
i need to put the javascript function call in my own function not in a button......
!!!!!!!
please help.
thanks guys.
|
|
|
|
|
Hi All,
When your building applications and you don't want all the required assemblies in the root installation directory how do you configure the app to look in a subdirectory of the main apps install location?
like:
\Program Files\App\app.exe
\Program Files\App\External_Libs\data.dll
Cheers,
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
You need to use AppDomain.AssemblyResolve[^] event. Handle it and load the assemblies in the event handler. Something like
static void Main(string[] args)
{
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
}
static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
string assemblyName = args.Name;
return System.Reflection.Assembly.LoadFrom(assemblyName);
}
Hope this helps
|
|
|
|
|
Thanks for this ...
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Hi guys, How can i build this relationship class
ClassA intializes ClassB and ClassC if i add ClassA to my Form1.cs it should put ClassB and ClassC objects on the form. So there are only 2 objects displayed on the form. If I want to delete either ClassB or ClassC objects from the Form.cs it should delete all the instances created by ClassA.
I don't know how to start any kind of boosted answer will be appreciated. Thanks
|
|
|
|
|
Your question is not clear. How can you put class instances into form ? Are you developing any componenent that can be sited in the designer ? If yes, derive your class from Component class.
netJP12L wrote: ClassA intializes ClassB and ClassC
Something like this ?
class ClassA
{
private ClassB instanceB;
public ClassB InstanceB
{
get { return instanceB; }
set { instanceB = value; }
}
private ClassC instanceC;
public ClassC InstanceC
{
get { return instanceC; }
set { instanceC = value; }
}
public ClassA()
{
instanceB = new ClassB();
instanceC = new ClassC();
}
}
class ClassB
{
}
class ClassC
{
}
|
|
|
|
|
Thanks for answering but I am trying to develop controls classes. What i want to achieve is that lets say I have an objecX control, and ObjectY control if i delete objectX control so the classY control should be removed if i delete objectY the objectX control should be removed as well.
These two control are depeneded on each other in terms of they both resides or none of them. Each one of them have different behavior and knows how to draw themselves(objectX control and objectY control).
I could have look for either of these two objects on a Form and if one is going to removed then the other one should be removed. But keep in mind is that there could be multiple instances of these 2 control, I think i could call them a composite objects. That's where i am getting struck and not sure how to solve this.
please help thanks
|
|
|
|
|
Sadly, there isn't any concept of deletion in c#. But, since you are using form controls, you could remove the each control from the form.
But here, since you can have many controls of the same type on the form, and one control is independent of the other, you do not have a proper object communication mechanism in place. A possible solution is not to use your custom classes directly, but to have ObjectManager class that would provide functionality to add, remove controls from the parent control(Form). You can then implement the Remove method to do whatever functionality you need since now everything would lie in the hands of the ObjectManager.
|
|
|
|
|
Exactly, that's what i am realizing too. I would appreciate it if you can provide me a demo examples.
|
|
|
|
|
Hi all.
Always I was seeing object sender in parameters of event's method.
What is this and How we can access to the content of it ?
Sample :
void rectangle_MouseDown(object sender, MouseButtonEventArgs e)
{
}
Thanks in advance.
Freshman
|
|
|
|
|
Hi,
object sender is the object (usually a Control) that fired the event.
You can use it by casting it to the appropriate type.
Example: when several Buttons share the same Click handler, do
Button btn=(Button)sender; and now you can use btn.Name, btn.Text, btn.Tag or
whatever you choose to identify which of those Buttons fired the event.
|
|
|
|
|
Nice
Thanks Luc Pattyn.
Freshman
|
|
|
|
|
To extend Luc's answer slightly - the pattern when raising an event is normally to use something like this:
protected virtual void OnMyEvent()
{
if (MyEvent != null)
MyEvent(this , new EventArgs());
}
|
|
|
|
|
I stand slightly extended.
|
|
|
|
|
Pete O'Hanlon wrote: if (MyEvent != null)
MyEvent(this /* This populates the sender object */, new EventArgs());
What's MyEvent. Is it object or method name.
Freshman
|
|
|
|
|
MyEvent was just an example for a name of an event. It could be any event that you want to use.
|
|
|
|
|
Pete O'Hanlon wrote: new EventArgs());
EventArgs.Empty I say!
|
|
|
|
|
leppie wrote: EventArgs.Empty I say!
MyEvent overloaded him. What do you think this would do?
|
|
|
|
|
Pete O'Hanlon wrote: MyEvent overloaded him. What do you think this would do?
Probably what you intended it to do?
EventArgs.Empty is just a an empty instance which is equivalent to new EventArgs().
|
|
|
|
|
Hello.
I have this wierd problem when im writing to a text file with data from a array
I have this method:
private void writeData()
{
StreamWriter writeData = new StreamWriter(saveMonsterSetBase.FileName, false);
for (int x = 0; x < MonsterSetBaseDataArray.Count; x++)
{
writeData.WriteLine(MonsterSetBaseDataArray[x]);
}
writeData.Close();
}
Which is trigged here:
saveMonsterSetBase.ShowDialog();
if (saveMonsterSetBase.FileName != "")
{
writeData();
}
It works fine and opens my saveFileDialog
But after I save it I get a "file not found" on some other method I use
This is some of the method:
StreamReader findMonsterStream = new StreamReader(@XMLmonsterLocation);
I get the error monster.txt (XMLmonsterLocation) is not found
It looks like the writedata changes the local path because it says
File not found in the path where I saved the file
Example:
The application and monster.txt (XMLmonsterLocation) is saved in D:\
I then use the saveFileDialog (I save a file to for example C:\) and when I access my method where I use the XMLmonsterLocation it says file not found in C:\
So I dont know why
Hope you understand
The StreamReader reads from a xml file that looks like this:
<config>
<monsterlocation>monster.txt</monsterlocation>
<monstersetbaselocation>MonsterSetBase.txt</monstersetbaselocation>
<monsterimagelocation>mobs\</monsterimagelocation>
<mapimagelocation>maps\</mapimagelocation>
<mapinfolocation>maps\maps.txt</mapinfolocation>
</config>
|
|
|
|
|
Hi,
Windows keeps a "current directory" for every process.
There are several ways to modify the curdir, browsing with an Open/SaveFileDialog is one of them;
check this: the second time you open such a dialog, it shows the folder you saw last.
You can prevent this from persisting by setting FileDialog.RestoreDirectory true.
In general you should not rely on the curdir, so basically your mistake is that the
StreamReader uses a relative path. If you want it to always read files from your EXE's folder
write code to enforce that; have a look at Application.StartUpPath
|
|
|
|
|
Hi
I know how to convert schema into class using XSDObjGenVSAddin tool. But, how can I convert C# class into xml schema? Is there any tool available for this?
Please advise. Thanks
Pankaj
modified on Wednesday, July 2, 2008 3:38 PM
|
|
|
|
|
pankazmittal wrote: But, how can I convert C# class into xml schema?
Very carefully.
led mike
|
|
|
|
|