public void RemoveTab(File file)
 {
     foreach (FilesTabItem filesTabItem in TabControl.Items.Cast<FilesTabItem>()) 
     {
         if (filesTabItem.File == file)
         {
             TabControl.Items.Remove(filesTabItem);
             break;
         }
     }
 }
        //
        public FilesTabItem AddTab(File file)
        {
            FilesTabItem newTabItem = new FilesTabItem();
            newTabItem.Initialize(file);

            TabControl.Items.Add(newTabItem);

            TabControl.SelectedItem = newTabItem;

            return newTabItem;
        }
        public void Initialize(File file)
        {
            File = file;
            File.Saved += new FileManagement.EventHandler(Saved);
            File.Changed += new FileManagement.EventHandler(Changed);

            Header = File.FileName;

            FileView fileView = new FileView();
            fileView.Initialize(file);

            Content = fileView;

            // Load file
            if (File.sourceXml != null)
            {
                XMLParser.Parse(File.sourceXml, file);
            }
        }
Ejemplo n.º 4
0
        public void Close(File file)
        {
            if (file.IsChanged)
            {
                file.Save();
            }

            TabCollection.RemoveTab(file);
        }
Ejemplo n.º 5
0
 public FileState(File file)
 {
     this.file = file;
 }
Ejemplo n.º 6
0
 public void Initialize(File file)
 {
     // Notify the file that we are its viewer
     file.FileView = this;
 }