Ejemplo n.º 1
0
 public void LoadSetting(Guid padSettingChecksum)
 {
     var ws = new WebServiceClient();
     ws.Url = MainForm.Current.OptionsPanel.InternetDatabaseUrlComboBox.Text;
     ws.LoadSettingCompleted += ws_LoadSettingCompleted;
     ws.LoadSettingAsync(new Guid[] { padSettingChecksum });
 }
Ejemplo n.º 2
0
		void DoAction(object state)
		{
			MainForm.Current.LoadingCircle = true;
			var ws = new WebServiceClient();
			ws.Url = MainForm.Current.OptionsPanel.InternetDatabaseUrlComboBox.Text;
			var gamesToDelete = data.Where(x => x.Action == CloudAction.Delete).Select(x => (Game)x.Item).ToList();
			try
			{
				var result = ws.SetGames(CloudAction.Delete, gamesToDelete);
				// If update was successful then.
				if (string.IsNullOrEmpty(result))
				{
					var gamesToUpdate = data.Where(x => x.Action == CloudAction.Update).Select(x => (Game)x.Item).ToList();
					result = ws.SetGames(CloudAction.Update, gamesToDelete);
				}
				if (!string.IsNullOrEmpty(result))
				{
					MainForm.Current.UpdateHelpHeader(result, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				var error = ex.Message;
				if (ex.InnerException != null) error += "\r\n" + ex.InnerException.Message;
				MainForm.Current.UpdateHelpHeader(error, MessageBoxIcon.Error);
			}

		}
Ejemplo n.º 3
0
		public void RefreshPresetsGrid(bool showResult)
		{
			LoadingCircle = true;
			var sp = new List<SearchParameter>();
			sp.Add(new SearchParameter());
			var ws = new WebServiceClient();
			ws.Url = MainForm.Current.OptionsPanel.InternetDatabaseUrlComboBox.Text;
			ws.SearchSettingsCompleted += wsPresets_SearchSettingsCompleted;
			System.Threading.ThreadPool.QueueUserWorkItem(delegate (object state)
			{
				ws.SearchSettingsAsync(sp.ToArray(), showResult);
			});
		}
Ejemplo n.º 4
0
 void LoadSettingsFromInternet()
 {
     var ws = new WebServiceClient();
     ws.Url = MainForm.Current.OptionsPanel.InternetDatabaseUrlComboBox.Text;
     ws.SearchSettingsCompleted += ws_SearchSettingsCompleted;
     _sp = new List<SearchParameter>();
     _sp.Add(new SearchParameter() { InstanceGuid = _di.InstanceGuid, ProductGuid = _di.ProductGuid });
     MainForm.Current.SettingsDatabasePanel.FillSearchParameterWithFiles(_sp);
     ws.SearchSettingsAsync(_sp.ToArray(), false);
 }
Ejemplo n.º 5
0
 void GetPrograms()
 {
     MainForm.Current.LoadingCircle = true;
     var ws = new WebServiceClient();
     ws.Url = MainForm.Current.OptionsPanel.InternetDatabaseUrlComboBox.Text;
     EnabledState enabled = EnabledState.None;
     if (IncludeEnabledCheckBox.CheckState == CheckState.Checked) enabled = EnabledState.Enabled;
     if (IncludeEnabledCheckBox.CheckState == CheckState.Unchecked) enabled =  EnabledState.Disabled;
     int minInstances = (int)MinimumInstanceCountNumericUpDown.Value;
     ws.GetProgramsCompleted += ws_GetProgramsCompleted;
     ws.GetProgramsAsync(enabled, minInstances);
 }