private bool IsSummoned() {
			bool success = true;
			try {
				api = RiotApi.GetInstance(VortexConfig.GetRiotApi());
				staticApi = StaticRiotApi.GetInstance(VortexConfig.GetRiotApi());
				region = (Region)Enum.Parse(typeof(Region), VortexConfig.GetRegion());
				oSummoner = api.GetSummoner(region, txtSearchBar.Text);
			}
			catch {
				success = false;
			}
			return success;
		}
Esempio n. 2
0
 public static void AddSummoner(SummonerEndpoint.Summoner sum, string json, Region reg)
 {
     try
     {
         using (SQLiteTransaction trans = DTB.BeginTransaction())
         {
             using (SQLiteCommand addKeysCmd = new SQLiteCommand(DTB))
             {
                 string sqlIns = "INSERT INTO Summoners (id, name, region, json) VALUES(" + sum.Id + ", '" + Normalize(sum.Name, false) + "', '" + reg.ToString() + "', '" + Normalize(json, false) + "');";
                 addKeysCmd.CommandText = sqlIns;
                 addKeysCmd.ExecuteNonQuery();
             }
             trans.Commit();
         }
     }
     catch
     {
     }
 }