I want to create plugins for visual Studio 2005. I used Addin project option and create plugin for VS2005. I also want to know how to register/integrate my plugin into VS2005. Send me exact steps to create plugin for VS2005.
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?
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
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.
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.
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.
I have this wierd problem when im writing to a text file with data from a array
I have this method:
private void writeData()
// Open file
StreamWriter writeData = new StreamWriter(saveMonsterSetBase.FileName, false);
// Write all data from array to file
for (int x = 0; x < MonsterSetBaseDataArray.Count; x++)
// Close stream
Which is trigged here:
if (saveMonsterSetBase.FileName != "")
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:
// Opening txt file with location from XML
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
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:
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