private void StartProgress(string text) { ProgressLabel.StringValue = text; ProgressIndicator.StartAnimation(this); ProgressPanel.OrderFront(this); //NSApp.BeginSheet(ProgressPanel, this.Window); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.progressPanel1 = new DevExpress.XtraWaitForm.ProgressPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // progressPanel1 // this.progressPanel1.Appearance.BackColor = System.Drawing.Color.Transparent; this.progressPanel1.Appearance.Options.UseBackColor = true; this.progressPanel1.AppearanceCaption.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); this.progressPanel1.AppearanceCaption.Options.UseFont = true; this.progressPanel1.AppearanceDescription.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.progressPanel1.AppearanceDescription.Options.UseFont = true; this.progressPanel1.Description = "Loading..."; this.progressPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.progressPanel1.ImageHorzOffset = 10; this.progressPanel1.Location = new System.Drawing.Point(0, 17); this.progressPanel1.LookAndFeel.SkinName = "Sharp"; this.progressPanel1.LookAndFeel.UseDefaultLookAndFeel = false; this.progressPanel1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3); this.progressPanel1.Name = "progressPanel1"; this.progressPanel1.Size = new System.Drawing.Size(246, 39); this.progressPanel1.TabIndex = 0; this.progressPanel1.Text = "progressPanel1"; // // tableLayoutPanel1 // this.tableLayoutPanel1.AutoSize = true; this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent; this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 220F)); this.tableLayoutPanel1.Controls.Add(this.progressPanel1, 0, 0); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(0, 14, 0, 14); this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(246, 73); this.tableLayoutPanel1.TabIndex = 1; // // WaitForm1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.ClientSize = new System.Drawing.Size(246, 73); this.Controls.Add(this.tableLayoutPanel1); this.DoubleBuffered = true; this.MinimumSize = new System.Drawing.Size(246, 0); this.Name = "FrmLoading"; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "Form1"; this.tableLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); }
private void EndProgress() { ProgressIndicator.StopAnimation(this); ProgressPanel.OrderOut(this); //NSApp.EndSheet(ProgressPanel); }
private bool SaveConfiguration(bool saveas) { MessageBoxResult messageBoxResult = MessageBox.Show("Сохранить настройки?", "Внимание", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning); switch (messageBoxResult) { case MessageBoxResult.Yes: if (File.Exists(AppSt.Default.cl_moncha_path) == false || saveas) { SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "Moncha File (*.mws)|*.mws"; if (saveFileDialog.ShowDialog() == true) { ProgressPanel.SetProgressBar(1, 2, "Save Moncha"); MonchaHub.Save(saveFileDialog.FileName); if (File.Exists(saveFileDialog.FileName) == false) { ProgressPanel.SetProgressBar(2, 2, "Not Save"); SaveConfiguration(true); } else { ProgressPanel.SetProgressBar(2, 2, "Saved"); AppSt.Default.cl_moncha_path = saveFileDialog.FileName; } } } else { MonchaHub.Save(AppSt.Default.cl_moncha_path); } MonchaPathBox.Content = AppSt.Default.cl_moncha_path; AppSt.Default.Save(); ProgressPanel.End(); return(false); break; case MessageBoxResult.No: ProgressPanel.End(); return(false); break; case MessageBoxResult.Cancel: ProgressPanel.End(); return(true); break; } ProgressPanel.SetProgressBar(2, 2, "Save Setting"); ProgressPanel.End(); return(false); }
private void InitializeComponent() { this.progressPanel1 = new ProgressPanel(); this.tableLayoutPanel1 = new TableLayoutPanel(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); this.progressPanel1.Appearance.BackColor = Color.Transparent; this.progressPanel1.Appearance.Options.UseBackColor = true; this.progressPanel1.AppearanceCaption.Font = new Font("Microsoft Sans Serif", 12f); this.progressPanel1.AppearanceCaption.Options.UseFont = true; this.progressPanel1.AppearanceDescription.Font = new Font("Microsoft Sans Serif", 8.25f); this.progressPanel1.AppearanceDescription.Options.UseFont = true; this.progressPanel1.Dock = DockStyle.Fill; this.progressPanel1.ImageHorzOffset = 20; this.progressPanel1.Location = new Point(0, 17); this.progressPanel1.Margin = new Padding(0, 3, 0, 3); this.progressPanel1.Name = "progressPanel1"; this.progressPanel1.Size = new Size(246, 39); this.progressPanel1.TabIndex = 0; this.progressPanel1.Text = "progressPanel1"; this.tableLayoutPanel1.AutoSize = true; this.tableLayoutPanel1.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.tableLayoutPanel1.BackColor = Color.Transparent; this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 220f)); this.tableLayoutPanel1.Controls.Add((Control)this.progressPanel1, 0, 0); this.tableLayoutPanel1.Dock = DockStyle.Fill; this.tableLayoutPanel1.Location = new Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Padding = new Padding(0, 14, 0, 14); this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100f)); this.tableLayoutPanel1.Size = new Size(246, 73); this.tableLayoutPanel1.TabIndex = 1; this.AutoScaleDimensions = new SizeF(6f, 13f); this.AutoScaleMode = AutoScaleMode.Font; this.AutoSize = true; this.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.ClientSize = new Size(246, 73); this.Controls.Add((Control)this.tableLayoutPanel1); this.DoubleBuffered = true; this.MinimumSize = new Size(246, 0); this.Name = "MyWaitForm"; this.StartPosition = FormStartPosition.Manual; this.Text = "Form1"; this.tableLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { if (ClientTextBox.Text == "") { return; } _canPreview = false; metroProgressBar1.Value = 0; ProgressPanel.BringToFront(); ProgressPanel.Visible = true; menuStrip1.Enabled = false; metroTabControl1.Enabled = false; _selectedTab = metroTabControl1.SelectedIndex; FileWorker.RunWorkerAsync(); }
public GameLibraryPage() { InitializeComponent(); AdMediator_0A5E56.Id = "AdMediator-Id-0F3177E7-6EEB-43B3-84B0-CDC87AC71902"; AdMediator_0A5E56.AdSdkError += OnAdSdkError; AdMediator_0A5E56.AdMediatorFilled += OnAdFilled; AdMediator_0A5E56.AdMediatorError += OnAdMediatorError; AdMediator_0A5E56.AdSdkEvent += OnAdSdkEvent; DataContext = new GameLibraryViewModel(); NoGameTextBlock.SetBinding(VisibilityProperty, new Binding { Path = new PropertyPath("ShowNoGameMessage"), Converter = new ShowNoGameMessageToVisibilityConverter() }); ProgressPanel.SetBinding(VisibilityProperty, new Binding { Path = new PropertyPath("IsScanning"), Converter = new IsScanningToVisibilityConverter() }); }
private void ShowProgressPanel() { ProductsPanel.Visible = false; keywordsList.Visible = false; SearchPanel.Visible = false; InstallButtons1.Visible = false; InstallButtons2.Visible = false; InstallPanel.Visible = false; AceptDEclineButtons.Visible = false; InstallCompletedPanel.Visible = false; ProgressPanel.Visible = true; ProgressTimer.Enabled = true; ProductsPanel.Update(); InstallPanel.Update(); ProgressPanel.Update(); }
private void SaveData() { for (int i = 0; i <= 500; i++) { ProgressPanel progressPanel1 = new ProgressPanel(); progressPanel1.Caption = "Loading"; progressPanel1.Description = "Please wait..."; progressPanel1.WaitAnimationType = DevExpress.Utils.Animation.WaitingAnimatorType.Ring; progressPanel1.Parent = this; progressPanel1.Top = 100; progressPanel1.Left = 100; this.Controls.Add(progressPanel1); progressPanel1.Show(); progressPanel1.BringToFront(); progressPanel1.WaitAnimationType = DevExpress.Utils.Animation.WaitingAnimatorType.Bar; Thread.Sleep(10); } }
private void InputImage_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { ProgressPanel.Visible = true; ProgressPanel.BringToFront(); Enabled = false; try { _srcPath = openFileDialog1.FileName; FiltersList.SelectedIndex = 0; _currentlySelectedTmpFilePath = string.Empty; _currentlySelectedFilterEnum = null; _tmpImgFilePathPattern = Path.GetTempPath() + "\\" + Guid.NewGuid().ToString(); try { InputImage.Image = null; InputImage.Load(_srcPath); ImageInfo imageInfo = new ImageInfo(_srcPath); imageInfo.Start(); while (imageInfo.Running) { Application.DoEvents(); Thread.Sleep(50); } FileInfoEdit.Text = imageInfo.FileInfoText; } catch (Exception exception) { Console.WriteLine(exception); throw; } } finally { ProgressPanel.Visible = false; Enabled = true; } } }
public static ProgressPanel GetProgress(string caption, string desc) { ProgressPanel progressPanel1 = new ProgressPanel(); progressPanel1.Caption = "Loading"; progressPanel1.Description = "Please wait..."; progressPanel1.WaitAnimationType = DevExpress.Utils.Animation.WaitingAnimatorType.Ring; progressPanel1.Top = 100; progressPanel1.Left = 100; return(progressPanel1); //아래 항목은 호출하는 쪽에서 해줘야 함 //progressPanel1.Parent = this; //this.Controls.Add(progressPanel1); //progressPanel1.Show(); //progressPanel1.BringToFront(); }
} // end ShowSummaryPanel #endregion #region ShowProgressPanel /// <summary> /// ShowPanel event for the ProgressPanel, which added a completed event to notify the wizard /// when the conversion is complete, and starts the conversion. /// </summary> /// <param name="sender">Progress Panel</param> /// <param name="e"></param> private void ShowProgressPanel(WizardCtrlPnlNmspc.WizardControlPanel sender, EventArgs e) { ProgressPanel progressPanel = sender as ProgressPanel; SetActiveView(false); Cursor = System.Windows.Forms.Cursors.WaitCursor; if (progressPanel != null) { // Adding the completed event to notify the wizard when the conversion is complete progressPanel.Completed += new ICS.GUI_Library.Controls.WizardControlPanels.CompletedEventHandler(VariableImportComplete); // Starting the data export by calling the ProgressPanel's StartExport method passing // the Data Access Layer for RFSmart Version 3, the selected environment from which the // data will be exported, and the file to which the data will be exported. progressPanel.StartTask(new VariableImporter(DataDropFilePnl.DataDropFilePath, LabelFormatPnl.LabelFormatFilePath)); } // end if } // end ShowProgressPanel
} // end ShowSummaryPanel #endregion #region ShowProgressPanel /// <summary> /// ShowPanel event for the ProgressPanel, which added a completed event to notify the wizard /// when the conversion is complete, and starts the conversion. /// </summary> /// <param name="sender">Progress Panel</param> /// <param name="e"></param> private void ShowProgressPanel(WizardControlPanel sender, EventArgs e) { ProgressPanel progressPanel = sender as ProgressPanel; SetActiveView(false); Cursor = System.Windows.Forms.Cursors.WaitCursor; if (progressPanel != null) { // Adding the completed event to notify the wizard when the conversion is complete progressPanel.Completed += new CompletedEventHandler(ConstructResults); // Starting the data export by calling the ProgressPanel's StartExport method passing // the Data Access Layer for RFSmart Version 3, the selected environment from which the // data will be exported, and the file to which the data will be exported. progressPanel.StartTask(new DataExporter(EnvironmentPnl.DataAccessLayer, EnvironmentPnl.Environments, ExpFilePathPnl.ExportFilePath)); } // end if } // end ShowProgressPanel
private void ToGC_Progressed(object sender, ProgBarMessage e) { Dispatcher.Invoke(() => ProgressPanel.SetProgressBar(e.v, e.m, e.t)); }
Dictionary <int, GameObject> progressGoDic = new Dictionary <int, GameObject>(); //在用 void Awake() { Instance = this; gc = GameObject.Find("GameManager").GetComponent <GameControl>(); }
private void InitComponents() { JComponent.SetDefaultLocale(Locale.US); java.awt.GridBagConstraints gridBagConstraints; choosePanel = new JPanel(); statusPanel = new JPanel(); status = new JLabel("initializing Q2Sharp..."); jTextField1 = new JTextField(); changeButton = new JButton(); cancelButton = new JButton(); exitButton = new JButton(); okButton = new JButton(); SetDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); SetTitle("Jake2 - Bytonic Software"); SetResizable(false); AddWindowListener(new AnonymousWindowAdapter(this)); choosePanel.SetLayout(new GridBagLayout()); choosePanel.SetMaximumSize(new Size(400, 100)); choosePanel.SetMinimumSize(new Size(400, 100)); choosePanel.SetPreferredSize(new Size(400, 100)); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 1; gridBagConstraints.insets = new Insets(5, 5, 5, 5); gridBagConstraints.weightx = 0; gridBagConstraints.anchor = GridBagConstraints.SOUTHWEST; choosePanel.Add(new JLabel("baseq2 directory"), gridBagConstraints); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new Insets(5, 2, 5, 2); gridBagConstraints.weightx = 1; choosePanel.Add(jTextField1, gridBagConstraints); changeButton.SetText("..."); changeButton.AddActionListener(new AnonymousActionListener(this)); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 1; gridBagConstraints.weightx = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.NONE; gridBagConstraints.insets = new Insets(5, 2, 5, 5); gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; choosePanel.Add(changeButton, gridBagConstraints); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 4; gridBagConstraints.weightx = 0; gridBagConstraints.weighty = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; choosePanel.Add(new JPanel(), gridBagConstraints); cancelButton.SetText("Cancel"); cancelButton.AddActionListener(new AnonymousActionListener1(this)); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 4; gridBagConstraints.weighty = 0; gridBagConstraints.insets = new Insets(5, 5, 5, 5); gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH; choosePanel.Add(cancelButton, gridBagConstraints); exitButton.SetText("Exit"); exitButton.AddActionListener(new AnonymousActionListener2(this)); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST; choosePanel.Add(exitButton, gridBagConstraints); okButton.SetText("OK"); okButton.AddActionListener(new AnonymousActionListener3(this)); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST; choosePanel.Add(okButton, gridBagConstraints); Jake2Canvas c = new Jake2Canvas(); GetContentPane().Add(c, BorderLayout.CENTER); statusPanel.SetLayout(new GridBagLayout()); statusPanel.SetMaximumSize(new Dimension(400, 100)); statusPanel.SetMinimumSize(new Dimension(400, 100)); statusPanel.SetPreferredSize(new Dimension(400, 100)); gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new Insets(10, 10, 10, 10); gridBagConstraints.weightx = 1; statusPanel.Add(status, gridBagConstraints); GetContentPane().Add(statusPanel, java.awt.BorderLayout.SOUTH); progressPanel = new ProgressPanel(this); installPanel = new InstallPanel(this); notFoundPanel = new NotFoundPanel(this); Pack(); }
/// <summary> /// Creates the waiting box. /// </summary> private void CreateWaitingBox() { if (!this._IsWaitingBoxCreated) { #region CreateWaitingBox this.waitingBox = new System.Windows.Forms.Panel(); //ControlHelper.BindMouseMoveEvent(this.waitingBox); waitingBox.BackColor = Color.WhiteSmoke; if (!Control.Contains(waitingBox)) { _Loading = new ProgressPanel(); //_Loading.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple; _Loading.Appearance.BackColor = System.Drawing.Color.FromArgb(60, Color.WhiteSmoke); _Loading.Appearance.Font = new System.Drawing.Font("Tahoma", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); _Loading.Appearance.ForeColor = System.Drawing.Color.Black; _Loading.Appearance.Options.UseBackColor = true; _Loading.Appearance.Options.UseFont = true; _Loading.Appearance.Options.UseForeColor = true; _Loading.AppearanceCaption.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); _Loading.AppearanceCaption.Options.UseFont = true; _Loading.AppearanceDescription.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); _Loading.AppearanceDescription.Options.UseFont = true; _Loading.Size = new System.Drawing.Size(223, 53); _Loading.Caption = _text; _Loading.Description = ""; //_Loading.Dock = System.Windows.Forms.DockStyle.Fill; _Loading.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); _Loading.Name = "progressPanel1"; _Loading.Padding = new System.Windows.Forms.Padding(38, 0, 0, 0); //_Loading.Size = new System.Drawing.Size(223, 53); //_Loading.Location = new Point((Control.Width - _Loading.Width) / 2, (Control.Height - _Loading.Height) / 2);//居中 _Loading.Dock = DockStyle.Top; _Loading.LookAndFeel.SkinName = "Visual Studio 2013 Light"; _Loading.LookAndFeel.UseDefaultLookAndFeel = false; _Loading.TabIndex = 0; _Loading.Text = "progressPanel1"; pe = new PanelEx(); pe.Size = new System.Drawing.Size(223, 75); pe.Location = new Point((Control.Width - _Loading.Width) / 2, (Control.Height - _Loading.Height) / 2);//居中 pe.BorderColor = Color.LightGray; pe.Controls.Add(_Loading); waitingBox.Controls.Add(pe); Control.Controls.Add(waitingBox); //取消按钮 buttonControl = new Xr.Common.Controls.ButtonControl(); buttonControl.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(245)))), ((int)(((byte)(245))))); buttonControl.Dock = DockStyle.None; buttonControl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(42)))), ((int)(((byte)(131)))), ((int)(((byte)(113))))); buttonControl.HoverBackColor = System.Drawing.Color.Empty; buttonControl.Location = new Point((pe.Width - buttonControl.Width) / 2 + 10, _Loading.Height);//居中 buttonControl.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); buttonControl.Size = new System.Drawing.Size(50, 20); buttonControl.Style = Xr.Common.Controls.ButtonStyle.Return; buttonControl.TabIndex = 90; buttonControl.TabStop = false; buttonControl.Text = "取消"; buttonControl.Click += new System.EventHandler(this.button_Click); pe.Controls.Add(buttonControl); } waitingBox.Show(); this._IsWaitingBoxCreated = true; #endregion } _Loading.Caption = _text; if (IsShowCancelBtn) { if (buttonControl != null) { buttonControl.Visible = true; pe.Size = new System.Drawing.Size(223, 75); } } else { if (buttonControl != null) { buttonControl.Visible = false; pe.Size = new System.Drawing.Size(223, 52); } } if (status == false) { Rectangle rect = Control.DisplayRectangle; if (rectDisplay == new Rectangle()) { rect = Control.DisplayRectangle; } else { rect = rectDisplay; pe.Location = new Point((rect.Width - _Loading.Width) / 2, (rect.Height - _Loading.Height) / 2); //居中 buttonControl.Location = new Point((pe.Width - buttonControl.Width) / 2 + 10, _Loading.Height); //居中 } waitingBox.Width = rect.Width; waitingBox.Height = rect.Height; waitingBox.Location = new Point(rect.X, rect.Y); if (IsShowtransparencyBG) { waitingBox.BackgroundImage = this.CreateBacgroundImage(); //waitingBox.BackgroundImage = Properties.Resources.logo_mini; waitingBox.BackgroundImageLayout = ImageLayout.Stretch; } if (_alpha != 0f) { waitingBox.BackgroundImage = this.CreateBacgroundImage(); //waitingBox.BackgroundImage = Properties.Resources.logo_mini; waitingBox.BackgroundImageLayout = ImageLayout.Stretch; } } waitingBox.Visible = true; waitingBox.BringToFront(); waitingBox.Focus(); status = true; }
private void InitializeComponent() { this.progressPanel1 = new ProgressPanel(); this.tableLayoutPanel1 = new TableLayoutPanel(); this.tableLayoutPanel1.SuspendLayout(); base.SuspendLayout(); this.progressPanel1.Appearance.BackColor = Color.Transparent; this.progressPanel1.Appearance.Options.UseBackColor = true; this.progressPanel1.AppearanceCaption.Font = new Font("Microsoft Sans Serif", 12f); this.progressPanel1.AppearanceCaption.Options.UseFont = true; this.progressPanel1.AppearanceDescription.Font = new Font("Microsoft Sans Serif", 8.25f); this.progressPanel1.AppearanceDescription.Options.UseFont = true; this.progressPanel1.Caption = "正在连接服务器,请等待。"; this.progressPanel1.Description = "连接中 ..."; this.progressPanel1.Dock = DockStyle.Fill; this.progressPanel1.ImageHorzOffset = 20; this.progressPanel1.Location = new Point(0, 316); this.progressPanel1.Margin = new Padding(0, 3, 0, 3); this.progressPanel1.Name = "progressPanel1"; this.progressPanel1.Size = new Size(261, 38); this.progressPanel1.TabIndex = 0; this.progressPanel1.Text = "progressPanel1"; this.tableLayoutPanel1.AutoSize = true; this.tableLayoutPanel1.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.tableLayoutPanel1.BackColor = SystemColors.Control; this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f)); this.tableLayoutPanel1.Controls.Add(this.progressPanel1, 0, 15); this.tableLayoutPanel1.Dock = DockStyle.Fill; this.tableLayoutPanel1.Location = new Point(0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Padding = new Padding(0, 13, 0, 13); this.tableLayoutPanel1.RowCount = 16; this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100f)); this.tableLayoutPanel1.Size = new Size(261, 370); this.tableLayoutPanel1.TabIndex = 1; base.AutoScaleDimensions = new SizeF(6f, 12f); base.AutoScaleMode = AutoScaleMode.Font; this.AutoSize = true; base.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.BackColor = SystemColors.Control; base.ClientSize = new Size(261, 370); base.Controls.Add(this.tableLayoutPanel1); base.HelpButton = true; base.Name = "FrmWait"; base.Opacity = 0.2; base.ShowOnTopMode = ShowFormOnTopMode.ObsoleteAboveParent; base.StartPosition = FormStartPosition.WindowsDefaultLocation; this.Text = "Form1"; base.TransparencyKey = SystemColors.Control; this.tableLayoutPanel1.ResumeLayout(false); base.ResumeLayout(false); base.PerformLayout(); }
private void FiltersList_SelectedIndexChanged(object sender, EventArgs e) { int selectedIndex = FiltersList.SelectedIndex; if (selectedIndex == 0) { if (File.Exists(_srcPath)) { InputImage.Load(_srcPath); _currentlySelectedTmpFilePath = _srcPath; _currentlySelectedFilterEnum = null; } } else { selectedIndex = selectedIndex - 1; FilterEnum filterEnum = (FilterEnum)selectedIndex; string tmpFilteredImgPath = _tmpImgFilePathPattern + "_" + filterEnum.ToString() + Path.GetExtension(_srcPath); if (File.Exists(tmpFilteredImgPath)) { InputImage.Load(tmpFilteredImgPath); _currentlySelectedFilterEnum = filterEnum; _currentlySelectedTmpFilePath = tmpFilteredImgPath; } else { if (File.Exists(_srcPath)) { ProgressPanel.Location = new Point(Width / 2 - (ProgressPanel.Width / 2), (Height / 2) - (ProgressPanel.Height / 2)); ProgressPanel.Visible = true; ProgressPanel.BringToFront(); Enabled = false; try { string result; switch (filterEnum) { case FilterEnum.Nashville: result = ApplyNashville(_srcPath, tmpFilteredImgPath); break; case FilterEnum.Clarendon: result = ApplyClarendon(_srcPath, tmpFilteredImgPath); break; case FilterEnum.Moon: result = ApplyMoon(_srcPath, tmpFilteredImgPath); break; case FilterEnum.Toaster: result = ApplyToaster(_srcPath, tmpFilteredImgPath); break; case FilterEnum.XPro2: result = ApplyXPro2(_srcPath, tmpFilteredImgPath); break; default: throw new ArgumentOutOfRangeException(); } if (string.IsNullOrEmpty(result)) { if (File.Exists(tmpFilteredImgPath)) { _tmpFilesToClear.Add(tmpFilteredImgPath); InputImage.Load(tmpFilteredImgPath); _currentlySelectedTmpFilePath = tmpFilteredImgPath; _currentlySelectedFilterEnum = filterEnum; } } else { MessageBox.Show(result, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } finally { ProgressPanel.Visible = false; Enabled = true; } } else { MessageBox.Show("Can't find input file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }