Beispiel #1
0
 public static SourceFile Load(string filePath)
 {
     if (File.Exists(filePath)) {
         SourceFile sourceFile = new SourceFile(Path.GetFileName(filePath));
         sourceFile.Contents = File.ReadAllText(filePath);
         return sourceFile;
     }
     throw new ArgumentException("File does not exist.");
 }
 private string _GetSourceFilePath(SourceFile sourceFile)
 {
     return Path.Combine(SourceFileDirectory, sourceFile.Name);
 }
Beispiel #3
0
        private void _AddFileTab(SourceFile sourceFile)
        {
            if (sourceFile == null) return;

            TabPage tabPage = new TabPage(sourceFile.Name);
            SourceFileTabPage sourceControl = new SourceFileTabPage(sourceFile);
            sourceControl.SelectionChanged += SourceSelectionChanged;
            _sources.Add(sourceControl);
            tabPage.Controls.Add(sourceControl);
            sourceControl.Dock = DockStyle.Fill;
            tabControl.TabPages.Add(tabPage);
        }
 public SourceFileSurrogate(SourceFile sourceFile)
 {
     Name = sourceFile.Name;
 }
Beispiel #5
0
 public SourceFileTabPage(SourceFile sourceFile)
 {
     InitializeComponent();
     SourceFile = sourceFile;
 }
Beispiel #6
0
 public void AddSourceFile(SourceFile sourceFile)
 {
     _ScriptSequenceData.SourceFiles.Add(sourceFile);
 }
Beispiel #7
0
 private SourceFile _CreateBlankFile(string fileName)
 {
     SourceFile sourceFile = new SourceFile(Path.GetFileName(fileName));
     AddSourceFile(sourceFile);
     return sourceFile;
 }
Beispiel #8
0
 public bool RemoveSourceFile(SourceFile sourceFile)
 {
     return _ScriptSequenceData.SourceFiles.Remove(sourceFile);
 }