|
0) Dictionary uses a hashtable.
1) Are your settings all one datatype?
|
|
|
|
|
One thing to remind, if you try to save settings in either of the data structures as a xml file then you are out of luck, by default both of them are not serializable. You have to implement the IXmlSerializable interface in a custom object and wrap it around the hash table.
|
|
|
|
|
|
not all one type but in worst case I can save all as string and convert within the application
|
|
|
|
|
If you want to save user settings, you can use Settings or create custom tags in the configuration file. Then you can read them from the configuration file when the application is loaded.
|
|
|
|
|
do you have an example of doing this (hashtable or dictionary) in a public class and use it across the application?
|
|
|
|
|
|
I want example of solution N-tier with code C#
can I help my ?
thanks
|
|
|
|
|
Please read the FAQs, we are not here to do your work for you. If you have a specific problem, please ask, but from what you have given it's not even certain you know what an n-teired solution actually is.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
|
|
Great site, just noted it for future use
I have no smart signature yet...
|
|
|
|
|
I smelt it +5
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Dont the same Question in Different Forums
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi All
Can anyone suggest how can we find the checkboxes inside checkedlistbox.
Iam not speaking about the checked item inside the checkedlistbox instead i need to find each and every checkbox controls included in the checkedlistbox
Thanks in advance
Santhosh
|
|
|
|
|
I am afraid, you can not access that checkboxes inside the checkedlistbox.
But as a last resort we can try using checkedlistbox.Controls property and enumerates the child controls to see if you can get hold of that checkbox. But still I am sure that won't be of much help.
|
|
|
|
|
Anindya thanks for the reply
<code>
foreach (CheckBox c in chkListboxPermission.Controls)
{
}
</code>
As you said this is not providing me the desired result..
Santhosh
|
|
|
|
|
What is it you are trying to do?
|
|
|
|
|
|
I have added 4 pictures to a resource file which I want to compare with the image in a picture box
An example of what I want to do is:
if (pictureBox1.Image == resourceFile.Image1)
{
pictureBox1.Image = resourceFile.Image2;
}
else
{
pictureBox1.Image = resourceFile.Image1;
}
This code compiles but the else-statement always executes.
How do I make this work?
|
|
|
|
|
try using pictureBox1.Image.Equals
|
|
|
|
|
Have already tried, it didn't work =(
Thanx anyway
|
|
|
|
|
That is because the equality operator only valid for the same objects not for the same contents. Though your pictures' contents are same but as they are two different objects in the memory, that is why the control always goes to the else block.
Now comparing the two images is not so simple.
One way to do is to save the two images in two different MemoryStream using
var ms = new MemeoryStream();
image.Save(ms, System.Drawing.Imaging.ImageFormat.MemoryBmp);
byte[] byteArray = ms.ToArray();
Do the same thing for the other image also and then check the equality of two byte arrays by reading each byte.
Hope this will solve your problem.
|
|
|
|
|
Actually i guess Image don't have any implementation for Equals method, so it fails. Byte check should work then.
|
|
|
|
|
Didn't work! This is what I got from your code example.
"Tarning1" is one picture in the resource file.
"bild" is the picture box name.
System.IO.MemoryStream ms1 = new System.IO.MemoryStream();
Bitmap pic1 = new Bitmap(bild.Image);
pic1.Save(ms1, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] byteArray1 = ms1.ToArray();
System.IO.MemoryStream ms2 = new System.IO.MemoryStream();
Bitmap pic2 = DicePictures.Tarning1;
pic2.Save(ms2, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] byteArray2 = ms2.ToArray();
if (byteArray1 == byteArray2)
Console.WriteLine("Equal");
else
Console.WriteLine("Not equal");
Did I miss something?
|
|
|
|