public GGitViewer(string filepath) { _filepath = filepath; GH_DocumentIO doc = new GH_DocumentIO(); doc.Open(filepath); document = doc.Document; InitializeComponent(); ListInit(); }
private void LoadGhDocument() { if (content.type != TaskContentType.file) { return; } string file = content.value; if (!File.Exists(file)) { ErrorEvent(this, "Work file is not exist!"); return; } GH_DocumentIO io = new GH_DocumentIO(); io.Open(file); GH_Document doc = GH_Document.DuplicateDocument(io.Document); if (doc == null) { ErrorEvent(this, "Cannot read this file!"); return; } GH_DocumentServer server = Instances.DocumentServer; if (server == null) { ErrorEvent(this, "No Document Server exist!"); return; } server.AddDocument(doc); doc.Properties.ProjectFileName = ID.ToString(); GH_Canvas activeCanvas = Instances.ActiveCanvas; if (activeCanvas == null) { ErrorEvent(this, "No Active Canvas exist!"); return; } activeCanvas.Document = doc; activeCanvas.Document.IsModified = false; activeCanvas.Refresh(); // SolutionEndCnt = 0; doc.SolutionEnd += Doc_SolutionEnd; UpdateData(true); }
protected override void BeforeSolveInstance() { if (packagePath != null) { GH_DocumentIO io = new GH_DocumentIO(); io.Open(packagePath); m_document = io.Document; if (!inputAdjusted) { AdjustPackageInput(); } if (!outputAdjusted) { AdjustPackageOutput(); } SetPackageInput(); } }
private void LoadGhDocument(string file) { if (!System.IO.File.Exists(file)) { return; } GH_DocumentIO io = new GH_DocumentIO(); io.Open(file); GH_Document doc = GH_Document.DuplicateDocument(io.Document); if (doc == null) { return; } GH_DocumentServer server = Instances.DocumentServer; if (server == null) { return; } server.AddDocument(doc); doc.Properties.ProjectFileName = ID.ToString(); GH_Canvas activeCanvas = Instances.ActiveCanvas; if (activeCanvas == null) { return; } activeCanvas.Document = doc; activeCanvas.Document.IsModified = false; activeCanvas.Refresh(); doc.SolutionEnd += Doc_SolutionEnd; }