Пример #1
0
        public void TestItemContainerGeneratorRefresh()
        {
            var items = new ObservableCollection <string>
            {
                "1",
                "2",
                "3"
            };

            var tabControl = new TabControlEx
            {
                ItemsSource = items
            };

            using (new TestWindow(tabControl))
            {
                var itemsPanel = (Panel)tabControl.GetType().GetField("itemsHolder", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(tabControl);

                var tabItemsInitial = GetTabItems(tabControl);

                Assert.That(tabItemsInitial, Has.Count.EqualTo(3));

                Assert.That(itemsPanel.Children.Count, Is.EqualTo(1));

                tabControl.ItemContainerGenerator.GetType().GetMethod("Refresh", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(tabControl.ItemContainerGenerator, null);

                UITestHelper.DoEvents();

                Assert.That(itemsPanel.Children.Count, Is.EqualTo(1));
            }
        }
Пример #2
0
 public SearchHandler(
     LibraryModel libraryModel
     , TabControlEx mainViewTabControl
     , TabPage libraryBrowserViewTabPage
     , TabPage galleryBrowserViewTabPage
     , Configuration.ConfigCache cacheSettings
     , ISearchResultCache searchResultCache
     , ILogger logger
     , BrowsingModel browsingModel
     , IPathFormatter pathFormatter
     , HttpClient httpClient
     , IQueryParser queryParser
     , GalleryModel galleryModel
     , DetailsModel detailsModel
     , GalleryDownloader galleryDownloader)
 {
     LibraryModel              = libraryModel;
     MainViewTabControl        = mainViewTabControl;
     LibraryBrowserViewTabPage = libraryBrowserViewTabPage;
     GalleryBrowserViewTabPage = galleryBrowserViewTabPage;
     CacheSettings             = cacheSettings;
     SearchResultCache         = searchResultCache;
     Logger            = logger;
     BrowsingModel     = browsingModel;
     PathFormatter     = pathFormatter;
     HttpClient        = httpClient;
     QueryParser       = queryParser;
     GalleryModel      = galleryModel;
     DetailsModel      = detailsModel;
     GalleryDownloader = galleryDownloader;
 }
Пример #3
0
 public UsbDeviceState(SynchronizationContext syn, Cmd cmd, TabControlEx device)
 {
     mSyn         = syn;
     mCmd         = cmd;
     mDeviceState = Enums.DeviceState.DEVICE_ADB_START_SERVER;
     tag          = device;
 }
Пример #4
0
        private void InitializeComponent_2()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(NormalMainForm));

            this.dockPanel1 = new TabControlEx();
            base.SuspendLayout();
            this.dockPanel1.ColorActivateA = Color.FromArgb(0xd5, 0xe8, 0xf5);
            this.dockPanel1.ColorActivateB = Color.FromArgb(0xae, 0xc4, 0xd4);
            this.dockPanel1.ColorDefaultA  = Color.FromArgb(250, 250, 250);
            this.dockPanel1.ColorDefaultB  = Color.FromArgb(0xe0, 0xe0, 0xe0);
            this.dockPanel1.ColorLine      = Color.FromArgb(0x9d, 0xa2, 0xa8);
            this.dockPanel1.Dock           = DockStyle.Fill;
            this.dockPanel1.Location       = new Point(0, 0);
            this.dockPanel1.Name           = "dockPanel1";
            this.dockPanel1.SelectedIndex  = 0;
            this.dockPanel1.Size           = new Size(0x310, 0x21d);
            this.dockPanel1.TabIndex       = 5;
            base.AutoScaleDimensions       = new SizeF(6f, 12f);
            base.AutoScaleMode             = AutoScaleMode.Font;
            base.ClientSize = new Size(0x310, 0x21d);
            base.Controls.Add(this.dockPanel1);
            base.Icon    = (Icon)manager.GetObject("$this.Icon");
            base.Name    = "NormalMainForm";
            base.TabText = "税控发票开票软件(金税盘版) ";
            this.Text    = "税控发票开票软件(金税盘版) ";
            base.Controls.SetChildIndex(this.dockPanel1, 0);
            base.ResumeLayout(false);
        }
Пример #5
0
        /// <summary>
        /// 判断获取加载的窗体
        /// </summary>
        /// <param name="index"></param>
        public void SetForm(string formClass, string name, TabControlEx tabControlExHfrz)
        {
            TabPage tabPageMapping = new TabPage(name)
            {
                Name = name
            };

            tabControlExHfrz.TabPages.Add(tabPageMapping);
            GenerateForm(formClass, tabPageMapping);
        }
Пример #6
0
        public void TestAddRemoveInsertWithItemsSource()
        {
            var items = new ObservableCollection <string>
            {
                "1",
                "2",
                "3"
            };

            var tabControl = new TabControlEx
            {
                ItemsSource = items
            };

            using (new TestWindow(tabControl))
            {
                var itemsPanel = (Panel)tabControl.GetType().GetField("itemsHolder", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(tabControl);

                var tabItemsInitial = GetTabItems(tabControl);

                Assert.That(tabItemsInitial, Has.Count.EqualTo(3));

                Assert.That(itemsPanel.Children.Count, Is.EqualTo(1));

                foreach (var tabItem in tabItemsInitial)
                {
                    tabItem.IsSelected = true;
                    UITestHelper.DoEvents();
                }

                Assert.That(itemsPanel.Children.Count, Is.EqualTo(3));

                items.RemoveAt(1);
                items.Insert(1, "2");

                UITestHelper.DoEvents();

                Assert.That(itemsPanel.Children.Count, Is.EqualTo(2));
            }
        }
Пример #7
0
 public void Dispose()
 {
     _owner = null;
     base.ReleaseHandle();
 }
Пример #8
0
 public UpDownButtonNativeWindow(TabControlEx owner)
     : base()
 {
     _owner = owner;
     base.AssignHandle(owner.UpDownButtonHandle);
 }
Пример #9
0
 private void InitializeComponent()
 {
     this.tabOptions = new TabControlEx();
     this.tpageDisplay = new TabPage();
     this.cbCapitalIDs = new CheckBox();
     this.cbProductionInfo = new CheckBox();
     this.cbFlashingTaskbarAttack = new CheckBox();
     this.lblAdvanced = new Label();
     this.cbVillageIDs = new CheckBox();
     this.cbConfirmOpenMultiple = new CheckBox();
     this.cbConfirmBuyMultiple = new CheckBox();
     this.btnResumeTutorial = new BitmapButton();
     this.btnDebugInfo = new BitmapButton();
     this.cbTooltips = new CheckBox();
     this.cbInstantTooltips = new CheckBox();
     this.cbConfirmCards = new CheckBox();
     this.cbProfanityFilter = new CheckBox();
     this.cbWhiteTextBox = new CheckBox();
     this.tabPage3 = new TabPage();
     this.cbWinterLandscape = new CheckBox();
     this.cbSeasonalFX = new CheckBox();
     this.cbBattleSFX = new CheckBox();
     this.btnRestoreDefaultVolumes = new BitmapButton();
     this.lblVolumes = new Label();
     this.trackBarEnvironmentals = new TrackBar();
     this.cbEnvironmentals = new CheckBox();
     this.trackBarSFX = new TrackBar();
     this.cbSFX = new CheckBox();
     this.cbGraphicsCompatibility = new CheckBox();
     this.trackBarMusicVolume = new TrackBar();
     this.cbMusic = new CheckBox();
     this.tabPage1 = new TabPage();
     this.btnDownloadTranslations = new BitmapButton();
     this.label1 = new Label();
     this.listBoxLanguages = new ListBox();
     this.btnApply = new BitmapButton();
     this.btnCancel = new BitmapButton();
     this.btnOK = new BitmapButton();
     this.pnlWikiHelp = new Panel();
     this.tabOptions.SuspendLayout();
     this.tpageDisplay.SuspendLayout();
     this.tabPage3.SuspendLayout();
     this.trackBarEnvironmentals.BeginInit();
     this.trackBarSFX.BeginInit();
     this.trackBarMusicVolume.BeginInit();
     this.tabPage1.SuspendLayout();
     base.SuspendLayout();
     this.tabOptions.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
     this.tabOptions.BackColor = Color.FromArgb(0x60, 0x6d, 0x76);
     this.tabOptions.Controls.Add(this.tpageDisplay);
     this.tabOptions.Controls.Add(this.tabPage3);
     this.tabOptions.Controls.Add(this.tabPage1);
     this.tabOptions.ItemSize = new Size(110, 0x15);
     this.tabOptions.Location = new Point(9, 0x25);
     this.tabOptions.Name = "tabOptions";
     this.tabOptions.SelectedIndex = 0;
     this.tabOptions.Size = new Size(0x14f, 0x135);
     this.tabOptions.SizeMode = TabSizeMode.Fixed;
     this.tabOptions.TabIndex = 0;
     this.tabOptions.SelectedIndexChanged += new EventHandler(this.tabOptions_SelectedIndexChanged);
     this.tpageDisplay.BackColor = Color.FromArgb(0x9f, 180, 0xc1);
     this.tpageDisplay.Controls.Add(this.cbCapitalIDs);
     this.tpageDisplay.Controls.Add(this.cbProductionInfo);
     this.tpageDisplay.Controls.Add(this.cbFlashingTaskbarAttack);
     this.tpageDisplay.Controls.Add(this.lblAdvanced);
     this.tpageDisplay.Controls.Add(this.cbVillageIDs);
     this.tpageDisplay.Controls.Add(this.cbConfirmOpenMultiple);
     this.tpageDisplay.Controls.Add(this.cbConfirmBuyMultiple);
     this.tpageDisplay.Controls.Add(this.btnResumeTutorial);
     this.tpageDisplay.Controls.Add(this.btnDebugInfo);
     this.tpageDisplay.Controls.Add(this.cbTooltips);
     this.tpageDisplay.Controls.Add(this.cbInstantTooltips);
     this.tpageDisplay.Controls.Add(this.cbConfirmCards);
     this.tpageDisplay.Controls.Add(this.cbProfanityFilter);
     this.tpageDisplay.Controls.Add(this.cbWhiteTextBox);
     this.tpageDisplay.ForeColor = ARGBColors.Black;
     this.tpageDisplay.Location = new Point(4, 0x19);
     this.tpageDisplay.Name = "tpageDisplay";
     this.tpageDisplay.Padding = new Padding(3);
     this.tpageDisplay.Size = new Size(0x147, 280);
     this.tpageDisplay.TabIndex = 0;
     this.tpageDisplay.Text = "Settings";
     this.cbCapitalIDs.AutoSize = true;
     this.cbCapitalIDs.Location = new Point(0x17, 0x101);
     this.cbCapitalIDs.Name = "cbCapitalIDs";
     this.cbCapitalIDs.Size = new Size(0x67, 0x11);
     this.cbCapitalIDs.TabIndex = 0x19;
     this.cbCapitalIDs.Text = "View Capital IDs";
     this.cbCapitalIDs.UseVisualStyleBackColor = true;
     this.cbCapitalIDs.CheckedChanged += new EventHandler(this.cbCapitalIDs_CheckedChanged);
     this.cbProductionInfo.AutoSize = true;
     this.cbProductionInfo.Location = new Point(0x17, 0xab);
     this.cbProductionInfo.Name = "cbProductionInfo";
     this.cbProductionInfo.Size = new Size(0xd5, 0x11);
     this.cbProductionInfo.TabIndex = 0x18;
     this.cbProductionInfo.Text = "Production Indicators in the Village Map";
     this.cbProductionInfo.UseVisualStyleBackColor = true;
     this.cbProductionInfo.CheckedChanged += new EventHandler(this.cbProductionInfo_CheckedChanged);
     this.cbFlashingTaskbarAttack.AutoSize = true;
     this.cbFlashingTaskbarAttack.Location = new Point(0x17, 0x95);
     this.cbFlashingTaskbarAttack.Name = "cbFlashingTaskbarAttack";
     this.cbFlashingTaskbarAttack.Size = new Size(0xc3, 0x11);
     this.cbFlashingTaskbarAttack.TabIndex = 0x17;
     this.cbFlashingTaskbarAttack.Text = "Flash Taskbar Icon When Attacked";
     this.cbFlashingTaskbarAttack.UseVisualStyleBackColor = true;
     this.cbFlashingTaskbarAttack.CheckedChanged += new EventHandler(this.cbFlashingTaskbarAttack_CheckedChanged);
     this.lblAdvanced.AutoSize = true;
     this.lblAdvanced.Location = new Point(6, 0xd6);
     this.lblAdvanced.Name = "lblAdvanced";
     this.lblAdvanced.Size = new Size(0x5f, 13);
     this.lblAdvanced.TabIndex = 0x16;
     this.lblAdvanced.Text = "Advanced Options";
     this.cbVillageIDs.AutoSize = true;
     this.cbVillageIDs.Location = new Point(0x17, 0xea);
     this.cbVillageIDs.Name = "cbVillageIDs";
     this.cbVillageIDs.Size = new Size(0x66, 0x11);
     this.cbVillageIDs.TabIndex = 0x15;
     this.cbVillageIDs.Text = "View Village IDs";
     this.cbVillageIDs.UseVisualStyleBackColor = true;
     this.cbVillageIDs.CheckedChanged += new EventHandler(this.cbVillageIDs_CheckedChanged);
     this.cbConfirmOpenMultiple.AutoSize = true;
     this.cbConfirmOpenMultiple.Location = new Point(0x17, 0x7f);
     this.cbConfirmOpenMultiple.Name = "cbConfirmOpenMultiple";
     this.cbConfirmOpenMultiple.Size = new Size(0x95, 0x11);
     this.cbConfirmOpenMultiple.TabIndex = 20;
     this.cbConfirmOpenMultiple.Text = "Open Multiple Card Packs";
     this.cbConfirmOpenMultiple.UseVisualStyleBackColor = true;
     this.cbConfirmOpenMultiple.CheckedChanged += new EventHandler(this.cbConfirmOpenMultiple_CheckedChanged);
     this.cbConfirmBuyMultiple.AutoSize = true;
     this.cbConfirmBuyMultiple.Location = new Point(0x17, 0x69);
     this.cbConfirmBuyMultiple.Name = "cbConfirmBuyMultiple";
     this.cbConfirmBuyMultiple.Size = new Size(0x8d, 0x11);
     this.cbConfirmBuyMultiple.TabIndex = 0x13;
     this.cbConfirmBuyMultiple.Text = "Buy Multiple Card Packs";
     this.cbConfirmBuyMultiple.UseVisualStyleBackColor = true;
     this.cbConfirmBuyMultiple.CheckedChanged += new EventHandler(this.cbConfirmBuyMultiple_CheckedChanged);
     this.btnResumeTutorial.BackColor = Color.FromArgb(0xcb, 0xd7, 0xdf);
     this.btnResumeTutorial.BorderColor = Color.FromArgb(0, 0, 0x8b);
     this.btnResumeTutorial.BorderDrawing = true;
     this.btnResumeTutorial.FocusRectangleEnabled = false;
     this.btnResumeTutorial.Image = null;
     this.btnResumeTutorial.ImageBorderColor = Color.FromArgb(210, 0x69, 30);
     this.btnResumeTutorial.ImageBorderEnabled = true;
     this.btnResumeTutorial.ImageDropShadow = true;
     this.btnResumeTutorial.ImageFocused = null;
     this.btnResumeTutorial.ImageInactive = null;
     this.btnResumeTutorial.ImageMouseOver = null;
     this.btnResumeTutorial.ImageNormal = null;
     this.btnResumeTutorial.ImagePressed = null;
     this.btnResumeTutorial.InnerBorderColor = Color.FromArgb(0xd3, 0xd3, 0xd3);
     this.btnResumeTutorial.InnerBorderColor_Focus = Color.FromArgb(0xad, 0xd8, 230);
     this.btnResumeTutorial.InnerBorderColor_MouseOver = Color.FromArgb(0xff, 0xd7, 0);
     this.btnResumeTutorial.Location = new Point(0xc2, 0xec);
     this.btnResumeTutorial.Name = "btnResumeTutorial";
     this.btnResumeTutorial.OffsetPressedContent = true;
     this.btnResumeTutorial.Padding2 = 5;
     this.btnResumeTutorial.Size = new Size(0x76, 0x17);
     this.btnResumeTutorial.StretchImage = false;
     this.btnResumeTutorial.TabIndex = 0x12;
     this.btnResumeTutorial.Text = "Resume Tutorial";
     this.btnResumeTutorial.TextDropShadow = false;
     this.btnResumeTutorial.UseVisualStyleBackColor = false;
     this.btnResumeTutorial.Visible = false;
     this.btnResumeTutorial.Click += new EventHandler(this.btnResumeTutorial_Click);
     this.btnDebugInfo.BackColor = Color.FromArgb(0xcb, 0xd7, 0xdf);
     this.btnDebugInfo.BorderColor = Color.FromArgb(0, 0, 0x8b);
     this.btnDebugInfo.BorderDrawing = true;
     this.btnDebugInfo.FocusRectangleEnabled = false;
     this.btnDebugInfo.Image = null;
     this.btnDebugInfo.ImageBorderColor = Color.FromArgb(210, 0x69, 30);
     this.btnDebugInfo.ImageBorderEnabled = true;
     this.btnDebugInfo.ImageDropShadow = true;
     this.btnDebugInfo.ImageFocused = null;
     this.btnDebugInfo.ImageInactive = null;
     this.btnDebugInfo.ImageMouseOver = null;
     this.btnDebugInfo.ImageNormal = null;
     this.btnDebugInfo.ImagePressed = null;
     this.btnDebugInfo.InnerBorderColor = Color.FromArgb(0xd3, 0xd3, 0xd3);
     this.btnDebugInfo.InnerBorderColor_Focus = Color.FromArgb(0xad, 0xd8, 230);
     this.btnDebugInfo.InnerBorderColor_MouseOver = Color.FromArgb(0xff, 0xd7, 0);
     this.btnDebugInfo.Location = new Point(0xc2, 0xd9);
     this.btnDebugInfo.Name = "btnDebugInfo";
     this.btnDebugInfo.OffsetPressedContent = true;
     this.btnDebugInfo.Padding2 = 5;
     this.btnDebugInfo.Size = new Size(0x76, 0x17);
     this.btnDebugInfo.StretchImage = false;
     this.btnDebugInfo.TabIndex = 0x11;
     this.btnDebugInfo.Text = "Debug Info";
     this.btnDebugInfo.TextDropShadow = false;
     this.btnDebugInfo.UseVisualStyleBackColor = false;
     this.btnDebugInfo.Click += new EventHandler(this.btnDebugInfo_Click);
     this.cbTooltips.AutoSize = true;
     this.cbTooltips.Location = new Point(0x17, 0x27);
     this.cbTooltips.Name = "cbTooltips";
     this.cbTooltips.Size = new Size(0x3f, 0x11);
     this.cbTooltips.TabIndex = 0x10;
     this.cbTooltips.Text = "Tooltips";
     this.cbTooltips.UseVisualStyleBackColor = true;
     this.cbTooltips.CheckedChanged += new EventHandler(this.cbTooltips_CheckedChanged);
     this.cbInstantTooltips.AutoSize = true;
     this.cbInstantTooltips.Location = new Point(0x17, 0x3d);
     this.cbInstantTooltips.Name = "cbInstantTooltips";
     this.cbInstantTooltips.Size = new Size(0x62, 0x11);
     this.cbInstantTooltips.TabIndex = 15;
     this.cbInstantTooltips.Text = "Instant Tooltips";
     this.cbInstantTooltips.UseVisualStyleBackColor = true;
     this.cbInstantTooltips.CheckedChanged += new EventHandler(this.cbInstantTooltips_CheckedChanged);
     this.cbConfirmCards.AutoSize = true;
     this.cbConfirmCards.Location = new Point(0x17, 0x53);
     this.cbConfirmCards.Name = "cbConfirmCards";
     this.cbConfirmCards.Size = new Size(0x80, 0x11);
     this.cbConfirmCards.TabIndex = 14;
     this.cbConfirmCards.Text = "Confirm Playing Cards";
     this.cbConfirmCards.UseVisualStyleBackColor = true;
     this.cbConfirmCards.CheckedChanged += new EventHandler(this.cbConfirmCards_CheckedChanged);
     this.cbProfanityFilter.AutoSize = true;
     this.cbProfanityFilter.Location = new Point(0x17, 0x11);
     this.cbProfanityFilter.Name = "cbProfanityFilter";
     this.cbProfanityFilter.Size = new Size(0x9f, 0x11);
     this.cbProfanityFilter.TabIndex = 13;
     this.cbProfanityFilter.Text = "Profanity Filter (English Only)";
     this.cbProfanityFilter.UseVisualStyleBackColor = true;
     this.cbProfanityFilter.CheckedChanged += new EventHandler(this.cbProfanityFilter_CheckedChanged);
     this.cbWhiteTextBox.AutoSize = true;
     this.cbWhiteTextBox.Location = new Point(0x17, 0xc1);
     this.cbWhiteTextBox.Name = "cbWhiteTextBox";
     this.cbWhiteTextBox.Size = new Size(0xe4, 0x11);
     this.cbWhiteTextBox.TabIndex = 0x18;
     this.cbWhiteTextBox.Text = "Show White Background on Parish Names";
     this.cbWhiteTextBox.UseVisualStyleBackColor = true;
     this.cbWhiteTextBox.CheckedChanged += new EventHandler(this.cbWhiteTextBox_CheckedChanged);
     this.tabPage3.BackColor = Color.FromArgb(0x9f, 180, 0xc1);
     this.tabPage3.Controls.Add(this.cbWinterLandscape);
     this.tabPage3.Controls.Add(this.cbSeasonalFX);
     this.tabPage3.Controls.Add(this.cbBattleSFX);
     this.tabPage3.Controls.Add(this.btnRestoreDefaultVolumes);
     this.tabPage3.Controls.Add(this.lblVolumes);
     this.tabPage3.Controls.Add(this.trackBarEnvironmentals);
     this.tabPage3.Controls.Add(this.cbEnvironmentals);
     this.tabPage3.Controls.Add(this.trackBarSFX);
     this.tabPage3.Controls.Add(this.cbSFX);
     this.tabPage3.Controls.Add(this.cbGraphicsCompatibility);
     this.tabPage3.Controls.Add(this.trackBarMusicVolume);
     this.tabPage3.Controls.Add(this.cbMusic);
     this.tabPage3.Location = new Point(4, 0x19);
     this.tabPage3.Name = "tabPage3";
     this.tabPage3.Padding = new Padding(3);
     this.tabPage3.Size = new Size(0x147, 280);
     this.tabPage3.TabIndex = 2;
     this.tabPage3.Text = "Audio";
     this.cbWinterLandscape.AutoSize = true;
     this.cbWinterLandscape.ForeColor = ARGBColors.Black;
     this.cbWinterLandscape.Location = new Point(20, 0xdf);
     this.cbWinterLandscape.Name = "cbWinterLandscape";
     this.cbWinterLandscape.Size = new Size(0x8f, 0x11);
     this.cbWinterLandscape.TabIndex = 0x19;
     this.cbWinterLandscape.Text = "Show Winter Landscape";
     this.cbWinterLandscape.UseVisualStyleBackColor = true;
     this.cbWinterLandscape.CheckedChanged += new EventHandler(this.cbWinterLandscape_CheckedChanged);
     this.cbSeasonalFX.AutoSize = true;
     this.cbSeasonalFX.ForeColor = ARGBColors.Black;
     this.cbSeasonalFX.Location = new Point(20, 0xcb);
     this.cbSeasonalFX.Name = "cbSeasonalFX";
     this.cbSeasonalFX.Size = new Size(0x74, 0x11);
     this.cbSeasonalFX.TabIndex = 0x18;
     this.cbSeasonalFX.Text = "Show Seasonal FX";
     this.cbSeasonalFX.UseVisualStyleBackColor = true;
     this.cbSeasonalFX.CheckedChanged += new EventHandler(this.cbSeasonalFX_CheckedChanged);
     this.cbBattleSFX.AutoSize = true;
     this.cbBattleSFX.ForeColor = ARGBColors.Black;
     this.cbBattleSFX.Location = new Point(20, 0x63);
     this.cbBattleSFX.Name = "cbBattleSFX";
     this.cbBattleSFX.Size = new Size(0x67, 0x11);
     this.cbBattleSFX.TabIndex = 11;
     this.cbBattleSFX.Text = "Battle Sound FX";
     this.cbBattleSFX.UseVisualStyleBackColor = true;
     this.cbBattleSFX.CheckedChanged += new EventHandler(this.cbBattleSFX_CheckedChanged);
     this.btnRestoreDefaultVolumes.BackColor = Color.FromArgb(0xcb, 0xd7, 0xdf);
     this.btnRestoreDefaultVolumes.BorderColor = Color.FromArgb(0, 0, 0x8b);
     this.btnRestoreDefaultVolumes.BorderDrawing = true;
     this.btnRestoreDefaultVolumes.FocusRectangleEnabled = false;
     this.btnRestoreDefaultVolumes.Image = null;
     this.btnRestoreDefaultVolumes.ImageBorderColor = Color.FromArgb(210, 0x69, 30);
     this.btnRestoreDefaultVolumes.ImageBorderEnabled = true;
     this.btnRestoreDefaultVolumes.ImageDropShadow = true;
     this.btnRestoreDefaultVolumes.ImageFocused = null;
     this.btnRestoreDefaultVolumes.ImageInactive = null;
     this.btnRestoreDefaultVolumes.ImageMouseOver = null;
     this.btnRestoreDefaultVolumes.ImageNormal = null;
     this.btnRestoreDefaultVolumes.ImagePressed = null;
     this.btnRestoreDefaultVolumes.InnerBorderColor = Color.FromArgb(0xd3, 0xd3, 0xd3);
     this.btnRestoreDefaultVolumes.InnerBorderColor_Focus = Color.FromArgb(0xad, 0xd8, 230);
     this.btnRestoreDefaultVolumes.InnerBorderColor_MouseOver = Color.FromArgb(0xff, 0xd7, 0);
     this.btnRestoreDefaultVolumes.Location = new Point(0x86, 0xa7);
     this.btnRestoreDefaultVolumes.Name = "btnRestoreDefaultVolumes";
     this.btnRestoreDefaultVolumes.OffsetPressedContent = true;
     this.btnRestoreDefaultVolumes.Padding2 = 5;
     this.btnRestoreDefaultVolumes.Size = new Size(0xa7, 0x17);
     this.btnRestoreDefaultVolumes.StretchImage = false;
     this.btnRestoreDefaultVolumes.TabIndex = 10;
     this.btnRestoreDefaultVolumes.Text = "Restore Defaults";
     this.btnRestoreDefaultVolumes.TextDropShadow = false;
     this.btnRestoreDefaultVolumes.UseVisualStyleBackColor = false;
     this.btnRestoreDefaultVolumes.Click += new EventHandler(this.btnRestoreDefaultVolumes_Click);
     this.lblVolumes.ForeColor = ARGBColors.Black;
     this.lblVolumes.Location = new Point(0x83, 10);
     this.lblVolumes.Name = "lblVolumes";
     this.lblVolumes.Size = new Size(170, 13);
     this.lblVolumes.TabIndex = 9;
     this.lblVolumes.Text = "Volume";
     this.lblVolumes.TextAlign = ContentAlignment.TopCenter;
     this.trackBarEnvironmentals.BackColor = Color.FromArgb(0x9f, 180, 0xc1);
     this.trackBarEnvironmentals.Location = new Point(0x83, 0x7e);
     this.trackBarEnvironmentals.Maximum = 100;
     this.trackBarEnvironmentals.Minimum = 1;
     this.trackBarEnvironmentals.Name = "trackBarEnvironmentals";
     this.trackBarEnvironmentals.Size = new Size(170, 0x2d);
     this.trackBarEnvironmentals.TabIndex = 8;
     this.trackBarEnvironmentals.TickFrequency = 5;
     this.trackBarEnvironmentals.Value = 1;
     this.trackBarEnvironmentals.ValueChanged += new EventHandler(this.trackBarEnvironmentals_ValueChanged);
     this.cbEnvironmentals.AutoSize = true;
     this.cbEnvironmentals.ForeColor = ARGBColors.Black;
     this.cbEnvironmentals.Location = new Point(20, 0x84);
     this.cbEnvironmentals.Name = "cbEnvironmentals";
     this.cbEnvironmentals.Size = new Size(0x62, 0x11);
     this.cbEnvironmentals.TabIndex = 7;
     this.cbEnvironmentals.Text = "Environmentals";
     this.cbEnvironmentals.UseVisualStyleBackColor = true;
     this.cbEnvironmentals.CheckedChanged += new EventHandler(this.cbEnvironmentals_CheckedChanged);
     this.trackBarSFX.BackColor = Color.FromArgb(0x9f, 180, 0xc1);
     this.trackBarSFX.Location = new Point(0x83, 0x4c);
     this.trackBarSFX.Maximum = 100;
     this.trackBarSFX.Minimum = 1;
     this.trackBarSFX.Name = "trackBarSFX";
     this.trackBarSFX.Size = new Size(170, 0x2d);
     this.trackBarSFX.TabIndex = 5;
     this.trackBarSFX.TickFrequency = 5;
     this.trackBarSFX.Value = 1;
     this.trackBarSFX.ValueChanged += new EventHandler(this.trackBarSFX_ValueChanged);
     this.cbSFX.AutoSize = true;
     this.cbSFX.ForeColor = ARGBColors.Black;
     this.cbSFX.Location = new Point(20, 0x4c);
     this.cbSFX.Name = "cbSFX";
     this.cbSFX.Size = new Size(0x49, 0x11);
     this.cbSFX.TabIndex = 4;
     this.cbSFX.Text = "Sound FX";
     this.cbSFX.UseVisualStyleBackColor = true;
     this.cbSFX.CheckedChanged += new EventHandler(this.cbSFX_CheckedChanged);
     this.cbGraphicsCompatibility.AutoSize = true;
     this.cbGraphicsCompatibility.ForeColor = ARGBColors.Black;
     this.cbGraphicsCompatibility.Location = new Point(20, 0xf4);
     this.cbGraphicsCompatibility.Name = "cbGraphicsCompatibility";
     this.cbGraphicsCompatibility.Size = new Size(0x9f, 0x11);
     this.cbGraphicsCompatibility.TabIndex = 3;
     this.cbGraphicsCompatibility.Text = "Graphics Compatibility Mode";
     this.cbGraphicsCompatibility.UseVisualStyleBackColor = true;
     this.cbGraphicsCompatibility.CheckedChanged += new EventHandler(this.cbGraphicsCompatibility_CheckedChanged);
     this.trackBarMusicVolume.BackColor = Color.FromArgb(0x9f, 180, 0xc1);
     this.trackBarMusicVolume.Location = new Point(0x83, 0x1a);
     this.trackBarMusicVolume.Maximum = 100;
     this.trackBarMusicVolume.Minimum = 1;
     this.trackBarMusicVolume.Name = "trackBarMusicVolume";
     this.trackBarMusicVolume.Size = new Size(170, 0x2d);
     this.trackBarMusicVolume.TabIndex = 1;
     this.trackBarMusicVolume.TickFrequency = 5;
     this.trackBarMusicVolume.Value = 1;
     this.trackBarMusicVolume.ValueChanged += new EventHandler(this.trackBarMusicVolume_ValueChanged);
     this.cbMusic.AutoSize = true;
     this.cbMusic.ForeColor = ARGBColors.Black;
     this.cbMusic.Location = new Point(20, 0x20);
     this.cbMusic.Name = "cbMusic";
     this.cbMusic.Size = new Size(0x36, 0x11);
     this.cbMusic.TabIndex = 0;
     this.cbMusic.Text = "Music";
     this.cbMusic.UseVisualStyleBackColor = true;
     this.cbMusic.CheckedChanged += new EventHandler(this.cbMusic_CheckedChanged);
     this.tabPage1.BackColor = Color.FromArgb(0x9f, 180, 0xc1);
     this.tabPage1.Controls.Add(this.btnDownloadTranslations);
     this.tabPage1.Controls.Add(this.label1);
     this.tabPage1.Controls.Add(this.listBoxLanguages);
     this.tabPage1.ForeColor = ARGBColors.Black;
     this.tabPage1.Location = new Point(4, 0x19);
     this.tabPage1.Name = "tabPage1";
     this.tabPage1.Padding = new Padding(3);
     this.tabPage1.Size = new Size(0x147, 280);
     this.tabPage1.TabIndex = 3;
     this.tabPage1.Text = "Languages";
     this.btnDownloadTranslations.BackColor = Color.FromArgb(0xcb, 0xd7, 0xdf);
     this.btnDownloadTranslations.BorderColor = Color.FromArgb(0, 0, 0x8b);
     this.btnDownloadTranslations.BorderDrawing = true;
     this.btnDownloadTranslations.FocusRectangleEnabled = false;
     this.btnDownloadTranslations.Image = null;
     this.btnDownloadTranslations.ImageBorderColor = Color.FromArgb(210, 0x69, 30);
     this.btnDownloadTranslations.ImageBorderEnabled = true;
     this.btnDownloadTranslations.ImageDropShadow = true;
     this.btnDownloadTranslations.ImageFocused = null;
     this.btnDownloadTranslations.ImageInactive = null;
     this.btnDownloadTranslations.ImageMouseOver = null;
     this.btnDownloadTranslations.ImageNormal = null;
     this.btnDownloadTranslations.ImagePressed = null;
     this.btnDownloadTranslations.InnerBorderColor = Color.FromArgb(0xd3, 0xd3, 0xd3);
     this.btnDownloadTranslations.InnerBorderColor_Focus = Color.FromArgb(0xad, 0xd8, 230);
     this.btnDownloadTranslations.InnerBorderColor_MouseOver = Color.FromArgb(0xff, 0xd7, 0);
     this.btnDownloadTranslations.Location = new Point(0x1f, 0xe3);
     this.btnDownloadTranslations.Name = "btnDownloadTranslations";
     this.btnDownloadTranslations.OffsetPressedContent = true;
     this.btnDownloadTranslations.Padding2 = 5;
     this.btnDownloadTranslations.Size = new Size(0x10a, 0x17);
     this.btnDownloadTranslations.StretchImage = false;
     this.btnDownloadTranslations.TabIndex = 2;
     this.btnDownloadTranslations.Text = "Download Community Translations";
     this.btnDownloadTranslations.TextDropShadow = false;
     this.btnDownloadTranslations.UseVisualStyleBackColor = false;
     this.btnDownloadTranslations.Click += new EventHandler(this.btnDownloadTranslations_Click);
     this.label1.AutoSize = true;
     this.label1.ForeColor = ARGBColors.Black;
     this.label1.Location = new Point(0x69, 12);
     this.label1.Name = "label1";
     this.label1.Size = new Size(0x6a, 13);
     this.label1.TabIndex = 1;
     this.label1.Text = "Available Languages";
     this.listBoxLanguages.BackColor = ARGBColors.White;
     this.listBoxLanguages.ForeColor = ARGBColors.Black;
     this.listBoxLanguages.FormattingEnabled = true;
     this.listBoxLanguages.Location = new Point(60, 0x23);
     this.listBoxLanguages.Name = "listBoxLanguages";
     this.listBoxLanguages.Size = new Size(0xc9, 0xad);
     this.listBoxLanguages.TabIndex = 0;
     this.listBoxLanguages.SelectedIndexChanged += new EventHandler(this.listBoxLanguages_SelectedIndexChanged);
     this.btnApply.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
     this.btnApply.BackColor = Color.FromArgb(0xcb, 0xd7, 0xdf);
     this.btnApply.BorderColor = Color.FromArgb(0, 0, 0x8b);
     this.btnApply.BorderDrawing = true;
     this.btnApply.Enabled = false;
     this.btnApply.FocusRectangleEnabled = false;
     this.btnApply.Image = null;
     this.btnApply.ImageBorderColor = Color.FromArgb(210, 0x69, 30);
     this.btnApply.ImageBorderEnabled = true;
     this.btnApply.ImageDropShadow = true;
     this.btnApply.ImageFocused = null;
     this.btnApply.ImageInactive = null;
     this.btnApply.ImageMouseOver = null;
     this.btnApply.ImageNormal = null;
     this.btnApply.ImagePressed = null;
     this.btnApply.InnerBorderColor = Color.FromArgb(0xd3, 0xd3, 0xd3);
     this.btnApply.InnerBorderColor_Focus = Color.FromArgb(0xad, 0xd8, 230);
     this.btnApply.InnerBorderColor_MouseOver = Color.FromArgb(0xff, 0xd7, 0);
     this.btnApply.Location = new Point(0xfb, 0x160);
     this.btnApply.Name = "btnApply";
     this.btnApply.OffsetPressedContent = true;
     this.btnApply.Padding2 = 5;
     this.btnApply.Size = new Size(90, 0x1a);
     this.btnApply.StretchImage = false;
     this.btnApply.TabIndex = 1;
     this.btnApply.Text = "Apply";
     this.btnApply.TextDropShadow = false;
     this.btnApply.UseVisualStyleBackColor = false;
     this.btnApply.Click += new EventHandler(this.btnApply_Click);
     this.btnCancel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
     this.btnCancel.BackColor = Color.FromArgb(0xcb, 0xd7, 0xdf);
     this.btnCancel.BorderColor = Color.FromArgb(0, 0, 0x8b);
     this.btnCancel.BorderDrawing = true;
     this.btnCancel.FocusRectangleEnabled = false;
     this.btnCancel.Image = null;
     this.btnCancel.ImageBorderColor = Color.FromArgb(210, 0x69, 30);
     this.btnCancel.ImageBorderEnabled = true;
     this.btnCancel.ImageDropShadow = true;
     this.btnCancel.ImageFocused = null;
     this.btnCancel.ImageInactive = null;
     this.btnCancel.ImageMouseOver = null;
     this.btnCancel.ImageNormal = null;
     this.btnCancel.ImagePressed = null;
     this.btnCancel.InnerBorderColor = Color.FromArgb(0xd3, 0xd3, 0xd3);
     this.btnCancel.InnerBorderColor_Focus = Color.FromArgb(0xad, 0xd8, 230);
     this.btnCancel.InnerBorderColor_MouseOver = Color.FromArgb(0xff, 0xd7, 0);
     this.btnCancel.Location = new Point(0x9b, 0x160);
     this.btnCancel.Name = "btnCancel";
     this.btnCancel.OffsetPressedContent = true;
     this.btnCancel.Padding2 = 5;
     this.btnCancel.Size = new Size(90, 0x1a);
     this.btnCancel.StretchImage = false;
     this.btnCancel.TabIndex = 2;
     this.btnCancel.Text = "Cancel";
     this.btnCancel.TextDropShadow = false;
     this.btnCancel.UseVisualStyleBackColor = false;
     this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
     this.btnOK.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
     this.btnOK.BackColor = Color.FromArgb(0xcb, 0xd7, 0xdf);
     this.btnOK.BorderColor = Color.FromArgb(0, 0, 0x8b);
     this.btnOK.BorderDrawing = true;
     this.btnOK.FocusRectangleEnabled = false;
     this.btnOK.Image = null;
     this.btnOK.ImageBorderColor = Color.FromArgb(210, 0x69, 30);
     this.btnOK.ImageBorderEnabled = true;
     this.btnOK.ImageDropShadow = true;
     this.btnOK.ImageFocused = null;
     this.btnOK.ImageInactive = null;
     this.btnOK.ImageMouseOver = null;
     this.btnOK.ImageNormal = null;
     this.btnOK.ImagePressed = null;
     this.btnOK.InnerBorderColor = Color.FromArgb(0xd3, 0xd3, 0xd3);
     this.btnOK.InnerBorderColor_Focus = Color.FromArgb(0xad, 0xd8, 230);
     this.btnOK.InnerBorderColor_MouseOver = Color.FromArgb(0xff, 0xd7, 0);
     this.btnOK.Location = new Point(0x3b, 0x160);
     this.btnOK.Name = "btnOK";
     this.btnOK.OffsetPressedContent = true;
     this.btnOK.Padding2 = 5;
     this.btnOK.Size = new Size(90, 0x1a);
     this.btnOK.StretchImage = false;
     this.btnOK.TabIndex = 3;
     this.btnOK.Text = "OK";
     this.btnOK.TextDropShadow = false;
     this.btnOK.UseVisualStyleBackColor = false;
     this.btnOK.Click += new EventHandler(this.btnOK_Click);
     this.pnlWikiHelp.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
     this.pnlWikiHelp.Location = new Point(14, 0x15c);
     this.pnlWikiHelp.Name = "pnlWikiHelp";
     this.pnlWikiHelp.Size = new Size(0x23, 0x23);
     this.pnlWikiHelp.TabIndex = 14;
     this.pnlWikiHelp.MouseLeave += new EventHandler(this.pnlWikiHelp_MouseLeave);
     this.pnlWikiHelp.MouseClick += new MouseEventHandler(this.pnlWikiHelp_MouseClick);
     this.pnlWikiHelp.MouseEnter += new EventHandler(this.pnlWikiHelp_MouseEnter);
     base.AutoScaleMode = AutoScaleMode.None;
     base.ClientSize = new Size(0x161, 0x182);
     base.Controls.Add(this.pnlWikiHelp);
     base.Controls.Add(this.btnOK);
     base.Controls.Add(this.btnCancel);
     base.Controls.Add(this.btnApply);
     base.Controls.Add(this.tabOptions);
     base.Icon = Resources.shk_icon;
     base.MaximizeBox = false;
     base.MinimizeBox = false;
     base.Name = "OptionsPopup";
     base.ShowBar = true;
     base.ShowClose = true;
     base.ShowIcon = false;
     base.StartPosition = FormStartPosition.CenterScreen;
     this.Text = "Settings";
     base.Controls.SetChildIndex(this.tabOptions, 0);
     base.Controls.SetChildIndex(this.btnApply, 0);
     base.Controls.SetChildIndex(this.btnCancel, 0);
     base.Controls.SetChildIndex(this.btnOK, 0);
     base.Controls.SetChildIndex(this.pnlWikiHelp, 0);
     this.tabOptions.ResumeLayout(false);
     this.tpageDisplay.ResumeLayout(false);
     this.tpageDisplay.PerformLayout();
     this.tabPage3.ResumeLayout(false);
     this.tabPage3.PerformLayout();
     this.trackBarEnvironmentals.EndInit();
     this.trackBarSFX.EndInit();
     this.trackBarMusicVolume.EndInit();
     this.tabPage1.ResumeLayout(false);
     this.tabPage1.PerformLayout();
     base.ResumeLayout(false);
 }
Пример #10
0
 private static IList <TabItem> GetTabItems(TabControlEx tabControl)
 {
     return(Enumerable.Range(0, tabControl.ItemContainerGenerator.Items.Count).Select(x => tabControl.ItemContainerGenerator.ContainerFromIndex(x))
            .Cast <TabItem>()
            .ToList());
 }
Пример #11
0
        public FormMain(string[] args)
        {
            _logger = Logger.Get(nameof(FormMain));
            _logger.Trace("constructing the main window...");

            // コントロールのインスタンス生成
            _logger.Trace("creating controls...");
            _mdi_tab       = new MdiChildrenTab();
            _main_menu     = new MenuStrip();
            _tool_menu     = new ToolStrip();
            _status_bar    = new StatusStrip();
            _explorer      = new FileTreeBox(this);
            _terminal      = new TabControlEx();
            _splitter_vert = new Splitter();
            _splitter_hori = new Splitter();

            // レイアウト停止
            _logger.Trace("suspending the control layouts...");
            this.SuspendLayout();
            _mdi_tab.SuspendLayout();
            _main_menu.SuspendLayout();
            _tool_menu.SuspendLayout();
            _status_bar.SuspendLayout();
            _explorer.SuspendLayout();
            _terminal.SuspendLayout();
            _splitter_vert.SuspendLayout();
            _splitter_hori.SuspendLayout();

            {             // MDI親ウィンドウとして設定
                _logger.Trace($"setting the main window as MDI parent...");
                this.IsMdiContainer = true;
                for (int i = 0; i < this.Controls.Count; ++i)
                {
                    if (this.Controls[i] is MdiClient mc)
                    {
                        _mdi_client = mc;
                        break;
                    }
                }
            }

            {             // _mdi_tab
                _logger.Trace($"setting {nameof(_mdi_tab)}...");
                _mdi_tab.Name      = nameof(_mdi_tab);
                _mdi_tab.Dock      = DockStyle.Top;
                _mdi_tab.Size      = new Size(192, 32);
                _mdi_tab.MdiClient = _mdi_client;
                _mdi_tab.Font      = SystemFonts.IconTitleFont;
            }

            this.BuildMenus();
            this.BuildMainMenuItems();
            this.BuildToolMenuItems();
            this.BuildStatusLabels();

            {             // _explorer
                _logger.Trace($"setting {nameof(_explorer)}...");
                _explorer.Name        = nameof(_explorer);
                _explorer.Dock        = DockStyle.Left;
                _explorer.Size        = new Size(200, 200);
                _explorer.BorderStyle = BorderStyle.Fixed3D;
            }

            {             // _terminal
                _logger.Trace($"setting {nameof(_terminal)}...");
                _terminal.Name = nameof(_terminal);
                _terminal.Dock = DockStyle.Bottom;
                _terminal.Size = new Size(200, 200);
            }

            {             // _splitter_vert
                _logger.Trace($"setting {nameof(_splitter_vert)}...");
                _splitter_vert.Name = nameof(_splitter_vert);
                _splitter_vert.Dock = DockStyle.Left;
            }

            {             // _splitter_hori
                _logger.Trace($"setting {nameof(_splitter_hori)}...");
                _splitter_hori.Name = nameof(_splitter_hori);
                _splitter_hori.Dock = DockStyle.Bottom;
            }

            {             // FormMain
                _logger.Trace($"setting {nameof(FormMain)}...");
                this.Name        = nameof(FormMain);
                this.Text        = $"{ASMINFO.Caption} {ASMINFO.Edition}";
                this.Icon        = Libosdev.GetIcon(FormMainRes.Icon);
                this.MinimumSize = new Size(600, 450);
                this.ClientSize  = SettingManager.System.MainWindowPosition.Size;

                if (SettingManager.System.MainWindowPosition.X > -1 &&
                    SettingManager.System.MainWindowPosition.Y > -1)
                {
                    this.StartPosition = FormStartPosition.Manual;
                    this.Location      = SettingManager.System.MainWindowPosition.Location;
                }
            }

            // ToolStrip系コントロールに関する設定
            ToolStripManager.Renderer = new ToolStripRendererEx(new ToolStripColorTable());

            // コントロール登録
            _logger.Trace($"adding controls...");
            this.Controls.Add(_mdi_tab);
            this.Controls.Add(_splitter_hori);
            this.Controls.Add(_splitter_vert);
            this.Controls.Add(_terminal);
            this.Controls.Add(_explorer);
            this.Controls.Add(_status_bar);
            this.Controls.Add(_tool_menu);
            this.Controls.Add(_main_menu);
            this.MainMenuStrip = _main_menu;

            // レイアウト再開
            _logger.Trace("resuming the control layouts...");
            _splitter_hori.ResumeLayout(false);            _splitter_hori.PerformLayout();
            _splitter_vert.ResumeLayout(false);            _splitter_vert.PerformLayout();
            _terminal.ResumeLayout(false);            _terminal.PerformLayout();
            _explorer.ResumeLayout(false);            _explorer.PerformLayout();
            _status_bar.ResumeLayout(false);            _status_bar.PerformLayout();
            _tool_menu.ResumeLayout(false);            _tool_menu.PerformLayout();
            _main_menu.ResumeLayout(false);            _main_menu.PerformLayout();
            _mdi_tab.ResumeLayout(false);            _mdi_tab.PerformLayout();
            this.ResumeLayout(false);            this.PerformLayout();

            _logger.Trace("constructed the main window");
        }
Пример #12
0
        public MainForm()
        {
            InitializeComponent();
            ProcessCommandLine();

            staticHttpClient = new StaticHttpClient(Settings.Network);

            pathFormatter = new PathFormatter(Program.ApplicationPath, Program.SourcePath, Settings.PathFormatter.Custom, Settings.PathFormatter, Settings.Lists.Tags.LanguageNames, Settings.PathFormatter.IsEnabled);

            tagsModel         = new TagsModel();
            tokenModifiers    = TokenModifiers.All.Concat(new ITokenModifier[] { new TagTokenModifier(tagsModel) }).ToArray();
            bookmarkFormatter = new BookmarkFormatter(Settings.Lists.Bookmarks, Settings.Lists.Tags, tagsModel, pathFormatter, tokenModifiers);
            bookmarksModel    = new BookmarksModel(tagsModel, bookmarkFormatter);
            libraryModel      = new LibraryModel(pathFormatter.GetCacheDirectory(), new WinformsTimer(0, Settings.Polling.LibraryRefreshInterval));
            browsingModel     = new BrowsingModel();
            galleryModel      = new GalleryModel(tagsModel);
            detailsModel      = new DetailsModel();

            metadataKeywordLists = new MetadataKeywordLists();
            metadataProcessors   = new List <IMetadataProcessor>();
            metadataConverters   = new List <IMetadataConverter>();
            archiveWriters       = new List <IArchiveWriter>();
            queryParser          = new QueryParser(tagsModel);

            coreTextFormatter     = new CoreTextFormatter(pathFormatter, tokenModifiers);
            aboutTextFormatter    = new AboutTextFormatter(pathFormatter);
            tagTextFormatter      = new TagTextFormatter();
            metadataTextFormatter = new MetadataTextFormatter(pathFormatter, Settings.Lists.Tags.LanguageNames, metadataKeywordLists, tokenModifiers);

            documentTemplates                      = new DocumentTemplates();
            documentTemplates.About                = new DocumentTemplate <object>("about", Settings.Cache.Templates, pathFormatter, (x, context) => aboutTextFormatter.Format(x));
            documentTemplates.Details              = new DocumentTemplate <Metadata>("details", Settings.Cache.Templates, pathFormatter, (text, context) => metadataTextFormatter.Format(text, context));
            documentTemplates.DetailsPreload       = new DocumentTemplate <Metadata>("details-preload", Settings.Cache.Templates, pathFormatter, (text, context) => metadataTextFormatter.Format(text, context));
            documentTemplates.Download             = new DocumentTemplate <Metadata>("download", Settings.Cache.Templates, pathFormatter, (text, context) => metadataTextFormatter.Format(text, context));
            documentTemplates.GalleryTooltip       = new DocumentTemplate <Metadata>("gallery-tooltip", Settings.Cache.Templates, pathFormatter, (text, context) => metadataTextFormatter.Format(text, context));
            documentTemplates.LibraryCovergrid     = new DocumentTemplate <ISearchProgressArg>("library-covergrid", Settings.Cache.Templates, pathFormatter, (text, context) => searchProgressArgTextFormatter.Format(text, context, "library"));
            documentTemplates.LibraryCovergridItem = new DocumentTemplate <Metadata>("library-covergrid-item", Settings.Cache.Templates, pathFormatter, (text, context) => metadataTextFormatter.Format(text, context));
            documentTemplates.SearchCovergrid      = new DocumentTemplate <ISearchProgressArg>("search-covergrid", Settings.Cache.Templates, pathFormatter, (text, context) => searchProgressArgTextFormatter.Format(text, context, "search"));
            documentTemplates.SearchCovergridItem  = new DocumentTemplate <Metadata>("search-covergrid-item", Settings.Cache.Templates, pathFormatter, (text, context) => metadataTextFormatter.Format(text, context));
            documentTemplates.SearchPreload        = new DocumentTemplate <ISearchArg>("search-preload", Settings.Cache.Templates, pathFormatter, (text, context) => searchArgTextFormatter.Format(text, context));
            documentTemplates.Startup              = new DocumentTemplate <object>("startup", Settings.Cache.Templates, pathFormatter, (text, context) => coreTextFormatter.Format(text, context));

            searchArgTextFormatter         = new SearchArgTextFormatter(pathFormatter, metadataKeywordLists, tagsModel, tokenModifiers);
            searchProgressArgTextFormatter = new SearchProgressArgTextFormatter(pathFormatter, metadataKeywordLists, tagsModel, metadataTextFormatter, tokenModifiers, documentTemplates.SearchCovergridItem, documentTemplates.LibraryCovergridItem);

            metadataCache     = new MetadataCache();
            searchResultCache = new SearchResultCache(metadataCache);
            sessionManager    = new SessionManager(pathFormatter, searchResultCache, Settings.Cache.Session.RecentLifeSpan, Settings.Cache.Session.SearchLifeSpan, Settings.Cache.Session.TaggedLifeSpan, Settings.Network);
            cacheFileSystem   = new CacheFileSystem(pathFormatter, searchResultCache, archiveWriters);
            pluginSystem      = new PluginSystem(Logger, pathFormatter, cacheFileSystem, archiveWriters, metadataConverters, metadataProcessors);

            backgroundTaskWorker = new BackgroundTaskWorker()
            {
                IdleWaitTime = Settings.BackgroundWorkers.BackgroundTaskWorker.IdleWaitTime, MaxConcurrentJobCount = Settings.BackgroundWorkers.BackgroundTaskWorker.MaxConcurrentJobCount
            };
            pageDownloader = new PageDownloader(staticHttpClient.Client, pathFormatter, searchResultCache, cacheFileSystem)
            {
                IdleWaitTime = Settings.BackgroundWorkers.PageDownloader.IdleWaitTime, MaxConcurrentJobCount = Settings.BackgroundWorkers.PageDownloader.MaxConcurrentJobCount
            };
            coverDownloader = new CoverDownloader(staticHttpClient.Client, pathFormatter, metadataKeywordLists)
            {
                IdleWaitTime = Settings.BackgroundWorkers.CoverDownloader.IdleWaitTime, MaxConcurrentJobCount = Settings.BackgroundWorkers.CoverDownloader.MaxConcurrentJobCount
            };
            coverLoader = new CoverDownloader(staticHttpClient.Client, pathFormatter, metadataKeywordLists)
            {
                IdleWaitTime = Settings.BackgroundWorkers.CoverLoader.IdleWaitTime, MaxConcurrentJobCount = Settings.BackgroundWorkers.CoverLoader.MaxConcurrentJobCount
            };
            galleryDownloader = new GalleryDownloader(staticHttpClient.Client, pathFormatter, searchResultCache)
            {
                IdleWaitTime = Settings.BackgroundWorkers.GalleryDownloader.IdleWaitTime, MaxConcurrentJobCount = Settings.BackgroundWorkers.GalleryDownloader.MaxConcurrentJobCount
            };

            detailsTabControl         = new TabControlEx();
            detailsTabPage            = new TabPage();
            downloadTabPage           = new TabPage();
            listsTabControl           = new TabControlEx();
            tagsTabPage               = new TabPage();
            bookmarksTabPage          = new TabPage();
            libraryTabPage            = new TabPage();
            browsingTabPage           = new TabPage();
            mainViewTabControl        = new TabControlEx();
            galleryBrowserViewTabPage = new TabPage();
            libraryBrowserViewTabPage = new TabPage();
            downloadsListViewTabPage  = new TabPage();
            webBrowserToolTip         = new WebBrowserTreeNodeToolTip(pathFormatter, documentTemplates.GalleryTooltip);
            loadTimer = new Timer(components);

            searchHandler = new SearchHandler(
                libraryModel
                , mainViewTabControl
                , libraryBrowserViewTabPage
                , galleryBrowserViewTabPage
                , Settings.Cache
                , searchResultCache
                , Logger
                , browsingModel
                , pathFormatter
                , staticHttpClient.Client
                , queryParser
                , galleryModel
                , detailsModel
                , galleryDownloader
                , sessionManager
                , Settings.Network);

            bookmarkPromptUtility = new BookmarkPromptUtility(bookmarksModel, Settings.Lists.Bookmarks);

            tagsFilter           = new TagsFilter(Settings.Lists.Tags, metadataKeywordLists);
            bookmarksFilter      = new BookmarksFilter(Settings.Lists.Bookmarks);
            libraryFilter        = new LibraryFilter(Settings.Lists.Library);
            browsingFilter       = new BrowsingFilter(Settings.Lists.Browsing);
            libraryBrowserFilter = new LibraryBrowserFilter(Settings.Library.Browser);
            galleryBrowserFilter = new GalleryBrowserFilter(Settings.Gallery.Browser);
            detailsBrowserFilter = new DetailsBrowserFilter(Settings.Details.Browser);

            tagsTreeView       = new TagsTreeView(tagsFilter, tagsModel, tagTextFormatter, Settings.Lists.Tags, metadataKeywordLists, searchHandler, bookmarkPromptUtility, staticHttpClient.Client);
            tagsToolStrip      = new TagsToolStrip(tagsFilter, tagsModel, Settings.Lists.Tags, metadataKeywordLists, Settings.Polling.FilterDelay);
            bookmarksTreeView  = new BookmarksTreeView(bookmarksFilter, bookmarksModel, Settings.Lists.Bookmarks, webBrowserToolTip, queryParser, cacheFileSystem, searchHandler);
            bookmarksToolStrip = new BookmarksToolStrip(bookmarksFilter, bookmarksModel, Settings.Lists.Bookmarks, Settings.Polling.FilterDelay);
            libraryTreeView    = new LibraryTreeView(libraryFilter, libraryModel, archiveWriters, webBrowserToolTip, searchHandler, cacheFileSystem);
            libraryToolStrip   = new LibraryToolStrip(libraryFilter, libraryModel, Settings.Lists.Library, Settings.Polling.FilterDelay);
            browsingTreeView   = new BrowsingTreeView(browsingFilter, browsingModel, Settings.Lists.Browsing, searchHandler, sessionManager, queryParser);
            browsingToolStrip  = new BrowsingToolStrip(browsingFilter, browsingModel, Settings.Lists.Browsing, Settings.Polling.FilterDelay);

            galleryBrowserView      = new GalleryBrowserView(galleryBrowserFilter, galleryModel, documentTemplates.SearchCovergrid, documentTemplates.SearchPreload, pathFormatter, Settings.Gallery.Browser, pageDownloader, coverDownloader, metadataKeywordLists, tagsModel, searchHandler);
            galleryToolStrip        = new GalleryBrowserToolStrip(galleryBrowserFilter, galleryModel, Settings.Gallery.Browser, searchHandler);
            libraryBrowserView      = new LibraryBrowserView(libraryBrowserFilter, libraryModel, documentTemplates.LibraryCovergrid, documentTemplates.SearchPreload, documentTemplates.LibraryCovergridItem, pathFormatter, pageDownloader, coverLoader, metadataKeywordLists, Settings.Library.Browser, searchResultCache);
            libraryBrowserToolStrip = new LibraryBrowserToolStrip(libraryBrowserFilter, libraryModel, Settings.Library.Browser, searchHandler);
            detailsToolStrip        = new DetailsBrowserToolStrip(detailsBrowserFilter, detailsModel, searchHandler);
            detailsBrowserView      = new DetailsBrowserView(detailsBrowserFilter, detailsModel, documentTemplates.Details, documentTemplates.Download, documentTemplates.DetailsPreload, galleryDownloader, pageDownloader, coverDownloader, metadataKeywordLists, Settings.Details.Browser, searchResultCache, cacheFileSystem);
            theme                  = new Theme();
            applicationLoader      = new ApplicationLoader();
            fullScreenRestoreState = new FullScreenRestoreState();
            mainMenuStrip          = new MainMenuStrip(Settings);
            startupSpecialHandler  = new StartupSpecialHandler(Settings.Gallery, tagsModel, metadataKeywordLists, searchHandler);
            taskbar                = new Taskbar(coverDownloader, galleryDownloader, pageDownloader, searchResultCache, cacheFileSystem);

            publicApi = new PublicApi(staticHttpClient.Client
                                      , pathFormatter
                                      , cacheFileSystem
                                      , searchResultCache
                                      , searchHandler
                                      , bookmarkPromptUtility
                                      , pluginSystem
                                      , libraryBrowserToolStrip
                                      , Settings.Library
                                      , galleryToolStrip
                                      , Settings.Gallery
                                      , Settings.Details
                                      , galleryDownloader
                                      , coverDownloader
                                      , pageDownloader
                                      , Settings.Notifications
                                      , metadataKeywordLists
                                      , Settings
                                      );

            splitContainer1 = new SplitContainerEx();
            splitContainer2 = new SplitContainerEx();
            splitContainer3 = new SplitContainerEx();

            splitContainer1.BeginInit();
            splitContainer1.Panel2.SuspendLayout();
            splitContainer1.SuspendLayout();

            splitContainer2.BeginInit();
            splitContainer2.Panel1.SuspendLayout();
            splitContainer2.SuspendLayout();

            splitContainer3.BeginInit();
            splitContainer3.SuspendLayout();

            SuspendLayout();

            //
            //
            //
            loadTimer.Interval = 100;
            loadTimer.Tick    += LoadTimer_Tick;

            //
            //
            //
            tagsTabPage.Name     = "tagsTabPage";
            tagsTabPage.TabIndex = 0;
            tagsTabPage.Tag      = "tags";
            tagsTabPage.Text     = "Tags";
            tagsTabPage.UseVisualStyleBackColor = true;

            bookmarksTabPage.Name     = "bookmarksTabPage";
            bookmarksTabPage.TabIndex = 1;
            bookmarksTabPage.Tag      = "bookmarks";
            bookmarksTabPage.Text     = "Bookmarks";
            bookmarksTabPage.UseVisualStyleBackColor = true;

            libraryTabPage.Name     = "libraryTabPage";
            libraryTabPage.TabIndex = 2;
            libraryTabPage.Tag      = "library";
            libraryTabPage.Text     = "Library";
            libraryTabPage.UseVisualStyleBackColor = true;

            browsingTabPage.Name     = "browsingTabPage";
            browsingTabPage.TabIndex = 4;
            browsingTabPage.Tag      = "browsing";
            browsingTabPage.Text     = "Browsing";
            browsingTabPage.UseVisualStyleBackColor = true;

            //
            //
            //
            listsTabControl.Dock          = DockStyle.Fill;
            listsTabControl.Name          = "treeViewTabControl";
            listsTabControl.SelectedIndex = -1;
            listsTabControl.TabIndex      = 2;
            listsTabControl.TabPages.Add(tagsTabPage);
            listsTabControl.TabPages.Add(bookmarksTabPage);
            listsTabControl.TabPages.Add(libraryTabPage);
            listsTabControl.TabPages.Add(browsingTabPage);
            listsTabControl.Selected += TreeViewTabControl_Selected;

            splitContainer3.Panel1.Controls.Add(listsTabControl);

            //
            //
            //
            tagsTreeView.Dock = DockStyle.Fill;

            //
            //
            //
            tagsToolStrip.Dock         = DockStyle.Top;
            tagsToolStrip.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            tagsToolStrip.AutoSize     = true;

            //
            //
            //
            tagsTabPage.Controls.Add(tagsTreeView);
            tagsTabPage.Controls.Add(tagsToolStrip);

            //
            //
            //
            bookmarksModel.ItemAdded   += BookmarksModel_ItemAdded;
            bookmarksModel.ItemChanged += BookmarksModel_ItemChanged;

            //
            //
            //
            bookmarksTreeView.Dock = DockStyle.Fill;

            //
            //
            //
            bookmarksToolStrip.Dock         = DockStyle.Top;
            bookmarksToolStrip.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            bookmarksToolStrip.AutoSize     = true;

            //
            //
            //
            bookmarksTabPage.Controls.Add(bookmarksTreeView);
            bookmarksTabPage.Controls.Add(bookmarksToolStrip);

            //
            //
            //
            libraryTreeView.Dock = DockStyle.Fill;

            //
            //
            //
            libraryToolStrip.Dock         = DockStyle.Top;
            libraryToolStrip.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            libraryToolStrip.AutoSize     = true;

            //
            //
            //
            libraryTabPage.Controls.Add(libraryTreeView);
            libraryTabPage.Controls.Add(libraryToolStrip);

            //
            //
            //
            browsingModel.ItemAdded   += BrowsingModel_ItemAdded;
            browsingModel.ItemChanged += BrowsingModel_ItemChanged;

            //
            //
            //
            browsingToolStrip.Dock         = DockStyle.Top;
            browsingToolStrip.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            browsingToolStrip.AutoSize     = true;

            //
            //
            //
            browsingTreeView.Dock = DockStyle.Fill;

            //
            //
            //
            browsingTabPage.Controls.Add(browsingTreeView);
            browsingTabPage.Controls.Add(browsingToolStrip);

            //
            //
            //
            galleryBrowserViewTabPage.Name     = "galleryBrowserViewTabPage";
            galleryBrowserViewTabPage.Padding  = Padding.Empty;
            galleryBrowserViewTabPage.TabIndex = 0;
            galleryBrowserViewTabPage.Text     = "Search";
            galleryBrowserViewTabPage.UseVisualStyleBackColor = true;

            //
            //
            //
            libraryBrowserViewTabPage.Name     = "libraryBrowserViewTabPage";
            libraryBrowserViewTabPage.TabIndex = 1;
            libraryBrowserViewTabPage.Text     = "Library";
            libraryBrowserViewTabPage.UseVisualStyleBackColor = true;

            //
            //
            //
            downloadsListViewTabPage.Name     = "downloadsListViewTabPage";
            downloadsListViewTabPage.TabIndex = 2;
            downloadsListViewTabPage.Text     = "Downloads";
            downloadsListViewTabPage.UseVisualStyleBackColor = true;

            //
            //
            //
            mainViewTabControl.Controls.Add(galleryBrowserViewTabPage);
            mainViewTabControl.Controls.Add(libraryBrowserViewTabPage);
            mainViewTabControl.Controls.Add(downloadsListViewTabPage);
            mainViewTabControl.Dock          = DockStyle.Fill;
            mainViewTabControl.Name          = "mainViewTabControl";
            mainViewTabControl.SelectedIndex = 0;
            mainViewTabControl.TabIndex      = 2;
            mainViewTabControl.Selected     += MainViewTabControl_Selected;

            splitContainer3.Panel2.Controls.Add(mainViewTabControl);
            splitContainer2.Panel2.Controls.Add(detailsTabControl);

            //
            // detailsTabControl
            //
            detailsTabControl.Controls.Add(detailsTabPage);
            detailsTabControl.Controls.Add(downloadTabPage);
            detailsTabControl.Dock          = DockStyle.Fill;
            detailsTabControl.Name          = "detailsTabControl";
            detailsTabControl.SelectedIndex = 0;
            detailsTabControl.TabIndex      = 2;

            //
            // detailsTabPage
            //
            detailsTabPage.Name     = "detailsTabPage";
            detailsTabPage.TabIndex = 0;
            detailsTabPage.Text     = "Details";
            detailsTabPage.UseVisualStyleBackColor = true;

            //
            // downloadTabPage
            //
            downloadTabPage.Name     = "downloadTabPage";
            downloadTabPage.TabIndex = 1;
            downloadTabPage.Text     = "Download";
            downloadTabPage.UseVisualStyleBackColor = true;

            //
            //
            //
            galleryBrowserView.Dock = DockStyle.Fill;
            galleryBrowserView.WebBrowser.ObjectForScripting = publicApi;

            //
            //
            //
            galleryToolStrip.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            galleryToolStrip.AutoSize     = true;
            galleryToolStrip.Dock         = DockStyle.Top;

            //
            //
            //
            galleryBrowserViewTabPage.Controls.Add(galleryBrowserView);
            galleryBrowserViewTabPage.Controls.Add(galleryToolStrip);

            //
            //
            //
            libraryBrowserView.Dock = DockStyle.Fill;
            libraryBrowserView.WebBrowser.ObjectForScripting = publicApi;

            //
            //
            //
            libraryBrowserToolStrip.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            libraryBrowserToolStrip.AutoSize     = true;
            libraryBrowserToolStrip.Dock         = DockStyle.Top;

            //
            //
            //
            libraryBrowserViewTabPage.Controls.Add(libraryBrowserView);
            libraryBrowserViewTabPage.Controls.Add(libraryBrowserToolStrip);

            //
            //
            //
            detailsToolStrip.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            detailsToolStrip.AutoSize     = true;
            detailsToolStrip.Dock         = DockStyle.Top;

            //
            //
            //
            detailsBrowserView.Dock = DockStyle.Fill;
            detailsBrowserView.WebBrowser.ObjectForScripting = publicApi;

            //
            //
            //
            detailsTabPage.Controls.Add(detailsBrowserView);
            detailsTabPage.Controls.Add(detailsToolStrip);

            //
            // splitContainer1
            //
            splitContainer1.Dock          = DockStyle.Fill;
            splitContainer1.FixedPanel    = FixedPanel.Panel1;
            splitContainer1.Margin        = new Padding(0);
            splitContainer1.Name          = "splitContainer1";
            splitContainer1.Orientation   = Orientation.Horizontal;
            splitContainer1.Panel1MinSize = 22;

            //
            // splitContainer1.Panel2
            //
            splitContainer1.Panel2.Controls.Add(splitContainer2);
            splitContainer1.Size              = new Size(1364, 637);
            splitContainer1.SplitterDistance  = 25;
            splitContainer1.SplitterIncrement = 22;
            splitContainer1.SplitterWidth     = 7;
            splitContainer1.TabIndex          = 2;

            //
            // splitContainer2
            //
            splitContainer2.Dock       = DockStyle.Fill;
            splitContainer2.FixedPanel = FixedPanel.Panel2;
            splitContainer2.Margin     = new Padding(0);
            splitContainer2.Name       = "splitContainer2";

            //
            // splitContainer2.Panel1
            //
            splitContainer2.Panel1.Controls.Add(splitContainer3);
            splitContainer2.Size             = new Size(1364, 605);
            splitContainer2.SplitterDistance = 1214;
            splitContainer2.SplitterWidth    = 7;
            splitContainer2.TabIndex         = 1;

            //
            // splitContainer3
            //
            splitContainer3.Dock             = DockStyle.Fill;
            splitContainer3.FixedPanel       = FixedPanel.Panel1;
            splitContainer3.Margin           = new Padding(0);
            splitContainer3.Name             = "splitContainer3";
            splitContainer3.Size             = new Size(1214, 605);
            splitContainer3.SplitterDistance = 200;
            splitContainer3.SplitterWidth    = 7;
            splitContainer3.TabIndex         = 0;

            //
            // applicationMenuStrip
            //
            mainMenuStrip.Exit               += MainMenuStrip_Exit;
            mainMenuStrip.ToggleListsPanel   += MainMenuStrip_ToggleListsPanel;
            mainMenuStrip.ToggleDetailsPanel += MainMenuStrip_ToggleDetailsPanel;
            mainMenuStrip.ToggleFullScreen   += MainMenuStrip_ToggleFullScreen;
            mainMenuStrip.ShowAbout          += MainMenuStrip_ShowAbout;
            mainMenuStrip.ShowPlugins        += MainMenuStrip_ShowPlugins;

            //
            // this
            //
            Controls.Add(splitContainer1);
            Controls.Add(mainMenuStrip);
            Controls.Add(webBrowserToolTip);
            webBrowserToolTip.BringToFront();
            MainMenuStrip = mainMenuStrip;
            Padding       = new Padding(0);
            Text          = aboutTextFormatter.Format(Settings.Window.TextFormat);
            if (Settings.Network.Offline)
            {
                Text += " [OFFLINE]";
            }
            Enabled = false;

            //
            // splash screen
            //
            if (Settings.SplashScreen.IsVisible)
            {
                startupWebBrowser      = new StartupWebBrowserView(coreTextFormatter, documentTemplates.Startup, applicationLoader);
                startupWebBrowser.Name = "startupWebBrowserView";
                startupWebBrowser.Dock = DockStyle.Fill;
                startupWebBrowser.WebBrowser.DocumentCompleted += WebBrowser_DocumentCompleted;

                Controls.Add(startupWebBrowser);
                startupWebBrowser.BringToFront();

                // avoid flickering
                listsTabControl.Visible    = false;
                mainViewTabControl.Visible = false;
                detailsTabControl.Visible  = false;
            }

            backgroundTaskWorker.ProgressChanged += TaskBackgroundWorker_ProgressChanged;

            pageDownloader.PagesDownloadCompleted += PageDownloader_PagesDownloadCompleted;

            ReadTheme();
            ApplyTheme();
            ApplyVisualStyles();

            splitContainer1.Panel2.ResumeLayout(false);
            splitContainer1.EndInit();
            splitContainer1.ResumeLayout(false);

            splitContainer2.Panel1.ResumeLayout(false);
            splitContainer2.EndInit();
            splitContainer2.ResumeLayout(false);

            splitContainer3.EndInit();
            splitContainer3.ResumeLayout(false);

            ResumeLayout(false);
            PerformLayout();
        }
 public NativeUpDown(TabControlEx ctrl)
 {
     parentControl = ctrl;
 }
Пример #14
0
 private void InitializeComponent()
 {
     this.components   = new System.ComponentModel.Container();
     this.cyoutPanel   = new System.Windows.Forms.TableLayoutPanel();
     this.bT1          = new QSHP.UI.Ctr.ButtonEx(this.components);
     this.bT2          = new QSHP.UI.Ctr.ButtonEx(this.components);
     this.bT3          = new QSHP.UI.Ctr.ButtonEx(this.components);
     this.bT4          = new QSHP.UI.Ctr.ButtonEx(this.components);
     this.bT5          = new QSHP.UI.Ctr.ButtonEx(this.components);
     this.bT6          = new QSHP.UI.Ctr.ButtonEx(this.components);
     this.bT7          = new QSHP.UI.Ctr.ButtonEx(this.components);
     this.panel1       = new System.Windows.Forms.Panel();
     this.tBb1         = new QSHP.UI.Ctr.TabControlEx();
     this.passwordPage = new System.Windows.Forms.TabPage();
     this.label2       = new System.Windows.Forms.Label();
     this.passwordEdit = new QSHP.UI.Ctr.TextBoxEx();
     this.usedTimePage = new System.Windows.Forms.TabPage();
     this.label3       = new System.Windows.Forms.Label();
     this.usedTime     = new System.Windows.Forms.Label();
     this.label1       = new System.Windows.Forms.Label();
     this.managerLable = new System.Windows.Forms.Label();
     this.bT8          = new QSHP.UI.Ctr.ButtonEx(this.components);
     this.cyoutPanel.SuspendLayout();
     this.panel1.SuspendLayout();
     this.tBb1.SuspendLayout();
     this.passwordPage.SuspendLayout();
     this.usedTimePage.SuspendLayout();
     this.SuspendLayout();
     //
     // cyoutPanel
     //
     this.cyoutPanel.ColumnCount = 6;
     this.cyoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 47F));
     this.cyoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
     this.cyoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
     this.cyoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
     this.cyoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
     this.cyoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 52F));
     this.cyoutPanel.Controls.Add(this.bT1, 1, 1);
     this.cyoutPanel.Controls.Add(this.bT2, 2, 1);
     this.cyoutPanel.Controls.Add(this.bT3, 3, 1);
     this.cyoutPanel.Controls.Add(this.bT4, 4, 1);
     this.cyoutPanel.Controls.Add(this.bT5, 1, 2);
     this.cyoutPanel.Controls.Add(this.bT6, 2, 2);
     this.cyoutPanel.Controls.Add(this.bT7, 3, 2);
     this.cyoutPanel.Controls.Add(this.panel1, 3, 3);
     this.cyoutPanel.Controls.Add(this.bT8, 4, 2);
     this.cyoutPanel.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.cyoutPanel.Location = new System.Drawing.Point(0, 0);
     this.cyoutPanel.Name     = "cyoutPanel";
     this.cyoutPanel.RowCount = 4;
     this.cyoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
     this.cyoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
     this.cyoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
     this.cyoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 136F));
     this.cyoutPanel.Size     = new System.Drawing.Size(815, 495);
     this.cyoutPanel.TabIndex = 0;
     //
     // bT1
     //
     this.bT1.BackColor  = System.Drawing.SystemColors.Control;
     this.bT1.ButtonMode = QSHP.UI.Ctr.BtMode.Normal;
     this.bT1.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.bT1.Flag       = 0;
     this.bT1.FlatAppearance.BorderSize = 0;
     this.bT1.FlatStyle               = System.Windows.Forms.FlatStyle.Popup;
     this.bT1.Font                    = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.bT1.LED                     = false;
     this.bT1.LedLocation             = new System.Drawing.Point(4, -10);
     this.bT1.Location                = new System.Drawing.Point(62, 32);
     this.bT1.Margin                  = new System.Windows.Forms.Padding(15);
     this.bT1.Name                    = "bT1";
     this.bT1.NumText                 = "01";
     this.bT1.Pressed                 = false;
     this.bT1.Size                    = new System.Drawing.Size(149, 141);
     this.bT1.TabIndex                = 0;
     this.bT1.TabStop                 = false;
     this.bT1.UsedLed                 = false;
     this.bT1.UseVisualStyleBackColor = false;
     //
     // bT2
     //
     this.bT2.BackColor  = System.Drawing.SystemColors.Control;
     this.bT2.ButtonMode = QSHP.UI.Ctr.BtMode.Normal;
     this.bT2.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.bT2.Flag       = 0;
     this.bT2.FlatAppearance.BorderSize = 0;
     this.bT2.FlatStyle               = System.Windows.Forms.FlatStyle.Popup;
     this.bT2.Font                    = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.bT2.LED                     = false;
     this.bT2.LedLocation             = new System.Drawing.Point(4, -10);
     this.bT2.Location                = new System.Drawing.Point(241, 32);
     this.bT2.Margin                  = new System.Windows.Forms.Padding(15);
     this.bT2.Name                    = "bT2";
     this.bT2.NumText                 = "02";
     this.bT2.Pressed                 = false;
     this.bT2.Size                    = new System.Drawing.Size(149, 141);
     this.bT2.TabIndex                = 1;
     this.bT2.TabStop                 = false;
     this.bT2.UsedLed                 = false;
     this.bT2.UseVisualStyleBackColor = false;
     //
     // bT3
     //
     this.bT3.BackColor  = System.Drawing.SystemColors.Control;
     this.bT3.ButtonMode = QSHP.UI.Ctr.BtMode.Normal;
     this.bT3.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.bT3.Flag       = 0;
     this.bT3.FlatAppearance.BorderSize = 0;
     this.bT3.FlatStyle               = System.Windows.Forms.FlatStyle.Popup;
     this.bT3.Font                    = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.bT3.LED                     = false;
     this.bT3.LedLocation             = new System.Drawing.Point(4, -10);
     this.bT3.Location                = new System.Drawing.Point(420, 32);
     this.bT3.Margin                  = new System.Windows.Forms.Padding(15);
     this.bT3.Name                    = "bT3";
     this.bT3.NumText                 = "03";
     this.bT3.Pressed                 = false;
     this.bT3.Size                    = new System.Drawing.Size(149, 141);
     this.bT3.TabIndex                = 2;
     this.bT3.TabStop                 = false;
     this.bT3.UsedLed                 = false;
     this.bT3.UseVisualStyleBackColor = false;
     //
     // bT4
     //
     this.bT4.BackColor  = System.Drawing.SystemColors.Control;
     this.bT4.ButtonMode = QSHP.UI.Ctr.BtMode.Normal;
     this.bT4.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.bT4.Flag       = 0;
     this.bT4.FlatAppearance.BorderSize = 0;
     this.bT4.FlatStyle               = System.Windows.Forms.FlatStyle.Popup;
     this.bT4.Font                    = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.bT4.LED                     = false;
     this.bT4.LedLocation             = new System.Drawing.Point(4, -10);
     this.bT4.Location                = new System.Drawing.Point(599, 32);
     this.bT4.Margin                  = new System.Windows.Forms.Padding(15);
     this.bT4.Name                    = "bT4";
     this.bT4.NumText                 = "04";
     this.bT4.Pressed                 = false;
     this.bT4.Size                    = new System.Drawing.Size(149, 141);
     this.bT4.TabIndex                = 3;
     this.bT4.TabStop                 = false;
     this.bT4.UsedLed                 = false;
     this.bT4.UseVisualStyleBackColor = false;
     //
     // bT5
     //
     this.bT5.BackColor  = System.Drawing.SystemColors.Control;
     this.bT5.ButtonMode = QSHP.UI.Ctr.BtMode.Normal;
     this.bT5.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.bT5.Flag       = 0;
     this.bT5.FlatAppearance.BorderSize = 0;
     this.bT5.FlatStyle               = System.Windows.Forms.FlatStyle.Popup;
     this.bT5.Font                    = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.bT5.LED                     = false;
     this.bT5.LedLocation             = new System.Drawing.Point(4, -10);
     this.bT5.Location                = new System.Drawing.Point(62, 198);
     this.bT5.Margin                  = new System.Windows.Forms.Padding(15, 10, 15, 15);
     this.bT5.Name                    = "bT5";
     this.bT5.NumText                 = "05";
     this.bT5.Pressed                 = false;
     this.bT5.Size                    = new System.Drawing.Size(149, 146);
     this.bT5.TabIndex                = 4;
     this.bT5.TabStop                 = false;
     this.bT5.UsedLed                 = false;
     this.bT5.UseVisualStyleBackColor = false;
     //
     // bT6
     //
     this.bT6.BackColor  = System.Drawing.SystemColors.Control;
     this.bT6.ButtonMode = QSHP.UI.Ctr.BtMode.Normal;
     this.bT6.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.bT6.Flag       = 0;
     this.bT6.FlatAppearance.BorderSize = 0;
     this.bT6.FlatStyle               = System.Windows.Forms.FlatStyle.Popup;
     this.bT6.Font                    = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.bT6.LED                     = false;
     this.bT6.LedLocation             = new System.Drawing.Point(4, -10);
     this.bT6.Location                = new System.Drawing.Point(241, 198);
     this.bT6.Margin                  = new System.Windows.Forms.Padding(15, 10, 15, 15);
     this.bT6.Name                    = "bT6";
     this.bT6.NumText                 = "06";
     this.bT6.Pressed                 = false;
     this.bT6.Size                    = new System.Drawing.Size(149, 146);
     this.bT6.TabIndex                = 5;
     this.bT6.TabStop                 = false;
     this.bT6.UsedLed                 = false;
     this.bT6.UseVisualStyleBackColor = false;
     //
     // bT7
     //
     this.bT7.BackColor  = System.Drawing.SystemColors.Control;
     this.bT7.ButtonMode = QSHP.UI.Ctr.BtMode.Normal;
     this.bT7.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.bT7.Flag       = 0;
     this.bT7.FlatAppearance.BorderSize = 0;
     this.bT7.FlatStyle               = System.Windows.Forms.FlatStyle.Popup;
     this.bT7.Font                    = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.bT7.LED                     = false;
     this.bT7.LedLocation             = new System.Drawing.Point(4, -10);
     this.bT7.Location                = new System.Drawing.Point(420, 198);
     this.bT7.Margin                  = new System.Windows.Forms.Padding(15, 10, 15, 15);
     this.bT7.Name                    = "bT7";
     this.bT7.NumText                 = "07";
     this.bT7.Pressed                 = false;
     this.bT7.Size                    = new System.Drawing.Size(149, 146);
     this.bT7.TabIndex                = 6;
     this.bT7.TabStop                 = false;
     this.bT7.UsedLed                 = false;
     this.bT7.UseVisualStyleBackColor = false;
     //
     // panel1
     //
     this.cyoutPanel.SetColumnSpan(this.panel1, 2);
     this.panel1.Controls.Add(this.tBb1);
     this.panel1.Controls.Add(this.label1);
     this.panel1.Controls.Add(this.managerLable);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panel1.Font     = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.panel1.Location = new System.Drawing.Point(408, 362);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(352, 130);
     this.panel1.TabIndex = 7;
     //
     // tBb1
     //
     this.tBb1.Controls.Add(this.passwordPage);
     this.tBb1.Controls.Add(this.usedTimePage);
     this.tBb1.ItemSize      = new System.Drawing.Size(1, 1);
     this.tBb1.Location      = new System.Drawing.Point(21, 47);
     this.tBb1.Name          = "tBb1";
     this.tBb1.SelectedIndex = 0;
     this.tBb1.Size          = new System.Drawing.Size(328, 82);
     this.tBb1.TabIndex      = 7;
     //
     // passwordPage
     //
     this.passwordPage.BackColor = System.Drawing.SystemColors.Control;
     this.passwordPage.Controls.Add(this.label2);
     this.passwordPage.Controls.Add(this.passwordEdit);
     this.passwordPage.Location = new System.Drawing.Point(4, 5);
     this.passwordPage.Name     = "passwordPage";
     this.passwordPage.Padding  = new System.Windows.Forms.Padding(3);
     this.passwordPage.Size     = new System.Drawing.Size(320, 73);
     this.passwordPage.TabIndex = 0;
     this.passwordPage.Text     = "tabPage1";
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(69, 11);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(90, 21);
     this.label2.TabIndex = 4;
     this.label2.Text     = "用户密码:";
     //
     // passwordEdit
     //
     this.passwordEdit.BackColor    = System.Drawing.SystemColors.Window;
     this.passwordEdit.Font         = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold);
     this.passwordEdit.Location     = new System.Drawing.Point(165, 7);
     this.passwordEdit.MaxLength    = 10;
     this.passwordEdit.Name         = "passwordEdit";
     this.passwordEdit.PasswordChar = '*';
     this.passwordEdit.SetError     = false;
     this.passwordEdit.SetWarn      = false;
     this.passwordEdit.Size         = new System.Drawing.Size(149, 29);
     this.passwordEdit.TabIndex     = 5;
     this.passwordEdit.TextAlign    = System.Windows.Forms.HorizontalAlignment.Center;
     this.passwordEdit.WordWrap     = false;
     //
     // usedTimePage
     //
     this.usedTimePage.BackColor = System.Drawing.SystemColors.Control;
     this.usedTimePage.Controls.Add(this.label3);
     this.usedTimePage.Controls.Add(this.usedTime);
     this.usedTimePage.Location = new System.Drawing.Point(4, 5);
     this.usedTimePage.Name     = "usedTimePage";
     this.usedTimePage.Padding  = new System.Windows.Forms.Padding(3);
     this.usedTimePage.Size     = new System.Drawing.Size(320, 73);
     this.usedTimePage.TabIndex = 1;
     this.usedTimePage.Text     = "tabPage2";
     //
     // label3
     //
     this.label3.AutoSize = true;
     this.label3.Location = new System.Drawing.Point(69, 11);
     this.label3.Name     = "label3";
     this.label3.Size     = new System.Drawing.Size(90, 21);
     this.label3.TabIndex = 0;
     this.label3.Text     = "操作用时:";
     //
     // usedTime
     //
     this.usedTime.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.usedTime.Font        = new System.Drawing.Font("QSHP", 20F);
     this.usedTime.Location    = new System.Drawing.Point(165, 7);
     this.usedTime.Name        = "usedTime";
     this.usedTime.Size        = new System.Drawing.Size(149, 29);
     this.usedTime.TabIndex    = 1;
     this.usedTime.Text        = "00:00:00";
     this.usedTime.TextAlign   = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(95, 15);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(90, 21);
     this.label1.TabIndex = 0;
     this.label1.Text     = "用户类型:";
     //
     // managerLable
     //
     this.managerLable.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.managerLable.Font        = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.managerLable.Location    = new System.Drawing.Point(191, 9);
     this.managerLable.Name        = "managerLable";
     this.managerLable.Size        = new System.Drawing.Size(149, 34);
     this.managerLable.TabIndex    = 1;
     this.managerLable.Text        = "操作人员";
     this.managerLable.TextAlign   = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // bT8
     //
     this.bT8.BackColor  = System.Drawing.SystemColors.Control;
     this.bT8.ButtonMode = QSHP.UI.Ctr.BtMode.Normal;
     this.bT8.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.bT8.Flag       = 0;
     this.bT8.FlatAppearance.BorderSize = 0;
     this.bT8.FlatStyle               = System.Windows.Forms.FlatStyle.Popup;
     this.bT8.Font                    = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.bT8.LED                     = false;
     this.bT8.LedLocation             = new System.Drawing.Point(4, -10);
     this.bT8.Location                = new System.Drawing.Point(599, 198);
     this.bT8.Margin                  = new System.Windows.Forms.Padding(15, 10, 15, 15);
     this.bT8.Name                    = "bT8";
     this.bT8.NumText                 = "08";
     this.bT8.Pressed                 = false;
     this.bT8.Size                    = new System.Drawing.Size(149, 146);
     this.bT8.TabIndex                = 8;
     this.bT8.TabStop                 = false;
     this.bT8.UsedLed                 = false;
     this.bT8.UseVisualStyleBackColor = false;
     //
     // HomeScreen
     //
     this.BtStyle    = QSHP.UI.UnderStyle.Default;
     this.CancelText = "菜  单";
     this.ClientSize = new System.Drawing.Size(815, 495);
     this.Controls.Add(this.cyoutPanel);
     this.FmStyle                = QSHP.FormStyle.PathModeCancel;
     this.Name                   = "HomeScreen";
     this.Text                   = "主界面";
     this.CancelClick           += new System.EventHandler(this.HomeScreen_CancelClick);
     this.AutoUpdateEventHander += new System.EventHandler(this.HomeScreen_AutoUpdataEventHander);
     this.Load                  += new System.EventHandler(this.HomeScreen_Load);
     this.cyoutPanel.ResumeLayout(false);
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     this.tBb1.ResumeLayout(false);
     this.passwordPage.ResumeLayout(false);
     this.passwordPage.PerformLayout();
     this.usedTimePage.ResumeLayout(false);
     this.usedTimePage.PerformLayout();
     this.ResumeLayout(false);
 }
Пример #15
0
 protected DockForm ShowForm<T>()
 {
     string str = PropertyUtil.GetValue("MAIN_FORMSTYLE");
     if (!string.IsNullOrEmpty(str))
     {
         if (!(str.ToUpper() == "OLD"))
         {
             if (!(str.ToUpper() == "NEW"))
             {
                 goto Label_01F7;
             }
             TabControlEx ex = (TabControlEx) this.object_0;
             IEnumerator enumerator = ex.TabPages.GetEnumerator();
             {
                 TabPage current;
                 while (enumerator.MoveNext())
                 {
                     current = (TabPage) enumerator.Current;
                     if ((current is TabPageEx) && (((TabPageEx) current).FormType == typeof(T).FullName))
                     {
                         goto Label_0192;
                     }
                 }
                 System.Type type2 = typeof(T);
                 DockForm form5 = (DockForm) Activator.CreateInstance(type2);
                 form5.Show(ex);
                 return form5;
             Label_0192:
                 ((TabControlEx) this.object_0).SelectedTab = current;
                 return (((TabPageEx) current).FormInstance as DockForm);
             }
         }
         System.Type type = typeof(T);
         DockForm form = (DockForm) Activator.CreateInstance(type);
         Form form2 = this.object_0 as Form;
         if (form2 != null)
         {
             Form[] formArray = form2.MdiChildren;
             if (formArray != null)
             {
                 foreach (Form form3 in formArray)
                 {
                     if (form3 is DockForm)
                     {
                         form3.Close();
                     }
                 }
             }
         }
         Form[] mdiChildren = form2.MdiChildren;
         bool flag = true;
         if (mdiChildren != null)
         {
             foreach (Form form4 in mdiChildren)
             {
                 if (form4 is DockForm)
                 {
                     flag = false;
                     break;
                 }
             }
         }
         if (flag)
         {
             form.MdiParent = form2;
             form.StartPosition = FormStartPosition.CenterParent;
             form.MinimizeBox = false;
             form.WindowState = FormWindowState.Maximized;
             if (form2 is DockForm)
             {
                 ((DockForm) form2).vmethod_0("  关闭  ");
             }
             form.FormClosed += new FormClosedEventHandler(this.method_0);
             form.Show();
             return form;
         }
     }
     Label_01F7:
     return null;
 }