|
Do you suggest to create a method using reflection on the fly:
void AssingAValue(AClass aInstance, object value)
{
aInstance.AValue = value;
}
and then just call this method?
zilo
|
|
|
|
|
yes, so you can dynamically change the AValue property.
Calin
|
|
|
|
|
Also, you can use TypeDescriptor , and PropertyDescriptor .
Calin
|
|
|
|
|
Hi!
I am building a windows application in C#. I need to have a support for google maps within the application. I have a form with a web browser, and I want to navigate the web browser to google maps with street, city, state and zip from the app db, depending from the selected member. Can you guys navigate me or give me some hint how should I solve this issue. I will really appreciate. Thanks ahead, Laziale
|
|
|
|
|
http://mapki.com/wiki/Google_Map_Parameters[^]
This link shows the parameters you can pass in the url for google
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
How do I make a Console (or windows form) application that accepts a single line that will have a calculation such as 47 + 23 typed in, and return the answer (70 in this case) and can handle +, -, *, /
I just need to know how to split the line up to get the numbers and operation separate to use in an if statement
|
|
|
|
|
You need to create a simple math parser for this. Is not a matter of just splitting chars.
Basically you need to identify the tokens from your line(numbers, operators,...) by implementing a Lexer. After that you'll need a Parser.
Have a look here[^] or here[^]
Calin
|
|
|
|
|
first get the input line as a string
then remove all spaces so you get something like 47+23
then split the string based on the valid operators i.e. + - * /
you will need to also store them in an array
so then you should have two string arrays i.e values[] and operators[]
then you can do a loop for each value
int result = int.Parse(values[0]);//will be your result
for(int i = 1; i < values.Length; i++)
{
string op = operators[i-1];
int val = values[i];
switch(op){
case "+":
result += val;
break;
case "-":
result -= val;
break;
...//and so on
}
}
this is just an idea of the top of my head, the logic is there so it should work but you will need to handle error checking and also the calculation will be done in order of appearence rather than operator priority i.e. 2 + 5 * 7 would equal 49 not 37
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
|
There are this[^] and this[^].
(Both of which are articles I need to rework to bring up to current standards.)
|
|
|
|
|
Hi,
I am a Control developer and I need to set a property value like PostBack = True if my control user adds an event handler method like "Click" event from the design time property editor.
Would you please tell me if it is possible or not. If possible, then how ?
Thanks in advance.
Regards
Emran
|
|
|
|
|
Hi,
So, in case of PostBack = False you want to "block" the Click event?
Calin
|
|
|
|
|
Thanks for your reply.
No, actually the opposite, I will set PostBack = True if a Click event handler method is attached.
Would that be possible ?
Regards
Emran
|
|
|
|
|
Hi All,
Please let me know whether it is possible to convert XML Node to TreeNode.
Thanks in advance.
|
|
|
|
|
it is possible, but depends on how you want to have it.
do you want to get a tree hierarchy(including TreeNode.Nodes) from a XMLNode (and his childs)?
Calin
|
|
|
|
|
The following article contains a demo that shows how to create a hierarchy of TreeNode(s) based on a XML file input.
Basically, the resulted TreeView will contain the hierarchical display of Nodes as in XML file.
Please have a look XML Nodes -> Tree[^]
Calin
|
|
|
|
|
Thanks for your reply.
Actually the context is I need to convert XML Node to TreeNode and again add the treenode in a treeview control.
Its not necessary for me to read entire tree.
|
|
|
|
|
i m creating a program in c#
flow of the program is...
1. read the text file path from the registry(system in which my exe is running) the path is hard corded
2. copy the contents of that text file
3. save the contents into file in my system
unfortunately i m not able to get the file data ... can any body help me out by giving some idea to copy the data
|
|
|
|
|
arun_nadu wrote: unfortunately i m not able to get the file data
Are you unable to figure out which classes and methods you should use? Does your code not compile? Does it fail at runtime? How are people supposed to help you if they don't know what your problem is?
Tip: if you are new to file I/O in .NET, check out the System.IO namespace. All the classes you need are there.
Cheers,
Vıkram.
I've never ever worked anywhere where there has not been someone who given the choice I would not work with again. It's a job, you do your work, put up with the people you don't like, accept there are probably people there that don't like you a lot, and look forward to the weekends.
- Josh Gray.
|
|
|
|
|
sorry for the confusion given
here i m able to compile and run. as you told i m using IO classes
i have a shared file in side my pc . when ever my exe running it will copy specific text file from that pc and it should send it to my pc as i had specified my ip address.
for testing purpose i had run the exe in my pc so its getting the data from the specified file and getting copied to the shared file
|
|
|
|
|
arun_nadu wrote: i had run the exe in my pc so its getting the data from the specified file and getting copied to the shared file
Well, what's your problem?
Cheers,
Vıkram.
I've never ever worked anywhere where there has not been someone who given the choice I would not work with again. It's a job, you do your work, put up with the people you don't like, accept there are probably people there that don't like you a lot, and look forward to the weekends.
- Josh Gray.
|
|
|
|
|
Dear All
If anyone can provide me the example or url for updating the SQL table from DataGridView i have googled it but not able to found the required example
Thanks
|
|
|
|
|
I have a string with the value of "pictureBox89", a picturebox who's called pictureBox89, and another picturebox called picbox.
Now when I recieve the "pictureBox89" string is there any way I can make picbox equal pictureBox89?
I thought about
If( a == "pictureBox89")
picbox = pictureBox89;
but the thing is I have too many pictureboxes. I figured if there's a command for this I could get it over with in one line.
Thanks in advance.
|
|
|
|
|
I cant understand your logic
Where does these string values comes from and what is the range of possible values (such as pictureBox1 ,pictureBox2 ,pictureBox3 ...) and why are you taking decision
If you tell the me whole story i can give you a appropriate logic.
|
|
|
|
|
i think u can store the string "picbox"
in another string variable(suppose strPB) and make that string variable as "picturebox89"
and u can use the strPB in the places where its required
|
|
|
|