Click here to Skip to main content
15,917,862 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using Rejex to validate user name Pin
Ian Shlasko19-Mar-09 3:27
Ian Shlasko19-Mar-09 3:27 
GeneralRe: Using Rejex to validate user name Pin
musefan19-Mar-09 3:31
musefan19-Mar-09 3:31 
GeneralRe: Using Rejex to validate user name Pin
shabya19-Mar-09 3:59
shabya19-Mar-09 3:59 
AnswerRe: Using Rejex to validate user name Pin
Eslam Afifi19-Mar-09 3:26
Eslam Afifi19-Mar-09 3:26 
GeneralRe: Using Rejex to validate user name Pin
shabya19-Mar-09 3:57
shabya19-Mar-09 3:57 
QuestionSerialization Pin
Paul Unsworth19-Mar-09 1:03
Paul Unsworth19-Mar-09 1:03 
AnswerRe: Serialization Pin
Cracked-Down19-Mar-09 1:10
Cracked-Down19-Mar-09 1:10 
AnswerRe: Serialization Pin
Cracked-Down19-Mar-09 1:23
Cracked-Down19-Mar-09 1:23 
OK!!! let me provide you with the code snippest

Serialization unfortunately doesnot support dictionary.we have to write some rutines to workaround for it


in following code I have added a dedicated property for serializing my dictionary
Note:This property is of no use in client classes use only for serialization/deserialization


class ClassToSerialize
   {
      //dictionary to be serialized
       private Dictionary<string,string> dict=new Dictionary<string,string>();
       //dictionary does not supported by serilization so work aroun is
       //to this is convert dictionary in array and add them as xmlarray to serilization................No other way out
       //we have to handle serializatrion and deserialization of dictionary

       [XmlArray("Name")]
       [XmlArrayItem("ItemName", Type = typeof(DictionaryEntry))]
       public DictionaryEntry[] _signalsNotToBeVerified
       {
           get
           {
               //Make an array of DictionaryEntries to return
               DictionaryEntry[] ret = new DictionaryEntry[this.dict.Count];
               int index = 0;
               DictionaryEntry de;
               //Iterate through Stuff to load items into the array.
               foreach (KeyValuePair<string,> dictEntries in this.dict)
               {
                   de = new DictionaryEntry();
                   de.Key = dict.Key;
                   de.Value = dict.Value;
                   ret[index] = de;
                   index++;
               }
               return ret;
           }
           set
           {
               this.dict.Clear();
               for (int index = 0; index < value.Length; index++)
               {
                   this.dict.Add((string)value[index].Key, (string)value[index].Value);
               }
           }
   }




Enjoy!!!!!!!!!!!
GeneralRe: Serialization Pin
Paul Unsworth19-Mar-09 1:27
Paul Unsworth19-Mar-09 1:27 
GeneralRe: Serialization Pin
Cracked-Down19-Mar-09 2:10
Cracked-Down19-Mar-09 2:10 
QuestionEncrypt bitmap image for C# Windows application [modified] Pin
nudma19-Mar-09 0:59
nudma19-Mar-09 0:59 
AnswerRe: Encrypt bitmap image for C# Windows application Pin
Michael Bookatz19-Mar-09 1:17
Michael Bookatz19-Mar-09 1:17 
AnswerRe: Encrypt bitmap image for C# Windows application Pin
Henry Minute19-Mar-09 6:23
Henry Minute19-Mar-09 6:23 
GeneralRe: Encrypt bitmap image for C# Windows application Pin
nudma19-Mar-09 7:13
nudma19-Mar-09 7:13 
GeneralRe: Encrypt bitmap image for C# Windows application Pin
Henry Minute19-Mar-09 7:31
Henry Minute19-Mar-09 7:31 
GeneralRe: Encrypt bitmap image for C# Windows application Pin
nudma24-Mar-09 6:42
nudma24-Mar-09 6:42 
QuestionString to int Pin
mrithula818-Mar-09 23:47
mrithula818-Mar-09 23:47 
AnswerRe: String to int Pin
musefan18-Mar-09 23:50
musefan18-Mar-09 23:50 
GeneralRe: String to int Pin
Michael Bookatz19-Mar-09 0:54
Michael Bookatz19-Mar-09 0:54 
GeneralRe: String to int Pin
Mohammad Dayyan19-Mar-09 1:03
Mohammad Dayyan19-Mar-09 1:03 
GeneralRe: String to int Pin
musefan19-Mar-09 1:08
musefan19-Mar-09 1:08 
GeneralRe: String to int Pin
Michael Bookatz19-Mar-09 1:14
Michael Bookatz19-Mar-09 1:14 
GeneralRe: String to int Pin
DaveyM6919-Mar-09 2:09
professionalDaveyM6919-Mar-09 2:09 
GeneralRe: String to int Pin
musefan19-Mar-09 2:15
musefan19-Mar-09 2:15 
GeneralRe: String to int Pin
Mirko198019-Mar-09 1:11
Mirko198019-Mar-09 1:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.