public FXProject(string path, string includePath) : base(path) { //missusing a DotNetExecutable here.. CompilerResults = new CompilerResults(null); FIncludePath = includePath; var document = DocumentFactory.CreateDocumentFromFile(LocalPath) as FXDocument; Documents.Add(document); UpdateReferences(); }
private void TryToAddReference(string path, string filename, bool isLocal, ref List <FXReference> refs) { var include = path.ConcatPath(filename.Replace("/", @"\")); if (File.Exists(include)) { var doc = DocumentFactory.CreateDocumentFromFile(include) as FXDocument; if (doc != null) { refs.Add(new FXReference(doc, isLocal)); } } }
protected override void DoLoad() { var projectPath = Location.LocalPath; Document = DocumentFactory.CreateDocumentFromFile(projectPath) as FXDocument; Document.Load(); Documents.Add(Document); UpdateReferences(); base.DoLoad(); }
public FXProject(string path, string includePaths) : base(path) { //missusing a DotNetExecutable here.. CompilerResults = new CompilerResults(null); FIncludePaths = includePaths.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); var document = DocumentFactory.CreateDocumentFromFile(LocalPath) as FXDocument; Documents.Add(document); UpdateReferences(); }
protected IDocument ExistingDocumentCreator() { var dialog = new OpenFileDialog(); dialog.InitialDirectory = FProject.Location.GetLocalDir(); if (dialog.ShowDialog() == DialogResult.OK) { return(DocumentFactory.CreateDocumentFromFile(dialog.FileName)); } else { return(null); } }
public void Open(string filename) { var document = FSolution.FindDocument(filename) as ITextDocument; if (document == null) { document = DocumentFactory.CreateDocumentFromFile(filename) as ITextDocument; } if (document != null) { OpenedFile = filename; FEditor.TextDocument = document; AttachedProject = document.Project; if (document is CSDocument) { var csDoc = document as CSDocument; FEditor.CompletionBinding = new CSCompletionBinding(FEditor); FEditor.FormattingStrategy = new CSFormattingStrategy(FEditor); FEditor.FoldingStrategy = new CSFoldingStrategy(); FEditor.LinkDataProvider = new CSLinkDataProvider(FEditor); FEditor.ToolTipProvider = new CSToolTipProvider(FEditor); } else if (document is FXDocument) { FEditor.CompletionBinding = new FXCompletionBinding(FEditor); FEditor.FormattingStrategy = new FXFormattingStrategy(FEditor); FEditor.LinkDataProvider = new FXLinkDataProvider(Path.GetDirectoryName(filename), Path.Combine(FHDEHost.ExePath, "lib", "nodes")); } document.ContentChanged += document_ContentChanged; document.Saved += document_Saved; document.Renamed += document_Renamed; document.Disposed += document_Disposed; SynchronizationContext.Current.Post((o) => UpdateWindowCaption(document, document.Name), null); } else { FLogger.Log(LogType.Warning, "Can't open \0", filename); } }
protected IDocument DocumentCreator() { var dialog = new NameDialog(); if (dialog.ShowDialog() == DialogResult.OK) { var name = dialog.EnteredText; var projectDir = Path.GetDirectoryName(FProject.LocalPath); var documentPath = projectDir.ConcatPath(name); var document = DocumentFactory.CreateDocumentFromFile(documentPath); if (!File.Exists(document.LocalPath)) { document.SaveTo(document.LocalPath); } return(document); } else { return(null); } }