コード例 #1
0
ファイル: ManualMatchingList.cs プロジェクト: yjtang/AutoBws
 public void ReadFromFile(string text1)
 {
     XmlReader reader = null;
     try
     {
         this._objManualMatchedList.Clear();
         reader = new XmlTextReader(text1);
         while (reader.Read())
         {
             if (((reader.NodeType != XmlNodeType.Element) || (reader.Name.ToUpper() != "ManualMatching".ToUpper())) || (reader.AttributeCount <= 0))
             {
                 continue;
             }
             ManualMatchContainer item = new ManualMatchContainer();
             while (reader.MoveToNextAttribute())
             {
                 string str2 = reader.Name.ToUpper();
                 if (str2 == "strLeague".ToUpper())
                 {
                     item.strLeague = reader.Value;
                 }
                 else
                 {
                     if (str2 == "strHomeNameSource".ToUpper())
                     {
                         item.strHomeNameSource = reader.Value;
                         continue;
                     }
                     if (str2 == "strHomeAwaySource".ToUpper())
                     {
                         item.strAwayNameSource = reader.Value;
                         continue;
                     }
                     if (str2 == "strHomeNameTarget".ToUpper())
                     {
                         item.strHomeNameTarget = reader.Value;
                         continue;
                     }
                     if (str2 == "strHomeAwayTarget".ToUpper())
                     {
                         item.strAwayNameTarget = reader.Value;
                     }
                 }
             }
             this._objManualMatchedList.Add(item);
         }
         reader.Close();
         this.UpdateMatchListByManualMatchingList();
         this.UpdateManualMatchingAvailableList();
     }
     catch (Exception exception1)
     {
         ProjectData.SetProjectError(exception1);
         Exception exception = exception1;
         ProjectData.ClearProjectError();
     }
 }
コード例 #2
0
ファイル: ManualMatchingList.cs プロジェクト: yjtang/AutoBws
 private List<ManualMatchContainer> GenerateManualMatchContainerFromMatchList(List<MatchNew> list1)
 {
     List<ManualMatchContainer> list2 = new List<ManualMatchContainer>();
     string str2 = "";
     string str = "";
     foreach (MatchNew new2 in list1)
     {
         if (((new2.get_Type() == EnumCollection.eMatchType.Match) && (new2.get_ManualMatchingID() == -1)) && (((new2.get_HomeName() != string.Empty) & (new2.get_AwayName() != string.Empty)) && ((str2 != new2.get_HomeName()) | (str != new2.get_AwayName()))))
         {
             str2 = new2.get_HomeName();
             str = new2.get_AwayName();
             ManualMatchContainer item = new ManualMatchContainer(new2.get_League(), str2, str, "", "");
             list2.Add(item);
         }
     }
     if (list2.Count > 0)
     {
         list2.Sort();
     }
     return list2;
 }