示例#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);
 }
示例#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;
 }
示例#5
0
 public SourceFileTabPage(SourceFile sourceFile)
 {
     InitializeComponent();
     SourceFile = sourceFile;
 }
示例#6
0
 public void AddSourceFile(SourceFile sourceFile)
 {
     _ScriptSequenceData.SourceFiles.Add(sourceFile);
 }
示例#7
0
 private SourceFile _CreateBlankFile(string fileName)
 {
     SourceFile sourceFile = new SourceFile(Path.GetFileName(fileName));
     AddSourceFile(sourceFile);
     return sourceFile;
 }
示例#8
0
 public bool RemoveSourceFile(SourceFile sourceFile)
 {
     return _ScriptSequenceData.SourceFiles.Remove(sourceFile);
 }