示例#1
0
        public void SaveButton()
        {
            _params.name = _saveName;
            TabOptions p      = new TabOptions(_params);
            TabOptions exists = null;

            foreach (var sp in _savedParams)
            {
                if (sp.name == p.name)
                {
                    exists = sp;
                    break;
                }
            }
            if (exists != null)
            {
                exists = p;
            }
            else
            {
                _savedParams.Add(p);
            }

            //NotifyOfPropertyChange(() => SavedSettings);
        }
示例#2
0
 public T4OutsideSolutionNavigationInfo([NotNull] FileSystemPath fileSystemPath, TextRange textRange, bool activate, TabOptions tabOptions)
 {
     _fileSystemPath = fileSystemPath;
     _textRange      = textRange;
     _activate       = activate;
     _tabOptions     = tabOptions;
 }
 protected override bool OpenInProvisionTab(TabOptions tabOptions)
 {
     // If we're in a transaction, something's happening (e.g. opening files for a refactoring)
       // so don't force the preview tab. If we're not in a transaction, that just means someone's
       // navigating to the file, so yes, force the preview tab
       return !HasCurrentPreviewTabRequest && !IsInDocumentTransaction;
 }
示例#4
0
        protected override void OnInitialize()
        {
            base.OnInitialize();
            List <BblTabState> tabStates = BblTabState.ReadFromRegistry();

            _savedOptions = TabOptions.ReadFromRegistry();
            if (_savedOptions == null || _savedOptions.Count == 0)
            {
                _savedOptions = new ObservableCollection <TabOptions>();
                _savedOptions.Add(new TabOptions());
                _savedOptions.Add(TabOptions.PhotoTabOptions);
                _savedOptions.Add(TabOptions.ComicTabOptions);
            }


            foreach (var tabState in tabStates)
            {
                TabViewModel tab = new TabViewModel(this, tabState, _savedOptions);
                Items.Add(tab);
                if (tabState.isActive)
                {
                    ActivateItem(tab);
                }
            }
        }
示例#5
0
 public bool Navigate(
     ISolution solution,
     PopupWindowContextSource windowContext,
     bool transferFocus,
     TabOptions tabOptions = TabOptions.Default)
 {
     throw new NotImplementedException();
 }
        public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                             TabOptions tabOptions = TabOptions.Default)
        {
            // this literally takes you to the issue
            Shell.Instance.GetComponent <YouTrackService>().NavigateToIssue(IssueId);

            // soon!
            return(true);
        }
示例#7
0
 public static void SetTabSettings(string tabKey, TabOptions value)
 {
     if (Navigation.TabSettings.ContainsKey(tabKey))
     {
         Navigation.TabSettings[tabKey] = value;
     }
     else
     {
         Navigation.TabSettings.Add(tabKey, value);
     }
 }
 public T4OutsideSolutionNavigationInfo(
     [NotNull] FileSystemPath fileSystemPath,
     DocumentRange documentRange,
     bool activate,
     TabOptions tabOptions
     )
 {
     FileSystemPath = fileSystemPath;
     DocumentRange  = documentRange;
     Activate       = activate;
     TabOptions     = tabOptions;
 }
示例#9
0
        public override bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                                      TabOptions tabOptions = TabOptions.Default)
        {
            if (!solution.GetComponent <ConnectionTracker>().IsConnectionEstablished())
            {
                return(base.Navigate(solution, windowContext, transferFocus, tabOptions));
            }

            var findRequestCreator = solution.GetComponent <UnityEditorFindUsageResultCreator>();

            return(findRequestCreator.CreateRequestToUnity(myUnityEventTargetReference, true));
        }
		public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus, TabOptions tabOptions = TabOptions.Default) {
			if (!IsValid)
				return false;

			FileSystemPath path = _rangeMarker.Document.GetOutsideSolutionPath();
			if (path.IsEmpty)
				return false;

			var navigationInfo = new T4OutsideSolutionNavigationInfo(path, _rangeMarker.Range, transferFocus, tabOptions);
			var navigationOptions = NavigationOptions.FromWindowContext(windowContext, "Navigate to included file", transferFocus, tabOptions);
			var navigationManager = NavigationManager.GetInstance(solution);
			return navigationManager.Navigate<T4OutsideSolutionNavigationProvider, T4OutsideSolutionNavigationInfo>(navigationInfo, navigationOptions);
		}
        public override bool Navigate([NotNull] ISolution solution,
                                      [NotNull] PopupWindowContextSource windowContext,
                                      bool transferFocus,
                                      TabOptions tabOptions = TabOptions.Default)
        {
            if (DeclaredElementPointer is null)
            {
                return(true);
            }
            var navigator = solution.GetComponent <UnityAssetOccurrenceNavigator>();

            return(navigator.Navigate(solution, DeclaredElementPointer, OwningElementLocation));
        }
示例#12
0
        public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                             TabOptions tabOptions = TabOptions.Default)
        {
            var psiFile = mySourceFile.GetPrimaryPsiFile();

            if (psiFile == null || !psiFile.Language.Is <JsonLanguage>())
            {
                return(false);
            }

            var range = TextRange.FromLength(myNavigationTreeOffset, myName.Length);

            return(mySourceFile.Navigate(range, transferFocus, tabOptions, windowContext));
        }
        public override bool Navigate(
            ISolution solution,
            PopupWindowContextSource windowContext,
            bool transferFocus,
            TabOptions tabOptions = TabOptions.Default)
        {
            var textControlManager = solution.GetComponent <ITextControlManager>();

            var declaredElement = OccurrenceElement.NotNull().GetValidDeclaredElement();

            if (declaredElement == null)
            {
                return(false);
            }

            foreach (var declaration in declaredElement.GetDeclarations())
            {
                var sourceFile = declaration.GetSourceFile();
                if (sourceFile == null)
                {
                    continue;
                }

                foreach (var textControl in textControlManager.TextControls)
                {
                    if (textControl.Document != sourceFile.Document)
                    {
                        continue;
                    }

                    var declarationRange  = declaration.GetDocumentRange();
                    var textControlOffset = textControl.Caret.DocumentOffset();
                    if (!declarationRange.Contains(textControlOffset))
                    {
                        continue;
                    }

                    var popupWindowContextSource = solution.GetComponent <IMainWindowPopupWindowContext>().Source;
                    return(sourceFile.Navigate(
                               textControl.Selection.OneDocRangeWithCaret(),
                               transferFocus,
                               tabOptions,
                               popupWindowContextSource));
                }
            }

            return(base.Navigate(solution, windowContext, transferFocus, tabOptions));
        }
        public override bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                                      TabOptions tabOptions = TabOptions.Default)
        {
            using (ReadLockCookie.Create())
            {
                solution.GetPsiServices().Files.AssertAllDocumentAreCommitted();
                var declaredElement = DeclaredElementPointer.FindDeclaredElement();

                if (declaredElement != null)
                {
                    declaredElement.Navigate(transferFocus, windowContext, null, tabOptions);
                    return(true);
                }

                return(false);
            }
        }
示例#15
0
        protected override void OnDeactivate(bool close)
        {
            if (close)
            {
                List <BblTabState> tabStates = new List <BblTabState>();

                foreach (var i in Items)
                {
                    var tab = i as TabViewModel;
                    tab.TabState.isActive = i.IsActive;
                    if (tab.SelectedFolder != null)
                    {
                        tab.TabState.navigated = tab.SelectedFolder.FullName;
                    }
                    foreach (var fsbm in tab.Bookmarks)
                    {
                        var bm = (BblBookmark)fsbm.UserData;
                        if (!bm.destroyOnClose)
                        {
                            tab.TabState.savedBookmarks.Add(bm);
                        }
                    }
                    tabStates.Add(tab.TabState);
                }

                BblTabState.WriteToRegistry(tabStates);
                TabOptions.WriteToRegistry(_savedOptions);

                if (ImageSurface != null && !ImageSurface.IsDisposed)
                {
                    ImageSurface.nextPageRequested         -= OnNextPageRequested;
                    ImageSurface.prevPageRequested         -= OnPrevPageRequested;
                    ImageSurface.fullscreenToggleRequested -= OnFullScreenToggleRequested;
                    ImageSurface.Dispose();
                }
            }
            base.OnDeactivate(close);
        }
示例#16
0
 public TabOptionsViewModel(TabOptions parameters, ObservableCollection <TabOptions> savedParams)
 {
     _params      = parameters;
     _savedParams = savedParams;
 }
        public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus, TabOptions tabOptions = TabOptions.Default)
        {
            if (!IsValid)
            {
                return(false);
            }

            FileSystemPath path = _rangeMarker.Document.GetOutsideSolutionPath();

            if (path.IsEmpty)
            {
                return(false);
            }

            var navigationInfo    = new T4OutsideSolutionNavigationInfo(path, _rangeMarker.Range, transferFocus, tabOptions);
            var navigationOptions = NavigationOptions.FromWindowContext(windowContext, "Navigate to included file", transferFocus, tabOptions);
            var navigationManager = NavigationManager.GetInstance(solution);

            return(navigationManager.Navigate <T4OutsideSolutionNavigationProvider, T4OutsideSolutionNavigationInfo>(navigationInfo, navigationOptions));
        }
        public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
      TabOptions tabOptions = TabOptions.Default)
        {
            // this literally takes you to the issue
              Shell.Instance.GetComponent<YouTrackService>().NavigateToIssue(IssueId);

              // soon!
              return true;
        }
示例#19
0
 public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                      TabOptions tabOptions = TabOptions.Default)
 {
     return(myAssetOccurrence.Navigate(solution, windowContext, transferFocus, tabOptions));
 }
		public T4OutsideSolutionNavigationInfo([NotNull] FileSystemPath fileSystemPath, TextRange textRange, bool activate, TabOptions tabOptions) {
			_fileSystemPath = fileSystemPath;
			_textRange = textRange;
			_activate = activate;
			_tabOptions = tabOptions;
		}
示例#21
0
 public void LoadButton()
 {
     _params = SelectedSavedSettings;
 }
示例#22
0
 public virtual bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                              TabOptions tabOptions = TabOptions.Default)
 {
     return(solution.GetComponent <UnityAssetOccurrenceNavigator>().Navigate(solution, DeclaredElementPointer, OwningElementLocation));
 }
 public void SetTabOptions(TabOptions tabOptions, IOccurrence occurrence)
 {
 }
    /// <summary>
    /// Navigates the specified solution.
    /// </summary>
    /// <param name="solution">The solution.</param>
    /// <param name="windowContext">The window context.</param>
    /// <param name="transferFocus">if set to <c>true</c> [transfer focus].</param>
    /// <param name="tabOptions">The tab options.</param>
    /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
    public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus, TabOptions tabOptions = TabOptions.Default)
    {
      AppHost.CurrentContentTree.Activate();
      AppHost.CurrentContentTree.Locate(this.ItemUri);

      return true;
    }