コード例 #1
0
ファイル: FormMain.cs プロジェクト: cnacha/PAT.ADL
 private void showErrorListToolStripMenuItem_CheckStateChanged(object sender, EventArgs e)
 {
     try
     {
         if (MenuButton_ErrorList.Checked)
         {
             if (ErrorListWindow.IsDisposed)
             {
                 ErrorListWindow                       = new ErrorListWindow();
                 ErrorListWindow.Icon                  = Ultility.GetIcon("ErrorList");
                 ErrorListWindow.Disposed             += new EventHandler(ErrorListWindow_Disposed);
                 ErrorListWindow.ListView.DoubleClick += new EventHandler(ErrorListView_DoubleClick);
             }
             ErrorListWindow.Show(DockContainer);
         }
         else
         {
             try
             {
                 ErrorListWindow.Hide();
             }
             catch (Exception)
             {
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
コード例 #2
0
ファイル: FormMain.cs プロジェクト: cnacha/PAT.ADL
        public FormMain()
        {
            InitializeComponent();

            DockContainer          = new DockContainer();
            DockContainer.MainForm = this;
            DockContainer.Dock     = DockStyle.Fill;

            this.toolStripContainer1.ContentPanel.Controls.Add(this.DockContainer);

            DockContainer.ShowDocumentIcon = true;

            DockContainer.DocumentStyle = DocumentStyles.DockingWindow;

            DockContainer.ActiveDocumentChanged += new EventHandler(_DockContainer_ActiveDocumentChanged);

            DockContainer.ActiveContentChanged += new EventHandler(_DockContainer_ActiveContentChanged);

            DockContainer.ContextMenu = new ContextMenu();

            Assembly exe = this.GetType().Assembly;

            ResourceService.RegisterNeutralStrings(new ResourceManager("PAT.Main.Properties.StringResources", exe));
            ResourceService.RegisterNeutralImages(new ResourceManager("PAT.Main.Properties.BitmapResources", exe));

            WorkbenchSingleton.DockContainer = DockContainer;
            WorkbenchSingleton.InitializeWorkbench();

            CoreStartup startup = new CoreStartup(Common.Ultility.Ultility.APPLICATION_NAME);

            startup.ConfigDirectory = Common.Ultility.Ultility.APPLICATION_PATH;
            startup.DataDirectory   = Common.Ultility.Ultility.APPLICATION_PATH;

            startup.StartCoreServices();
            startup.RunInitialization();

            ((ToolStripProfessionalRenderer)StandardToolBar.Renderer).ColorTable.UseSystemColors = true;

            Output_Window           = new OutputDockingWindow();
            Output_Window.Icon      = Common.Ultility.Ultility.GetIcon("Output");
            Output_Window.Disposed += new EventHandler(output_Window_Disposed);

            ErrorListWindow                       = new ErrorListWindow();
            ErrorListWindow.Icon                  = Common.Ultility.Ultility.GetIcon("ErrorList");
            ErrorListWindow.Disposed             += new EventHandler(ErrorListWindow_Disposed);
            ErrorListWindow.ListView.DoubleClick += new EventHandler(ErrorListView_DoubleClick);


            this.toolStripContainer1.TopToolStripPanel.Controls.Clear();
            this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.FunctionalToolBar);
            this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.StandardToolBar);
            this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.MenuStrip);

            StandardToolBar.Location   = new Point(3, 24);
            FunctionalToolBar.Location = new Point(3, 49);
            FunctionalToolBar.Size     = new Size(409, 25);
            MenuStrip.Dock             = DockStyle.Top;
            MenuStrip.Location         = new Point(0, 0);

            CheckForItemState();

            CurrentModule = new ModuleFacade();
            Language      = HighlightingManager.Manager.AddHighlightingStrategy(Path.Combine(Application.StartupPath, "Syntax.xshd"));
            OpenFilter    = Language.Name + " (*" + Language.ExtensionString + ")|*" + Language.ExtensionString;

            CurrentModule.ShowModel += new ShowModelHandler(ShowModel);
            CurrentModule.ExampleMenualToolbarInitialize(this.MenuButton_Examples);
            CurrentModule.ReadConfiguration();

            //Common.Ultility.Ultility.ModuleFolderNames.Add(moduleFolderName);
            Common.Ultility.Ultility.ModuleNames      = new List <string>();
            Common.Ultility.Ultility.ModuleDictionary = new Dictionary <string, ModuleFacadeBase>();

            Common.Ultility.Ultility.ModuleNames.Add(Language.Name);
            Common.Ultility.Ultility.ModuleDictionary.Add(Language.Name, CurrentModule);
            Common.Ultility.Ultility.Images.ImageList.Images.Add(Language.Name, CurrentModule.ModuleIcon);

            this.FunctionalToolBar.SuspendLayout();
            CurrentModule.ToolbarInitialize(this.FunctionalToolBar, Toolbar_Button_Click);
            this.FunctionalToolBar.ResumeLayout();
        }