public override void OnDeactivate() { if (mInitialOptions == null) { return; } bool isDialogueDirty = false; try { PendingChangesOptions currentOptions = GetOptions(); isDialogueDirty = IsDirty(currentOptions); if (!isDialogueDirty) { return; } currentOptions.SavePreferences(); } finally { IAutoRefreshView autoRefreshView = GetPendingChangesView(); if (autoRefreshView != null) { autoRefreshView.EnableAutoRefresh(); if (isDialogueDirty) { autoRefreshView.ForceRefresh(); } } } }
/// <summary> /// When initialized /// </summary> public override void OnActivate(string searchContext, VisualElement rootElement) { IAutoRefreshView autoRefreshView = GetPendingChangesView(); if (autoRefreshView != null) { autoRefreshView.DisableAutoRefresh(); } // Check if FSWatcher should be enabled WorkspaceInfo workspaceInfo = FindWorkspace.InfoForApplicationPath( Application.dataPath, PlasticWindow.PlasticApi); CheckFsWatcher(workspaceInfo); mInitialOptions = new PendingChangesOptions(); mInitialOptions.LoadPendingChangesOptions(); SetOptions(mInitialOptions); }