Ejemplo n.º 1
0
 public override ApolloNoticeData FromString(string src)
 {
     string[] array = src.Split(new char[]
     {
         '&'
     });
     this.PicDataList.Clear();
     string[] array2 = array;
     for (int i = 0; i < array2.Length; i++)
     {
         string   text   = array2[i];
         string[] array3 = text.Split(new char[]
         {
             '='
         });
         if (array3.Length > 1)
         {
             if (array3[0].CompareTo("MsgID") == 0)
             {
                 this.MsgID = ApolloStringParser.ReplaceApolloString(array3[1]);
             }
             else if (array3[0].CompareTo("OpenID") == 0)
             {
                 this.OpenID = ApolloStringParser.ReplaceApolloString(array3[1]);
             }
             else if (array3[0].CompareTo("MsgUrl") == 0)
             {
                 this.MsgUrl = ApolloStringParser.ReplaceApolloString(array3[1]);
             }
             else if (array3[0].CompareTo("MsgType") == 0)
             {
                 this.MsgType = (APOLLO_NOTICETYPE)int.Parse(array3[1]);
             }
             else if (array3[0].CompareTo("ContentType") == 0)
             {
                 this.ContentType = (APOLLO_NOTICE_CONTENTTYPE)int.Parse(array3[1]);
             }
             else if (array3[0].CompareTo("MsgScene") == 0)
             {
                 this.MsgScene = ApolloStringParser.ReplaceApolloString(array3[1]);
             }
             else if (array3[0].CompareTo("StartTime") == 0)
             {
                 this.StartTime = ApolloStringParser.ReplaceApolloString(array3[1]);
             }
             else if (array3[0].CompareTo("EndTime") == 0)
             {
                 this.EndTime = ApolloStringParser.ReplaceApolloString(array3[1]);
             }
             else if (array3[0].CompareTo("ContentUrl") == 0)
             {
                 this.ContentUrl = ApolloStringParser.ReplaceApolloString(array3[1]);
             }
             else if (array3[0].CompareTo("MsgTitle") == 0)
             {
                 this.MsgTitle = ApolloStringParser.ReplaceApolloString(array3[1]);
             }
             else if (array3[0].CompareTo("MsgContent") == 0)
             {
                 this.MsgContent = ApolloStringParser.ReplaceApolloString(array3[1]);
             }
             else if (array3[0].CompareTo("PictureData") == 0)
             {
                 string   text2  = ApolloStringParser.ReplaceApolloStringQuto(array3[1]);
                 string[] array4 = text2.Split(new char[]
                 {
                     ','
                 });
                 this.PicDataList.Clear();
                 string[] array5 = array4;
                 for (int j = 0; j < array5.Length; j++)
                 {
                     string      src2        = array5[j];
                     PictureData pictureData = new PictureData();
                     pictureData.FromString(src2);
                     this.PicDataList.Add(pictureData);
                 }
             }
         }
     }
     this.Dump();
     return(this);
 }
Ejemplo n.º 2
0
 public override ApolloNoticeData FromString(string src)
 {
     char[]   separator = new char[] { '&' };
     string[] strArray  = src.Split(separator);
     this.PicDataList.Clear();
     foreach (string str in strArray)
     {
         char[]   chArray2  = new char[] { '=' };
         string[] strArray3 = str.Split(chArray2);
         if (strArray3.Length > 1)
         {
             if (strArray3[0].CompareTo("MsgID") == 0)
             {
                 this.MsgID = ApolloStringParser.ReplaceApolloString(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("OpenID") == 0)
             {
                 this.OpenID = ApolloStringParser.ReplaceApolloString(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("MsgUrl") == 0)
             {
                 this.MsgUrl = ApolloStringParser.ReplaceApolloString(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("MsgType") == 0)
             {
                 this.MsgType = (APOLLO_NOTICETYPE)int.Parse(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("ContentType") == 0)
             {
                 this.ContentType = (APOLLO_NOTICE_CONTENTTYPE)int.Parse(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("MsgScene") == 0)
             {
                 this.MsgScene = ApolloStringParser.ReplaceApolloString(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("StartTime") == 0)
             {
                 this.StartTime = ApolloStringParser.ReplaceApolloString(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("EndTime") == 0)
             {
                 this.EndTime = ApolloStringParser.ReplaceApolloString(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("ContentUrl") == 0)
             {
                 this.ContentUrl = ApolloStringParser.ReplaceApolloString(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("MsgTitle") == 0)
             {
                 this.MsgTitle = ApolloStringParser.ReplaceApolloString(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("MsgContent") == 0)
             {
                 this.MsgContent = ApolloStringParser.ReplaceApolloString(strArray3[1]);
             }
             else if (strArray3[0].CompareTo("PictureData") == 0)
             {
                 char[]   chArray3  = new char[] { ',' };
                 string[] strArray4 = ApolloStringParser.ReplaceApolloStringQuto(strArray3[1]).Split(chArray3);
                 this.PicDataList.Clear();
                 foreach (string str3 in strArray4)
                 {
                     PictureData item = new PictureData();
                     item.FromString(str3);
                     this.PicDataList.Add(item);
                 }
             }
         }
     }
     this.Dump();
     return(this);
 }