Exemple #1
0
 public void LoadDiagram(IGraphData diagram)
 {
     InvertGraphEditor.DesignerWindow = this;
     if (diagram == null)
     {
         return;
     }
     try
     {
         DiagramDrawer       = new DiagramDrawer(new DiagramViewModel(diagram));
         DiagramDrawer.Dirty = true;
         //DiagramDrawer.Data.ApplyFilter();
         DiagramDrawer.Refresh(InvertGraphEditor.PlatformDrawer);
     }
     catch (Exception ex)
     {
         InvertApplication.LogException(ex);
         InvertApplication.Log("Either a plugin isn't installed or the file could no longer be found. See Exception error");
     }
 }
Exemple #2
0
        public static void GenerateFile(FileInfo fileInfo, CodeFileGenerator codeFileGenerator)
        {
            // Get the path to the directory
            var directory = System.IO.Path.GetDirectoryName(fileInfo.FullName);

            // Create it if it doesn't exist
            if (directory != null && !Directory.Exists(directory))
            {
                Directory.CreateDirectory(directory);
            }
            try
            {
                // Write the file
                File.WriteAllText(fileInfo.FullName, codeFileGenerator.ToString());
            }
            catch (Exception ex)
            {
                InvertApplication.LogException(ex);
                InvertApplication.Log("Coudln't create file " + fileInfo.FullName);
            }
        }