Example #1
0
 public void OpenFile(ActiveCodeFile file)
 {
     IDETab tab = new IDETab(file);
     if (FontToUse != null)
         tab.Input.Font = FontToUse;
     tab.SetInitialText(File.ReadAllText(file.Location));
     tabControl.TabPages.Add(tab);
     tabControl.SelectedTab = tab;
 }
Example #2
0
 public IDETab(ActiveCodeFile file)
     : this(file.FileExtension)
 {
     UpdateFileName(file);
     ActiveFile = file;
 }
Example #3
0
 internal void UpdateFileName(ActiveCodeFile file)
 {
     Text = file.FileName;
 }
Example #4
0
 private void OnOpenFileRequest(ActiveCodeFile file)
 {
     if(OpenFileRequest != null)
     {
         OpenFileEventArgs e = new OpenFileEventArgs();
         e.File = file;
         OpenFileRequest(this, e);
     }
 }
Example #5
0
        private ActiveCodeFile CreateDefaultActiveFile(string language)
        {
            string[] fileExt = FindExtensionByLanguage(language);
            string usedFileExt = fileExt.Length > 0 ? fileExt[0] : 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.Unsaved = true;
            return code;
        }
Example #6
0
 public void OpenFile(ActiveCodeFile file)
 {
     if (File.Exists(file.Location))
         MainForm.OpenFile(file);
     else
         throw new FileNotFoundException("File not found", file.Location);
 }
Example #7
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);
            }
        }
Example #8
0
 public void OpenFile(ActiveCodeFile file)
 {
     fileManager1.OpenFile(file);
     SetButtonsStatus();
 }