Ejemplo n.º 1
0
 protected virtual string GetDocumentText()
 {
     if (!IsVirtual)
     {
         //If we are edited, grab the text from the document.  If we aren't edited, read it from the file
         if (IsEdited)
         {
             //Get the open text editor and grab it's text
             TextEditor editor = GetEditor <TextEditor>();
             return(editor.GetEditorText());
         }
         else
         {
             if (Source == DocumentSource.File)
             {
                 return(File.ReadAllText(Path));
             }
             else
             {
                 return(DotaData.ReadAllText(Path));
             }
         }
     }
     else //If we are a virtual text document, that means a subclass is handling this bit.
     {
         return("");
     }
 }
Ejemplo n.º 2
0
 protected override string GetDocumentText()
 {
     //If we are edited, grab the text from the document.  If we aren't edited, read it from the file
     if (IsEdited)
     {
         //Get the open text editor and grab it's text
         TextEditor editor = GetEditor <TextEditor>();
         return(editor.GetEditorText());
     }
     else
     {
         if (Source == DocumentSource.File)
         {
             return(File.ReadAllText(Path));
         }
         else
         {
             return(DotaData.ReadAllText(Path));
         }
     }
 }