コード例 #1
0
		private void InvokeSyncConfigChanged (SyncConfig config)
		{
			var handler = this.OnSyncConfigChangedStarted;
			if (handler != null) {
				handler (config);
			}
		}
コード例 #2
0
ファイル: MainController.cs プロジェクト: draptik/RepoSync
		private void HandleOnSyncConfigChangedStarted (SyncConfig syncConfig)
		{
			this.syncConfig = syncConfig;
			repoTreeViewWidget.Update (syncConfig);

			syncActionWidget.IsSelectAllChecked = IsSyncConfigPresent;
			syncActionWidget.IsActive = AreAnyReposSelected();
		}
コード例 #3
0
		private void HandleSelectionChanged (object sender, EventArgs e)
		{
			var configFilename = btnFileChooser.Filename;

			var jsonService = new JsonService (new IoService ());
			jsonService.Init (configFilename);

			syncConfig = jsonService.SyncConfig;

			InvokeSyncConfigChanged (syncConfig);
		}
コード例 #4
0
ファイル: JsonService.cs プロジェクト: draptik/RepoSync
		public void Init (string fileName)
		{
			if (!this.ioService.FileIsValid(fileName)) {
				return;
			}

			StreamReader reader = new StreamReader(fileName);
			string s = reader.ReadToEnd();
			reader.Close();
			this.config = JsonConvert.DeserializeObject<SyncConfig>(s);
 		}
コード例 #5
0
		public void Update (SyncConfig syncConfig)
		{
			model.Clear ();

			if (syncConfig == null) {
				return;
			}

			foreach (var entry in syncConfig.Entries) {
				var defaultActivationState = true;
				model.AppendValues (defaultActivationState, entry);
			}
		}
コード例 #6
0
ファイル: JsonService.cs プロジェクト: draptik/RepoSync
		public JsonService (IoService ioService)
		{
			this.ioService = ioService;
			this.config = new SyncConfig();
		}