public JavaSourceViewModel(JavaSource view, string path)
 {
     _view = view;
     this.ExistsOnFileSystem = true;
     this.FilePath           = path;
 }
 public JavaSourceViewModel(JavaSource view)
 {
     _view = view;
     this.ExistsOnFileSystem = false;
     this.IsUnsaved          = true;
 }
 public void newJavaSource()
 {
     JavaSource java = new JavaSource("Untitled.java", this);
     java.GetVM().OnLoaded();
     var firstDocumentPane = View.dockingManager.Layout.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault();
     if (firstDocumentPane != null)
     {
         firstDocumentPane.Children.Add(java);
         java.IsSelected = true;
     }
 }
 public void DocumentClosed(JavaSource newDoc)
 {
     if (newDoc == null) throw new ArgumentNullException();
     if (ActiveDocuments.Contains(newDoc)) ActiveDocuments.Remove(newDoc);
     if (ActiveDocument != null) this.TitlePre = ActiveDocument.GetVM().TitleName;
     else this.TitlePre = "";
 }
 public void DisplayFile(string p)
 {
     string fileName = p.Substring(p.LastIndexOf("\\")).Remove(0, 1);
     string fileExt = fileName.Substring(fileName.LastIndexOf("."));
     switch (fileExt)
     {
         case ".java":
             {
                 JavaSource java = new JavaSource(p, fileName, this);
                 java.GetVM().OnLoaded();
                 var firstDocumentPane = View.dockingManager.Layout.Descendents().OfType<LayoutDocumentPane>().FirstOrDefault();
                 if (firstDocumentPane != null)
                 {
                     firstDocumentPane.Children.Add(java);
                     java.IsSelected = true;
                 }
                 break;
             }
     }
 }
 public JavaSourceViewModel(JavaSource view)
 {
     _view = view;
     this.ExistsOnFileSystem = false;
     this.IsUnsaved = true;
 }
 public JavaSourceViewModel(JavaSource view, string path)
 {
     _view = view;
     this.ExistsOnFileSystem = true;
     this.FilePath = path;
 }