|
MrColeyted wrote: richTextBox1.Text += "\n" +
prop.Name + "\t\t:" + prop.GetValue(t, null);
You are trying to find the property value from the type, you have tried to get it from the object itself
richTextBox1.Text += "\n" +
prop.Name + "\t\t:" + prop.GetValue(controls[index], null);
*jaans
|
|
|
|
|
My friend, I could kiss you! Thank you so very much. That did it!
"If you don't know where you're going, you'll probably end up somewhere else." Yogi Berra
|
|
|
|
|
Hello all,
I am looking for a program that will generate C# classes from a xsd schema.
A. I need it to be able to generate separate .cs files for the schemas that are are imported.
B. I need it to generate partial classes and would like it to generate generic collections.
C. I need it to be a free, downloadable program.
I have looked at the following tools:
1. xsd.exe - Does not generate multiple files.
2. XSDObjectGen - Does generate multiple files (given that the schemas have different namespaces), will generate partial classes, but it uses ArrayLists for it's collections (if it's 2.0 aware, why on earth would it generate ArrayLists?).
3. XSDClassGen - Does generate Generic collections, but does not generate multiple files.
4. CodeXS - Is an internet only tool.
Thanks in advance.
|
|
|
|
|
I found another one that doesn't do what I want.
It's called 'Dingo'. The author claimed that it's highly extensible.
When I tried to compile the classes it generated, they didn't compile.
It also doesn't generate partial classes unless you write a plugin for it.
|
|
|
|
|
Hello CBadal,
Do you have any luck on generating .cs files for the schemas that are imported.
If so can you please help me how to do.
Please assist me.
Thanks,
Sri
|
|
|
|
|
I want to build an application in windows forms to run another program which is console base program. how can i open my console program passing parameter to cmd and my console program have also some parameters.
|
|
|
|
|
The main method of your application will receive the parameters. You can use the Process object to send and receive commands. Also you can use MSMQ.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
sorry search through anywhere but i did't find my solution.
plz help me out.
|
|
|
|
|
Hi,
here are some facts:
1.
every process starts executing some kind of main method or function.
Under .NET the static main() method optionally gets as a parameter a string[] args array
holding the command line parameters.
You can make your app such that it reads that string array, and acts accordingly
(e.g. opens the file or files for which it gets paths).
2.
You can get the same information by using Environment.CommandLine or Environment.GetCommandLineArgs()
3.
You can provide command line arguments in many ways:
- by typing a command in a "DOS Window" (or the "Run" menu under the Start button);
- by having a command line in a batch file (extension .bat) which you execute by double-clicking;
- by adding them to the "Target" field of a desktop shortcut.
4.
Tou can programmatically launch another process and provide a command line while doing so;
it takes the Process class; either use Process.Start method, or instantiate a Process object,
set its StartInfo property, then Start() it.
Have a look at the documentation for all items mentioned!
|
|
|
|
|
Hi,
I need help on transfering data between forms. I am building a chat aplication and i am little stuck\stoped on transfering data between the Main_Chat_Form and the Private_Chat_Form
Well i have this:
(Its one exemple, can be a textbox or other stuff)
//In Form1.cs
private Form2 otherForm = new Form2();
private void GetOtherFormTextBox()
{
textBox1.Text = otherForm.TextBox1.Text;
}
//In Form2.cs:
public TextBox TextBox1
{
get
{
return textBox1;
}
}
But... it reads\gets the variable initial values. Even when a change the variable values it gets the initial ones.
(I think that i maneged to solve this one time with classes)
Can anyone help me on this?
Thank you!!!
|
|
|
|
|
First of all, please assure me that you don't really use these variable names ?
You should use delegates to pass info between forms, an excellent article exists on this, right here on CP.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You can use static member field of one form,the variable which to be passed to another form from one to other.
|
|
|
|
|
you can, but it's nasty, ugly, a hack, and it breaks if you need more than one instance of a form.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
you want to transfering date between froms. i think you familiar with Visual Basic 6.0 or Visual Basic.Net.
but currently you work in C#.
C# not like a Visual Basic.Net. it's too different.
Inheritance will help your problem.
so you imporve yours OOP concepts. then try it.
|
|
|
|
|
Hi again,
I found many solutions to my problem. However i would like (if possible) to use a 3º "object" to negociate between|with form1 and form2.
I d´ont like to code in both forms.cs, i would like to code in one class.cs to deal with both.
I thinking in store the variables values in a class.cs(other file).
---I want to code (part of) that process in a independent cs file
---write variable from form1 to class.cs file, and call variable from class.cs file to form2
I already solved it ... well found the solution... well just trying to get other solution more elegant!!!
Thank you!!!!
|
|
|
|
|
Hi there,
Where to put additional task in the setup project
In other word : where to put the code that add a file , or add a registry key ( I know how to do it but I do not know where!)
I hope I made it clear
Thanks in advance
There is always something to learn
|
|
|
|
|
How are you creating your setup project ? I know if you use a tool like Advanced Installer, you can do that stuff, but not sure how much of the msi functionality VS exposes ( I've never used VS to create an MSI )
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
What I wanted to do is:
to add some additional code to the setup , that perform some tasks during the installation of the application ,
I created the setup project as simple as possible , added from project template and then I added the primary output of the application
thanks
There is always something to learn
|
|
|
|
|
OK - I reiterate, I think the Visual Studio msis are a bit limited, try a tool like Advanced Installer.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have am reading from an external file and then converting that file into an array. The array is comma delimited, as seen here:
222,1.07181,0.933001
333,1.67566,0.596777
444,0.026708,37.4413
now, the first part of each line is a code, so that if the array was in any order, i could still find what i need. However, i want to turn this code into a string, because 222 doesn't mean anything to your average person. I have everything set up, but it wont compile because i cannot get my .ToString() or Convert.ToString() to work. Here is the code where I am receiving the error, help is much appreciated.
private void importRates()
{
string path = Settings.Default.FileName; //this["FileName"];
if (!File.Exists(path))
{
MessageBox.Show("no file found at " + path);
return;
}
int lineCount = 0;
StreamReader sr = new StreamReader(path);
{
String line;
while ((line = sr.ReadLine()) != null)
{
string[] ToFrom = line.Split(','); // this was originally double.Parse(ToFrom[0]);
rates[lineCount, 0] = ToFrom[0].ToString();
rates[lineCount, 1] = double.Parse(ToFrom[1]);
rates[lineCount, 2] = double.Parse(ToFrom[2]);
lineCount++;
}
sr.Close();
}
}
|
|
|
|
|
fixed. Had to add:
Dictionary<string, double[]> ratesDictionary = new Dictionary<string, double[]>();
and change my importRates to:
private void importRates()
{
string path = Settings.Default.FileName; //this["FileName"];
if (!File.Exists(path))
{
MessageBox.Show("no file found at " + path);
return;
}
int lineCount = 0;
StreamReader sr = new StreamReader(path);
{
String line;
while ((line = sr.ReadLine()) != null)
{
string[] ToFrom = line.Split(',');
ratesDictionary.Add(ToFrom[0].ToString(), new double[2]{double.Parse(ToFrom[1]), double.Parse(ToFrom[2])});
lineCount++;
}
sr.Close();
}
}

|
|
|
|
|
Today I found myself writing / reading binary image files, and I caught myself writing the following on a read:
using(fileReader = new BinaryReader(new FileStream(filePathName, FileMode.Open)))
{
}
Before I corrected my self, it got me thinking what exactly happens to anonymous instance members that are implementing the IDisposable interface? Would it be lost after the child instance is the finalized by sitting and waiting to be Garbage Collected? Or in the above example would the FileStream be picked up with the BinaryReader?
I do know that if you finalize the parent an instance is based off of, both get finalized... I know not as to what happens above???
This might even be a good article, if you could find it among the 1000's of hits on this topics keywords.
plz send teh codez?
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
This is interesting. I got the following when I looked BinaryReader class through reflector
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
Stream stream = this.m_stream;
this.m_stream = null;
if (stream != null)
{
stream.Close();
}
}
this.m_stream = null;
this.m_buffer = null;
this.m_decoder = null;
this.m_charBytes = null;
this.m_singleChar = null;
this.m_charBuffer = null;
} Noticed the lines in bold ? it's closing the associated stream but not disposing. Also I noticed BinaryReader don't have a destructor. Any thoughts ?
|
|
|
|
|
This is odd, why does did MS even give it an IDisposable interface? Seams that streams don't need finalization and thusly just calling close is all you need.
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
Is there a way to the label the ticks in the TrackBar without creating separate label controls?
Beth
|
|
|
|