コード例 #1
0
 public DocumentPage(IMainForm main_form, ActiveCodeFile file)
     : this(main_form, file.FileExtension)
 {
     InitializeComponent();
     UpdateFileName(file);
     ActiveFile = file;
     //this.ImageIndex = 0;
 }
コード例 #2
0
        public void OpenFile()
        {
            OpenFileDialog open = new OpenFileDialog();
            open.Filter = "All Files (*.*)|*.*";

            if (open.ShowDialog() == DialogResult.OK)
            {
                ActiveCodeFile file = new ActiveCodeFile(open.FileName);
                file.Unsaved = false;
                OpenFile(file);
            }
        }
コード例 #3
0
 internal void UpdateFileName(ActiveCodeFile file)
 {
     //System.Console.WriteLine("DocumentPage.UpdateFileName to " + file.FileName);
     Text = file.FileName;
 }
コード例 #4
0
 public void OpenFile(IMainForm main_form, ActiveCodeFile file)
 {
     DocumentPage tab = new DocumentPage(main_form, file);
     if (FontToUse != null)
         tab.Input.Font = FontToUse;
     tab.SetInitialText(File.ReadAllText(file.Location));
     tabControl.TabPages.Add(tab);
     tabControl.SelectedTab = tab;
 }
コード例 #5
0
ファイル: PyjamaForm.cs プロジェクト: roboshepherd/myro-epuck
 public void OpenFile(IMainForm main_form, ActiveCodeFile file)
 {
     _docManager.OpenFile(main_form, file);
     SetButtonsStatus();
 }
コード例 #6
0
 public void OpenFile(ActiveCodeFile file)
 {
     if (File.Exists(file.Location))
         pyjamaForm.OpenFile(pyjamaForm, file);
     else
         throw new FileNotFoundException("File not found", file.Location);
 }
コード例 #7
0
 public void OpenFile(string filename)
 {
     ActiveCodeFile file = new ActiveCodeFile(filename);
     file.Unsaved = false;
     OpenFile(file);
 }
コード例 #8
0
        private ActiveCodeFile CreateDefaultActiveFile(string language)
        {
            // FIXME: connect to loaded languages in Shell
            string usedFileExt = ApplicationOptions.DefaultExtension;
            string file = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) + usedFileExt;
            string path = Path.Combine(Path.GetTempPath(), file);
            using (StreamWriter sw = new StreamWriter(path))
                sw.Close();

            ActiveCodeFile code = new ActiveCodeFile();
            code.Location = path;
            code.Untitled = true;
            code.FileName = "Untitled";
            code.Unsaved = true;
            return code;
        }