コード例 #1
0
ファイル: LeagueList.cs プロジェクト: yjtang/AutoBws
 public void ReadFromFile(string text1)
 {
     XmlReader reader = null;
     this._objList.Clear();
     reader = new XmlTextReader(text1);
     while (reader.Read())
     {
         if (reader.NodeType == XmlNodeType.Element)
         {
             if ((reader.Name.ToUpper() == "GeneralSetting".ToUpper()) && (reader.AttributeCount > 0))
             {
                 while (reader.MoveToNextAttribute())
                 {
                     if (reader.Name.ToUpper() == "IsSelectAll".ToUpper())
                     {
                         this._isSelectAll = Conversion.Val(reader.Value) != 0.0;
                     }
                 }
             }
             if ((reader.Name.ToUpper() == "League".ToUpper()) && (reader.AttributeCount > 0))
             {
                 League item = new League();
                 while (reader.MoveToNextAttribute())
                 {
                     string str5 = reader.Name.ToUpper();
                     if (str5 == "ID".ToUpper())
                     {
                         item.set_ID(reader.Value);
                     }
                     else if (str5 == "Name".ToUpper())
                     {
                         item.set_Name(reader.Value);
                     }
                 }
                 this._objList.Add(item);
             }
         }
     }
     reader.Close();
 }
コード例 #2
0
 public void LoadSettingFromXML(string text1)
 {
     try
     {
         XmlReader reader = null;
         reader = new XmlTextReader(text1);
         while (reader.Read())
         {
             if (((reader.NodeType != XmlNodeType.Element) || (reader.Name.ToUpper() != "Website".ToUpper())) || (reader.AttributeCount <= 0))
             {
                 continue;
             }
             League league = new League();
             while (reader.MoveToNextAttribute())
             {
                 string str3 = reader.Name.ToUpper();
                 if (str3 == "AccountID".ToUpper())
                 {
                     this._strAccountID = reader.Value;
                 }
                 else
                 {
                     if (str3 == "AccountPassword".ToUpper())
                     {
                         this._strAccountPassword = CommonFunction.DecryptString128Bit(reader.Value, "heng8888");
                         continue;
                     }
                     if (str3 == "AccountRole".ToUpper())
                     {
                         this._objRole = (EnumCollection.eMemberPosition)((int)Math.Round(Conversion.Val(reader.Value)));
                         continue;
                     }
                     if (str3 == "LoginURL".ToUpper())
                     {
                         this._strLoginURL = reader.Value;
                     }
                 }
             }
         }
         reader.Close();
     }
     catch (Exception exception1)
     {
         ProjectData.SetProjectError(exception1);
         Exception exception = exception1;
         this._objErrorLogger.write(this._strName + ": EXCEPTION IN LoadSettingFromXML: " + exception.Message);
         this.WriteProgramLogger(this._strName + ": EXCEPTION IN LoadSettingFromXML: " + exception.Message);
         ProjectData.ClearProjectError();
     }
 }
コード例 #3
0
 public void LoadMiscSettingFromFile(string text1)
 {
     try
     {
         XmlReader reader = null;
         reader = new XmlTextReader(text1);
         while (reader.Read())
         {
             if (((reader.NodeType != XmlNodeType.Element) || (reader.Name.ToUpper() != "Website".ToUpper())) || (reader.AttributeCount <= 0))
             {
                 continue;
             }
             League league = new League();
             while (reader.MoveToNextAttribute())
             {
                 string str3 = reader.Name.ToUpper();
                 if (str3 == "AccountID".ToUpper())
                 {
                     this._strAccountID = reader.Value;
                 }
                 else
                 {
                     if (str3 == "AccountPassword".ToUpper())
                     {
                         this._strAccountPassword = CommonFunction.DecryptString128Bit(reader.Value, "heng8888");
                         continue;
                     }
                     if (str3 == "LoginURL".ToUpper())
                     {
                         this._strLoginURL = reader.Value;
                         continue;
                     }
                     if (str3 == "BetAmountStyle".ToUpper())
                     {
                         this._objBetAmountStyle = (EnumCollection.eBetAmountStyle) ((int) Math.Round(Conversion.Val(reader.Value)));
                         continue;
                     }
                     if (str3 == "DefaultBetAmount".ToUpper())
                     {
                         this._intDefaultBetAmount = (int) Math.Round(Conversion.Val(reader.Value));
                         continue;
                     }
                     if (str3 == "IsBetAmountLockerEnabled".ToUpper())
                     {
                         this._objBetAmountLocker.set_IsEnabled(Conversion.Val(reader.Value) != 0.0);
                         this.get__objBetQueueMonitor().get_BetAmountLock().set_IsEnabled(Conversion.Val(reader.Value) != 0.0);
                         continue;
                     }
                     if (str3 == "BetAmountLockerAmount".ToUpper())
                     {
                         this._objBetAmountLocker.set_BetAmount((int) Math.Round(Conversion.Val(reader.Value)));
                         this.get__objBetQueueMonitor().get_BetAmountLock().set_BetAmount((int) Math.Round(Conversion.Val(reader.Value)));
                         continue;
                     }
                     if (str3 == "BetOddsType".ToUpper())
                     {
                         this._objBetOddsType = (EnumCollection.eOddsType) ((int) Math.Round(Conversion.Val(reader.Value)));
                         continue;
                     }
                     if (str3 == "OddsDifferentBad".ToUpper())
                     {
                         this._dblOddsDifferentBad = Conversions.ToDouble(reader.Value);
                         continue;
                     }
                     if (str3 == "OddsDifferentBetter".ToUpper())
                     {
                         this._dblOddsDifferentBetter = Conversions.ToDouble(reader.Value);
                         continue;
                     }
                     if (str3 == "PerMatchLimit".ToUpper())
                     {
                         this._objPerMatchLimitList.set_AmountLimit((int) Math.Round(Conversion.Val(reader.Value)));
                         continue;
                     }
                     if (str3 == "PerMatchCountLimit".ToUpper())
                     {
                         this._objPerMatchLimitList.set_CountLimit((int) Math.Round(Conversion.Val(reader.Value)));
                         continue;
                     }
                     if (str3 == "PerMatchLimitType".ToUpper())
                     {
                         this._objPerMatchLimitList.set_PerMatchLimitType((EnumCollection.ePerMatchLimitType) ((int) Math.Round(Conversion.Val(reader.Value))));
                         continue;
                     }
                     if (str3 == "PerMatchLimitMethod".ToUpper())
                     {
                         this._objPerMatchLimitList.set_Type((int) Math.Round(Conversion.Val(reader.Value)));
                         continue;
                     }
                     if (str3 == "MinCreditLimitAction".ToUpper())
                     {
                         this._objMinCreditLimitAction = (EnumCollection.eProgramAction) Conversions.ToInteger(reader.Value);
                         continue;
                     }
                     if (str3 == "MinCreditLimit".ToUpper())
                     {
                         this._decMinCreditLimit = Conversions.ToDecimal(reader.Value);
                         continue;
                     }
                     if (str3 == "IsToGetLiveOdds".ToUpper())
                     {
                         this._isToGetRunningOdds = Conversions.ToInteger(reader.Value) > 0;
                         continue;
                     }
                     if (str3 == "IsToGetNonLiveOdds".ToUpper())
                     {
                         this._isToGetTodayOdds = Conversions.ToInteger(reader.Value) > 0;
                         continue;
                     }
                     if (str3 == "IsToGetEarlyOdds".ToUpper())
                     {
                         this._isToGetEarlyOdds = Conversions.ToInteger(reader.Value) > 0;
                         continue;
                     }
                     if (str3 == "IsToIncludeFirstHalfOdds".ToUpper())
                     {
                         this._isToIncludeFirstHalfOdds = Conversions.ToInteger(reader.Value) > 0;
                         continue;
                     }
                     if (str3 == "IsToInclude1X2Odds".ToUpper())
                     {
                         this._isToInclude1X2Odds = Conversions.ToInteger(reader.Value) > 0;
                         continue;
                     }
                     if (str3 == "IsPerMatchLimitEnabled".ToUpper())
                     {
                         this._isPerMatchLimitEnabled = Conversions.ToInteger(reader.Value) > 0;
                         continue;
                     }
                     if (str3 == "SpiderMethod".ToUpper())
                     {
                         this._objSpiderMethod = (EnumCollection.eSpiderMethod) Conversions.ToInteger(reader.Value);
                         continue;
                     }
                     if (str3 == "IsToTryManualMatching".ToUpper())
                     {
                         this._isToTryManualMatching = Conversions.ToInteger(reader.Value) > 0;
                         continue;
                     }
                     if (str3 == "IsSearchUsingSingleName".ToUpper())
                     {
                         this._isSearchUsingSingleName = Conversions.ToInteger(reader.Value) > 0;
                         continue;
                     }
                     if (str3 == "IsToTryFuzzy".ToUpper())
                     {
                         this._isToTryFuzzy = Conversions.ToInteger(reader.Value) > 0;
                         continue;
                     }
                     if (str3 == "IsToTrySimilarHDP".ToUpper())
                     {
                         this._isToTrySimilarHDP = Conversions.ToInteger(reader.Value) > 0;
                         continue;
                     }
                     if (str3 == "SpiderRunningIntervalSec".ToUpper())
                     {
                         this._intSpiderRunningIntervalSec = Conversions.ToInteger(reader.Value);
                         continue;
                     }
                     if (str3 == "SpiderTodayIntervalSec".ToUpper())
                     {
                         this._intSpiderTodayIntervalSec = Conversions.ToInteger(reader.Value);
                         continue;
                     }
                     if (str3 == "SpiderEarlyIntervalSec".ToUpper())
                     {
                         this._intSpiderEarlyIntervalSec = Conversions.ToInteger(reader.Value);
                     }
                 }
             }
         }
         reader.Close();
     }
     catch (Exception exception1)
     {
         ProjectData.SetProjectError(exception1);
         Exception exception = exception1;
         this._objErrorLogger.write(this._strName + ": EXCEPTION IN LoadMiscSettingFromFile: " + exception.Message);
         this.WriteProgramLogger(this._strName + ": EXCEPTION IN LoadMiscSettingFromFile: " + exception.Message);
         ProjectData.ClearProjectError();
     }
 }
コード例 #4
0
ファイル: LeagueList.cs プロジェクト: yjtang/AutoBws
 public void Add(League league1)
 {
     this._objList.Add(league1);
 }