Esempio n. 1
0
        private void RemoveFileView(FileViewTab fileView)
        {
            bool found = this.FileViewTabs.TabPages.Cast<FileViewTab>().Any(tab => tab == fileView);

            if(found)
                this.FileViewTabs.TabPages.Remove(fileView);

        }
Esempio n. 2
0
        private void RemoveFileView(FileViewTab fileView)
        {
            bool found = this.FileViewTabs.TabPages.Cast <FileViewTab>().Any(tab => tab == fileView);

            if (found)
            {
                this.FileViewTabs.TabPages.Remove(fileView);
            }
        }
Esempio n. 3
0
        public void AddFileView(FileViewType type, string filePath)
        {
            if (!File.Exists(filePath))
            {
                EventDispatcher.Raise(new UserNotificationEvent("File '{0}' not found".FormatWith(filePath), UserNotificationType.Warning));
                return;
            }

            var tab = new FileViewTab(filePath, new ClassDiagramView(filePath));

            tab.ContextMenu = new ContextMenu(new []{new MenuItem("Close", (sender, args) =>
                {
                    MenuItem item = (MenuItem) sender;
                    FileViewTab t = (FileViewTab) item.Tag;
                    RemoveFileView(t);
                }){Tag = tab}
            });

            this.FileViewTabs.TabPages.Add(tab);
            this.FileViewTabs.SelectedTab = tab;
        }
Esempio n. 4
0
        public void AddFileView(FileViewType type, string filePath)
        {
            if (!File.Exists(filePath))
            {
                EventDispatcher.Raise(new UserNotificationEvent("File '{0}' not found".FormatWith(filePath), UserNotificationType.Warning));
                return;
            }

            var tab = new FileViewTab(filePath, new ClassDiagramView(filePath));

            tab.ContextMenu = new ContextMenu(new [] { new MenuItem("Close", (sender, args) =>
                {
                    MenuItem item = (MenuItem)sender;
                    FileViewTab t = (FileViewTab)item.Tag;
                    RemoveFileView(t);
                })
                                                       {
                                                           Tag = tab
                                                       } });

            this.FileViewTabs.TabPages.Add(tab);
            this.FileViewTabs.SelectedTab = tab;
        }