private void AddAnnotation(EntityType entity)
        {
            // First remember the pointers so that we can use the Select method to extract different sections of the text.
            TextPointer selectionStart = DocumentView.SelectionStart;
            TextPointer selectionEnd   = DocumentView.SelectionEnd;
            TextPointer documentStart  = DocumentView.ContentStart;
            TextPointer documentEnd    = DocumentView.ContentEnd;
            string      selection      = DocumentView.SelectedText;

            DocumentView.Select(documentStart, selectionStart);
            string textBeforeSelection = DocumentView.SelectedText;

            DocumentView.Select(documentStart, selectionStart);

            // Remove non-alpha numeric characters from the end of the string.
            string cleanSelection = CleanSelection(selection);

            var newAnnotation = new Annotation(textBeforeSelection.Length, textBeforeSelection.Length + cleanSelection.Length, currentDocument.FileName, entity.Name, cleanSelection);

            currentDocument.Annotations.Add(newAnnotation.StartOffset, newAnnotation);

            UpdateDocumentView();

            /*
             * Run highlightRun = new Run();
             * highlightRun.Text = DocumentView.SelectedText;
             * highlightRun.Foreground = new SolidColorBrush(Colors.Red);*/
        }
Esempio n. 2
0
 public void Init(DocumentView view, BaseAnnotationEditor editor)
 {
     position   = view.Scroll;
     pageNum    = view.EditPage;
     index      = editor.Index;
     properties = new AnnotationProperties(editor.Properties);
 }
Esempio n. 3
0
        void RebuildCache()
        {
            if (DocumentView?.Document?.Root == null)
            {
                cachedTextPositions.Clear();
                return;
            }

            if (cachedTextPositions.Count != LineCount)
            {
                cachedTextPositions.Clear();

                var root       = DocumentView.Document.Root;
                var baseLine   = Font.Baseline;
                var borderRect = BorderRect;
                for (var line = 0; line < LineCount; line += 1)
                {
                    var       lineNode = root[line];
                    Rectangle bounds;
                    if (DocumentView.ModelToView(lineNode.Offset, out bounds))
                    {
                        var pos  = (int)(bounds.Y + baseLine) - borderRect.Y;
                        var text = $"{line + 1}";
                        cachedTextPositions.Add(Tuple.Create(pos, text));
                    }
                    else
                    {
                        cachedTextPositions.Add(Tuple.Create(-1, ""));
                    }
                }
            }
        }
Esempio n. 4
0
 public void Init(DocumentView view, OpenDocumentData origin, OpenDocumentData append)
 {
     this.scroll      = view.Scroll;
     this.origin      = origin;
     this.append      = append;
     this.tmpFileName = null;
 }
Esempio n. 5
0
        private void mDockPanel_ActiveDocumentChanged(object sender, EventArgs e)
        {
            if (mDockPanel.ActiveDocument == null)
            {
                mManager.ActiveDocument = null;
            }
            else
            {
                mCurrentDocumentMenuStrip = mDockPanel.ActiveDocument.DockHandler.Form.MainMenuStrip;
                if (mCurrentDocumentMenuStrip != null)
                {
                    ToolStripManager.Merge(mCurrentDocumentMenuStrip, this.MainMenuStrip);
                }
                else
                {
                    ToolStripManager.RevertMerge(this.MainMenuStrip);
                }

                if (mDockPanel.ActiveDocument is DocumentView)
                {
                    DocumentView view = mDockPanel.ActiveDocument as DocumentView;
                    mManager.ActiveDocument = view.Document;
                }
                else
                {
                    mManager.ActiveDocument = null;
                }
            }

            tsiFileSave.Enabled   = (mManager.ActiveDocument != null) && !mManager.ActiveDocument.ReadOnly;
            tsiFileSaveAs.Enabled = (mManager.ActiveDocument != null);
        }
        public void ActivateDocument(IDocumentView view)
        {
            if (view == null)
            {
                return;
            }
            foreach (DocumentView d in documentViews)
            {
                if (d.GetType() == view.GetType())
                {
                    if (d.DocumentName == view.DocumentName)
                    {
                        d.Activate();
                        return;
                    }
                }
            }
            DocumentView doc = view as DocumentView;

            if (doc != null)
            {
                doc.FormClosing += new FormClosingEventHandler(OnDocumentWindowClosing);
                documentViews.Add(doc);
                doc.Show(dockPanel, DockState.Document);
                Refresh();
            }
        }
Esempio n. 7
0
 private void ApplyFont()
 {
     this.txtInput.Font = new System.Drawing.Font(
         cboFont.Text,
         Convert.ToSingle(this.cboFontSize.Text),
         DocumentView.GetFontStyle(this.chkBold.Checked, this.chkItalic.Checked, false));
 }
Esempio n. 8
0
            public void Init(DocumentView view, Document append)
            {
                scroll = view.Scroll;
                Document doc = view.Document;

                pages = doc.NumPages;
                Bookmark root = doc.BookmarkRoot;

                if (root != null)
                {
                    bookmarks = root.Count;
                }
                else
                {
                    bookmarks = 0;
                }
                IList <OptionalContentGroup> groups = doc.OptionalContentGroups;

                if (groups != null)
                {
                    layers = groups.Count;
                }
                else
                {
                    layers = 0;
                }
                fileName = append.FileName;
            }
        public IActionResult Get(string id, string adm)
        {
            DocumentView doc = null;

            if (adm == "pub")
            {
                doc = _sharingService.GetPublicSharedDocument(id, User, out bool isEditable);
            }
            else if (adm == "lim")
            {
                doc = _sharingService.GetLimitedSharedDocument(id, User, out bool isEditable);
            }
            else
            {
                return(RedirectToAction("Error", "Home"));
            }

            if (doc.IsFile)
            {
                return(View(doc));
            }
            else
            {
                var docs = _documentService.GetAllChildrensForFolder(doc.Id);
                return(RedirectToAction("Index", "Document", new { id = doc.Id }));
            }
        }
Esempio n. 10
0
 private void HandleUpArrow(ObservableCollection <string> document, DocumentView view)
 {
     if (view.CurrentLine > 0)
     {
         view.CurrentLine--;
     }
 }
 public ZoomLevelCommand(DocumentView sv) :
     base(sv)
 {
     Priority = (int)CommandManager.Priorities.ViewCommands;
     sv.ZoomManager.ZoomChanged += new EventHandler(ZoomGesture_ZoomChanged);
     this.level = 1.0;
 }
 public ToolCommand(DocumentView sv, string name, string group, Bitmap icon, Type type) : base(sv)
 {
     ToolName  = name;
     ToolGroup = group;
     ToolIcon  = icon;
     ToolType  = type;
 }
Esempio n. 13
0
        private void HandleDelete(ObservableCollection <string> document, DocumentView view)
        {
            var lineIndex = view.CurrentLine;
            var line      = document[lineIndex];
            var start     = view.CurrentCharacter;

            if (start >= line.Length)
            {
                if (view.CurrentLine == document.Count - 1)
                {
                    return;
                }

                var nextLine = document[view.CurrentLine + 1];

                document[view.CurrentLine] += nextLine;
                document.RemoveAt(view.CurrentLine + 1);

                return;
            }

            var before = line.Substring(0, start);
            var after  = line.Substring(start + 1);

            document[lineIndex] = before + after;
        }
        void OnDocumentWindowClosing(object sender, FormClosingEventArgs e)
        {
            DocumentView doc = (DocumentView)sender;

            doc.FormClosing -= new FormClosingEventHandler(OnDocumentWindowClosing);
            documentViews.Remove(doc);
        }
Esempio n. 15
0
        public static void Open(Document document)
        {
            if (instance == null)
            {
                return;
            }

            DocumentView documentView = new DocumentView();

            documentView.Header = DocumentView.HeaderModes.Path;

            ScrollViewer scroll = new ScrollViewer();

            scroll.Content = documentView;
            scroll.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
            scroll.VerticalScrollBarVisibility   = ScrollBarVisibility.Visible;

            TabItem tab = new TabItem();

            tab.Header  = document.Name;
            tab.Content = scroll;
            instance.InitialTabablzControl.Items.Add(tab);
            tab.IsSelected = true;

            documentView.OpenDocument(document);
        }
        public static bool DownloadDocument(DocumentView document, string saveAs)
        {
            var req    = archiveManager.GetDocumentParams(document.id);
            var result = archiveManager.GetDocument(req, saveAs);

            return(result);
        }
Esempio n. 17
0
        /// <summary>
        ///		Abre el formulario de documentos
        /// </summary>
        private void OpenFormDocument(SolutionModel solution, FileModel file)
        {
            if (file.IsImage)
            {
                DocWriterPlugin.MainInstance.HostPluginsController.ShowImage(file.FullFileName);
            }
            else
            {
                switch (file.FileType)
                {
                case FileModel.DocumentType.Unknown:
                case FileModel.DocumentType.File:
                    OpenFormFile(file);
                    break;

                case FileModel.DocumentType.Reference:
                    OpenFormUpdateReference(solution, file);
                    break;

                case FileModel.DocumentType.Folder:
                    DocWriterPlugin.MainInstance.HostPluginsController.ControllerWindow.ShowMessage("No se pueden abrir carpetas");
                    break;

                default:
                    DocumentView view = new DocumentView(solution, file);

                    DocWriterPlugin.MainInstance.HostPluginsController.LayoutController.ShowDocument("DOCWRITER_DOCUMENT_" + file.GlobalId, file.Title, view);
                    break;
                }
            }
        }
 public void Disconnect()
 {
     if (view == null) return;
     view.TextView.BackgroundRenderers.Remove(pairedCharacterRenderer);
     view.TextView.VisualLinesChanged -= TextViewVisualLinesChanged;
     view = null;
 }
 public void Initialise(DocumentView documentView)
 {
     view = documentView;
     view.TextView.BackgroundRenderers.Add(pairedCharacterRenderer);
     view.TextView.VisualLinesChanged += TextViewVisualLinesChanged;
     view.Editor.TextArea.Caret.PositionChanged += TextAreaCaretPositionChanged;
 }
Esempio n. 20
0
 public override void Dispose()
 {
     VersionControlService.FileStatusChanged -= VersionControlService_FileStatusChanged;
     base.Dispose();
     mainView = null;
     vcInfo   = null;
 }
        /// <summary>
        /// Updates the contextual views.
        /// </summary>
        /// <param name="activatedView">The activated view.</param>
        public void UpdateContextualViews(DocumentView activatedView)
        {
            Argument.IsNotNull("The activated view", activatedView);

            if (activatedView.ViewModel == null || IsContextDependentViewModel(activatedView.ViewModel))
            {
                return;
            }

            // Check what contextual documents have a relationship with the activated document, and set the visibility accordingly
            foreach (var document in _openDocumentViewsCollection)
            {
                if (activatedView.Equals(document))
                {
                    continue;
                }

                if (!IsContextDependentViewModel(document.ViewModel) || HasContextualRelationShip(document.ViewModel, activatedView.ViewModel))
                {
                    ((DocumentView)document).Visibility = Visibility.Visible;
                }
                else
                {
                    ((DocumentView)document).Visibility = Visibility.Collapsed;
                }
            }
        }
        void OnDocumentWindowClosing(object sender, FormClosingEventArgs e)
        {
            DocumentView doc = (DocumentView)sender;

            if (doc.HandleModifiedOnClose && doc.IsModified)
            {
                System.Windows.MessageBoxResult res = System.Windows.MessageBox.Show(DialogMessages.NotSavedDocument,
                                                                                     DialogMessages.SaveDocumentCaption,
                                                                                     System.Windows.MessageBoxButton.YesNoCancel,
                                                                                     System.Windows.MessageBoxImage.Warning);
                if (res == System.Windows.MessageBoxResult.Yes)
                {
                    doc.SaveDocument();
                }
                if (res == System.Windows.MessageBoxResult.Cancel)
                {
                    e.Cancel = true;
                    return;
                }
            }

            doc.FormClosing -= new FormClosingEventHandler(OnDocumentWindowClosing);
            documentViews.Remove(doc);
            propertyBrowserView.ShowProperties(new Object());
        }
Esempio n. 23
0
        public DocumentView GetDocumentView(int id)
        {
            var documentView = new DocumentView();

            if (id == null)
            {
                throw new NullReferenceException();
            }

            var document = _documentsHandler.FindById(id);

            documentView.Id   = document.Id;
            documentView.Name = document.Name;
            documentView.Text = document.Text;

            var steps = new List <Step>(((StepsRepositoryHandler)_stepsHandler)
                                        .GetDocumentSteps(document.Id));

            var path = new StringBuilder();

            foreach (var step in steps)
            {
                string fullName = step.User == null ?
                                  "Неизвестный" :
                                  step.User.FirstName + " " + step.User.LastName + " " + step.User.Patronymic;

                var status = step.Status == true
                    ? "Подписано"
                    : step.Status == false ? "Отклонено" : "Не подписано";

                path.Append("<span>" + fullName + "-" + status + "</span></br>");
            }
            documentView.Path = path.ToString();
            return(documentView);
        }
Esempio n. 24
0
        public FrameworkElement GetPropertyPage(EPropPage pg, string connection, string lang)
        {
            switch (pg)
            {
            case EPropPage.pDokument:
                var vmDoc = new DocumentViewModel();
                Nacist(vmDoc);
                vmDoc.Broker = s_broker;
                var docView = new DocumentView {
                    DataContext = vmDoc
                };
#if (DEBUG)
                return(new Okna.Plugins.Interception.InterceptionView(docView, true));
#else
                return(docView);
#endif

            case EPropPage.pDziura:
                var vmPos = new PositionViewModel();
                Nacist(vmPos);
                s_broker.Position = vmPos;
                var posView = new PositionView {
                    DataContext = vmPos
                };
#if (DEBUG)
                return(new Okna.Plugins.Interception.InterceptionView3(posView));
#else
                return(posView);
#endif
            }

            return(null);
        }
Esempio n. 25
0
        internal void menuNew_DropDownOpening(object sender, EventArgs e)
        {
            ToolStripDropDown dropdown = ((ToolStripDropDownItem)sender).DropDown;

            string[] pluginNames = PluginManager.GetNames <INewFileOpener>();
            if (pluginNames.Length > 0)
            {
                dropdown.Items.Add(new ToolStripSeparator()
                {
                    Name = "8:12"
                });
            }
            var plugins = from name in pluginNames
                          let plugin = PluginManager.Get <INewFileOpener>(name)
                                       orderby plugin.FileTypeName ascending
                                       select plugin;

            foreach (var plugin in plugins)
            {
                ToolStripMenuItem item = new ToolStripMenuItem(plugin.FileTypeName)
                {
                    Name = "8:12"
                };
                item.Image  = plugin.FileIcon;
                item.Click += (s, ea) =>
                {
                    DocumentView view = plugin.New();
                    if (view != null)
                    {
                        AddDocument(view);
                    }
                };
                dropdown.Items.Add(item);
            }
        }
Esempio n. 26
0
        protected override async Task ExecuteAsync(OleMenuCmdEventArgs e)
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            DTE2 dte = await VS.GetServiceAsync <EnvDTE.DTE, DTE2>();

            if (dte?.ActiveDocument == null)
            {
                return;
            }

            try
            {
                DocumentView docView = await VS.Documents.GetActiveDocumentViewAsync();

                if (docView?.TextView != null)
                {
                    ResetZoom(dte, docView.TextView);
                }
            }
            catch (Exception ex)
            {
                await ex.LogAsync();
            }
        }
Esempio n. 27
0
        void DocumentView_FormClosed(object sender, FormClosedEventArgs e)
        {
            DocumentView docView = (DocumentView)sender;

            mDocumentViews.Remove(docView);
            docView.Document.Views.Remove(docView);
        }
        public SaveDocumentWindow(Document doc, DocumentView view)
        {
            this._documentToSave = doc;
            this._currentView = view;

            InitializeComponent();
        }
Esempio n. 29
0
 private void HandleLeftArrow(ObservableCollection <string> document, DocumentView view)
 {
     if (view.CurrentCharacter > 0)
     {
         view.CurrentCharacter--;
     }
 }
Esempio n. 30
0
        private static void ScintillaNet_InsertCheck(object sender, InsertCheckEventArgs e)
        {
            DocumentView documentView = ((MainWindow)App.Current.MainWindow).ActiveDocument;

            if (documentView == null)
            {
                return;
            }

            ScintillaNET.WPF.ScintillaWPF scintilla = documentView.scintilla;
            var currentPos = scintilla.CurrentPosition;

            if (e.Text == "\u0013")
            {
                e.Text = string.Empty;
                return;
            }

            if ((e.Text.EndsWith("\r") || e.Text.EndsWith("\n")))
            {
                var curLine     = scintilla.LineFromPosition(e.Position);
                var curLineText = scintilla.Lines[curLine].Text.Replace("\r", "").Replace("\n", "");

                var indent = Regex.Match(curLineText, @"^\s*");
                e.Text += indent.Value;

                if (Regex.IsMatch(curLineText, @"{\s*$"))
                {
                    e.Text += '\t';
                }
            }
        }
Esempio n. 31
0
 private void HandleDownArrow(ObservableCollection <string> document, DocumentView view)
 {
     if (view.CurrentLine < document.Count - 1)
     {
         view.CurrentLine++;
     }
 }
Esempio n. 32
0
        private CommandExecutionResult Convert(DocumentView documentView)
        {
            var convertEnum = new Func <DocumentViewType, CommandExecutionResultType>(it =>
            {
                switch (it)
                {
                case DocumentViewType.Ok:
                    return(CommandExecutionResultType.Ok);

                case DocumentViewType.Warning:
                    return(CommandExecutionResultType.Warning);

                case DocumentViewType.Error:
                    return(CommandExecutionResultType.Error);
                }
                throw new ArgumentException($"Unknown DocumentViewType - {it}.");
            });
            var result = new CommandExecutionResult
            {
                Content = documentView.Content,
                Type    = convertEnum(documentView.Type)
            };

            return(result);
        }
Esempio n. 33
0
        private void HandleBackspace(ObservableCollection <string> document, DocumentView view)
        {
            var start = view.CurrentCharacter;

            if (start == 0)
            {
                if (view.CurrentLine == 0)
                {
                    return;
                }

                var currentLine  = document[view.CurrentLine];
                var previousLine = document[view.CurrentLine - 1];

                document.RemoveAt(view.CurrentLine);

                view.CurrentLine--;

                document[view.CurrentLine] = previousLine + currentLine;

                view.CurrentCharacter = previousLine.Length;
            }
            else
            {
                var lineIndex = view.CurrentLine;
                var line      = document[lineIndex];

                var before = line.Substring(0, start - 1);
                var after  = line.Substring(start);

                document[lineIndex] = before + after;

                view.CurrentCharacter--;
            }
        }
        private DocumentView DocumentViewFactory()
        {
            var documentView = new DocumentView();
            var behaviour = this.FindBehaviour(documentView);
            behaviour.HtmlQueryHandler = new StubQueryHandler<Strings.Html>(() => "<!DOCTYPE html><html><body>RenderedViewInitialiserTests</body></html>");

            return documentView;
        }
Esempio n. 35
0
 public void Disconnect()
 {
     if (view == null) return;
     ClearSpellCheckErrors();
     view.TextView.BackgroundRenderers.Remove(spellCheckRenderer);
     view.TextView.VisualLinesChanged -= TextViewVisualLinesChanged;
     view = null;
 }
        private DocumentView DocumentViewFactory()
        {
            var documentView = new DocumentView();
            var behaviour = this.FindBehaviour(documentView);
            behaviour.NamedResources = new StubNamedResourcesProvider(xshd);

            return documentView;
        }
 public void Initialise(DocumentView documentView)
 {
     view = documentView;
     view.TextView.BackgroundRenderers.Add(searchRenderer);
     view.TextView.VisualLinesChanged += TextViewVisualLinesChanged;
     view.Editor.TextArea.SelectionChanged += TextAreaOnSelectionChanged;
     DoSearch(SearchType.Normal, false);
 }
 public void Disconnect()
 {
     if (view == null) return;
     ClearSearchHits();
     view.TextView.BackgroundRenderers.Remove(searchRenderer);
     view.TextView.VisualLinesChanged -= TextViewVisualLinesChanged;
     view.Editor.TextArea.SelectionChanged -= TextAreaOnSelectionChanged;
     view = null;
 }
 private mshtml.IHTMLElement Body(DocumentView documentView)
 {
     mshtml.IHTMLElement body = null;
     while (body == null || body.innerHTML == null)
     {
         this.Pause();
         var document = (mshtml.IHTMLDocument2)documentView.RenderedView.Document;
         body = (mshtml.IHTMLElement)document.body;
     }
     return body;
 }
 /// <summary>
 /// Use this constructor if you want to show the document creation introduction.
 /// </summary>
 /// <param name="parentViewModel">The parent ViewModel</param>
 public DocumentEditViewModel(DocumentView.DocumentTabViewModel parentViewModel)
 {
     ContextualTabGroup = parentViewModel.ContextualTabGroup;
     this.ParentViewModel = parentViewModel;
     LinkedDocuments = new Core.Models.DocumentFolderModel();
     DocumentEditRibbonTabItem = new DocumentEditRibbonTabItem(this) { DataContext = this };
     DocumentEditTabHolder = new DocumentEditTabHolder() { DataContext = this };
     DocumentFolderControl = new DocumentFolder(this) { DataContext = this };
     DisplayedTabContent = DocumentFolderControl;
     EditMode = true;
     EditContentTabs = new ObservableCollection<UIElement>();
 }
 private RenderedViewInitialiser FindBehaviour(DocumentView documentView)
 {
     return Interaction.GetBehaviors(documentView)
         .OfType<RenderedViewInitialiser>()
         .Single();
 }
		public VersionControlDocumentInfo (DocumentView document, VersionControlItem item, Repository repository)
		{
			this.Document = document;
			this.Item = item;
			this.Repository = repository;
		}
Esempio n. 43
0
		public bool CanHandle (VersionControlItem item, DocumentView primaryView)
		{
			return true;
		}
        /// <summary>
        /// 
        /// </summary>
        /// <param name="EditOrderControlViewModel"></param>
        /// <returns></returns>
        public async Task ReceiveCloseEditControl(DocumentView.Contextual.DocumentEditViewModel EditOrderControlViewModel)
        {
            //We need to change the visibility during a bug in the RibbonControl which shows the contextual TabHeader after removing a visible item
            EditOrderControlViewModel.RibbonTabItem.Visibility = System.Windows.Visibility.Collapsed;

            ParentViewModel.RibbonFactory.RemoveTabItem(EditOrderControlViewModel.RibbonTabItem);
            DocumentRibbonTabItem.IsSelected = true;
        }
		public bool CanHandle (VersionControlItem item, DocumentView primaryView)
		{
			return (primaryView == null || primaryView.GetContent <ITextFile> () != null)
				&& DesktopService.GetMimeTypeIsText (DesktopService.GetMimeTypeForUri (item.Path));
		}
 private AvalonEditRepeatBulletBehaviour FindBehaviour(DocumentView documentView)
 {
     return Interaction.GetBehaviors(documentView)
         .OfType<AvalonEditRepeatBulletBehaviour>()
         .Single();
 }
        private DocumentView SetTextWithNewLine(string startText, int currentLine = 0)
        {
            var documentView = new DocumentView();
            var behaviour = this.FindBehaviour(documentView);

            documentView.TextEditor.Document.Text += startText + Environment.NewLine;

            behaviour.LineInsertedCallBack(
                documentView.TextEditor.Document.Lines[currentLine],
                documentView.TextEditor.Document.Lines[currentLine + 1]);

            behaviour.TextEditor_TextChanged(documentView.TextEditor, null);

            return documentView;
        }
        private DocumentView AppendText(DocumentView documentView, string extraText)
        {
            var behaviour = this.FindBehaviour(documentView);

            documentView.TextEditor.Document.Text += extraText;

            behaviour.TextEditor_TextChanged(documentView.TextEditor, null);

            return documentView;
        }
 private AvalonEditInitialiser FindBehaviour(DocumentView documentView)
 {
     return Interaction.GetBehaviors(documentView)
         .OfType<AvalonEditInitialiser>()
         .Single();
 }
Esempio n. 50
0
 public static void LoadRegions(DocumentView document, DocumentPattern documentPattern)
 {
 }
Esempio n. 51
0
 public void Initialise(DocumentView documentView)
 {
     view = documentView;
     view.TextView.BackgroundRenderers.Add(spellCheckRenderer);
     view.TextView.VisualLinesChanged += TextViewVisualLinesChanged;
 }
		public bool CanHandle (VersionControlItem item, DocumentView primaryView)
		{
			return (primaryView == null || primaryView.GetContent <MonoDevelop.SourceEditor.SourceEditorView> () != null)
				&& item.Repository.GetFileIsText (item.Path);
		}
		public bool CanHandle (VersionControlItem item, DocumentView primaryView)
		{
			return (primaryView == null || primaryView.GetContent <ITextFile> () != null)
				&& item.Repository.GetFileIsText (item.Path);
		}
 public DocumentRibbonTabItem(DocumentView.DocumentTabViewModel ViewModel)
 {
     InitializeComponent();
     _ParentViewModel = ViewModel;
     DataContext = _ParentViewModel;
 }