예제 #1
0
 public FindAllReferencesAction()
 {
     _dockingService   = DependencyFactory.Resolve <IDockingService>();
     _projectService   = DependencyFactory.Resolve <IProjectService>();
     _activeTextEditor = _dockingService.ActiveDocument as ITextEditor;
     _findResults      = _dockingService.GetDockingWindow <FindResultsWindow>();
 }
        private FindAndReplaceForm()
        {
            _dockingService = DependencyFactory.Resolve <IDockingService>();
            _projectService = DependencyFactory.Resolve <IProjectService>();
            _dockingService.ActiveDocumentChanged += DockingServiceActiveDocumentChanged;

            _results = _dockingService.GetDockingWindow <FindResultsWindow>();

            InitializeComponent();
        }
예제 #3
0
 public GotoDefinitionAction(FilePath fileName, string text, int currentLine)
 {
     _fileName       = fileName;
     _text           = text;
     _currentLine    = currentLine;
     _dockingService = DependencyFactory.Resolve <IDockingService>();
     _fileService    = DependencyFactory.Resolve <IFileService>();
     _parserService  = DependencyFactory.Resolve <IParserService>();
     _projectService = DependencyFactory.Resolve <IProjectService>();
     _findResults    = _dockingService.GetDockingWindow <FindResultsWindow>();
 }
예제 #4
0
        private IDockContent GetContentFromPersistString(string persistString)
        {
            string[] parsedStrings = persistString.Split(';');
            Type     type          = Type.GetType(parsedStrings[0]);

            if (type == null)
            {
                return(null);
            }

            if (typeof(ToolWindow).IsAssignableFrom(type))
            {
                ToolWindow window = _dockingService.GetDockingWindow(type);
                if (window != null)
                {
                    return(window);
                }
            }

            if (parsedStrings.Length < 2 || !typeof(AbstractFileEditor).IsAssignableFrom(type))
            {
                return(null);
            }

            FilePath fileName = new FilePath(parsedStrings[1]);

            if (!File.Exists(fileName))
            {
                return(null);
            }

            AbstractUiAction.RunCommand(new OpenFileAction(fileName));
            var doc = _dockingService.Documents.OfType <AbstractFileEditor>()
                      .FirstOrDefault(d => fileName == d.FileName);

            if (doc == null)
            {
                return(null);
            }

            doc.PersistStringLoad(parsedStrings);
            return(doc);
        }
예제 #5
0
        private void addNewFileMenuItem_Click(object sender, EventArgs e)
        {
            ProjectViewer projectViewer = _dockingService.GetDockingWindow <ProjectViewer>();

            AbstractUiAction.RunCommand(new AddNewFileAction(projectViewer));
        }