Ah. A little contextual information goes a long way.
So you want the parameter to be unique when statically looking at your source code: each location where SignalError(int number) is called, number will be a constant and has to be different.
This is what I would do:
- assume all source files are in a single folder and its subfolders (and no unrelated files are there);
- create a little app that enumerates, then reads those files (use the 3-parm overload of Directory.GetFiles)
- look for lines that hold the method name, extract the numeric parameter, and add it to a Dictionary; this will throw an exception when the key already exists, i.e. when the number has been entered earlier.
I was thinking if I could get a start, I could figure out the rest.
But, I mislead with my simple example.
There will be levels of method calls between mine and the point in code where the unique error number is supplied.
So, it won't be a simple check for calls to my method because those calls in turn will take a variable error number (but, the error number always tied to exactly 1 line in code).
public void TheMethod(string sMessage, int iTheUniqueErrorNumber)
public class T
public void ErrorOccurred(string sMessage, int iTheUniqueErrorNumber, int iCallerID, ...)
public void DoSomeWork()
// Some error occurs
ErrorOccurred("Blah blah blah", 2345, this.ThreadID, ...);
// Some other error occurs
ErrorOccurred("Blah blah blah", 2346, this.ThreadID, ...);
OK, so if the number of related methods (such as ErrorOccurred) is rather small, you could still make a list ("intermediateCallers") of them; you could do this either manually, or by generating a list of all methods calling TheMethod with a variable error number, not a constant one (you would have to make sure the list is good!).
You could then search all code for calls to either TheMethod or any method in intermediateCallers; parse the error number (I know, the method signature may vary, you have to teach your utility that); if it is a variable one, hope or check you are inside an intermediateCallers method; if it is a constant, check it in your Dictionary.
For creating a setup CD for this application, pre-requisite is required for the .Net framework.
For example the default ticked is: Microsoft .net framework 4 client profile (x86 and x64)
Should I also tick Microsoft .net framework 4 (x86 and x64) ?
It's not needed unless you want to make them install the entire framework.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
I did something similar (in reverse, numerics only) for a textbox some time ago that handles all use cases - you could tweak the logic for your control to allow only the characters you want. Clickety[^].
when a control is added to the panel i need to store some details about that control ,for that i tried to use the way of
"panel.Control.add()" but i can't override the add method of the controlcollection of the panel. i'm using c# 3.5 CF.
So is there any way of achieving this , appreciate your ideas,
.NET offers this event[^]. If that isn't available on CF, your best bet might be to provide an AddControl() method which does whatever you want it to do; the disadvantages would be: Controls.Add() remains available, and Visual Designer would not call your method.
You just need to check whether the name you are trying to move exists in the ListBox you are trying to move it to. I would keep 2 List<item>'s in memory and bind these to the ListBoxes and Add or Remove from the List<item> and rebind as necessary.
...and I have extensive experience writing computer code, including OIC, BTW, BRB, IMHO, LMAO, ROFL, TTYL.....