当前位置: 首页>>代码示例>>C#>>正文


C# DialogResult类代码示例

本文整理汇总了C#中DialogResult的典型用法代码示例。如果您正苦于以下问题:C# DialogResult类的具体用法?C# DialogResult怎么用?C# DialogResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DialogResult类属于命名空间,在下文中一共展示了DialogResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BtnSave_Click

        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(textBox.Text))
            {
                DialogResult dr = new DialogResult();
                ConfirmDialogView confirm = new ConfirmDialogView();
                confirm.getLabelConfirm().Text = "Weet u zeker dat u de naam van de vragenlijst wilt wijzigen?";
                dr = confirm.ShowDialog();

                if (dr == DialogResult.Yes)
                {
                    Model.QuestionList questionList = new Model.QuestionList();
                    questionList.Id = QuestionListId;
                    questionList.Name = textBox.Text;
                    Controller.UpdateQuestionList(questionList);

                    this.QuestionListNameChanged = true;
                    confirm.Close();
                }
            }
            else
            {
                MessageBox.Show("U heeft niks ingevuld, vul alstublieft de nieuwe naam in");
            }
        }
开发者ID:1337Steven1337,项目名称:KBS2G3,代码行数:25,代码来源:RenameQuestionList.cs

示例2: btnSlipOrReport_Click

 private void btnSlipOrReport_Click(object sender, EventArgs e)
 {
     this.Hide();
     DialogResult dr = new DialogResult();
     SalarySlip ss = new SalarySlip();
     dr = ss.ShowDialog();
 }
开发者ID:shivam01990,项目名称:Human-Resource-Management-System-windows-Application,代码行数:7,代码来源:SearchSalaryDetails.cs

示例3: brisiDioNekretnineButton_Click

        private void brisiDioNekretnineButton_Click(object sender, EventArgs e)
        {
            try
            {
                DAO dao = new DAO("localhost", "ikzavrsni", "root", "root");

                for (int i = 0; i < dijeloviNekretnineListView.Items.Count; i++)
                    if (dijeloviNekretnineListView.Items[i].Selected == true)
                    {
                        foreach (DioNekretnine dn in dijeloviNekretnina)
                            if (dn.Naziv == dijeloviNekretnineListView.Items[i].Text)
                            {
                                DialogResult dr = new DialogResult();
                                dr = MessageBox.Show("Da li ste sigurni da želite izbrisati odabrani dio nekretnine iz baze podataka?", "Upozorenje", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                                if (dr == System.Windows.Forms.DialogResult.Yes)
                                {
                                    dao.IzbrisiDioNekretnine(dn.Sifra);
                                    dijeloviNekretnineListView.Items.Clear();
                                    statusStrip1.BackColor = Color.White;
                                    toolStripStatusLabel1.ForeColor = Color.Green;
                                    toolStripStatusLabel1.Text = "Uspješno izbrisani podaci.";
                                    return;
                                }
                            }
                    }
            }
            catch (Exception)
            {
                statusStrip1.BackColor = Color.White;
                toolStripStatusLabel1.ForeColor = Color.Red;
                toolStripStatusLabel1.Text = "Podaci nisu obrisani!";
            }
        }
开发者ID:ik15151,项目名称:etf-2013-bsc-zr,代码行数:34,代码来源:PregledNekretnina.cs

示例4: DGProduct_UserDeletingRow

        private void DGProduct_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            if (countDeleting == 1)
            {
                dialogResult = MessageBox.Show("Esta seguro que desea eliminar los productos seleccionados?\r\n" + DGProduct.SelectedRows.Count + " productos seran eliminados!", "Eliminar productos", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                countSelectedRows = DGProduct.SelectedRows.Count;
            }

            if (countDeleting == countSelectedRows)
            {
                countDeleting = 1;
                countSelectedRows = 0;
            }
            else
                countDeleting++;

            if (dialogResult == DialogResult.Cancel)
                e.Cancel = true;
            else
            {
                try {
                    int id = Int32.Parse(e.Row.Cells["Id"].Value.ToString());
                    Product prod = stock.Product.First(i => i.id == id);
                    prod.deleted_at = DateTime.Now;
                    stock.SaveChanges();

                }catch(Exception exc)
                {
                    Console.WriteLine(exc);
                }
                finally {
                    e.Cancel = false;
                }
            }
        }
开发者ID:tinchotricolor22,项目名称:Control-de-Stock,代码行数:35,代码来源:FormProduct.cs

示例5: SetInfomation

 public void SetInfomation(DialogResult _result, int _textId, Vector3 _location)
 {
     tranformBtn.gameObject.SetActive(true);
     result = _result;
     //text.text = AvLocalizationManager.GetString(_textId);
     tranformBtn.localPosition = _location;
 }
开发者ID:BGCX262,项目名称:zzzstrawhatzzz-svn-to-git,代码行数:7,代码来源:GUIMessageDialog.cs

示例6: SendDialogManagerMessage

    public const string DIALOG_RESULT = "DialogResult"; // Type: DialogResult

    public static void SendDialogManagerMessage(Guid dialogHandle, DialogResult result)
    {
      SystemMessage msg = new SystemMessage(MessageType.DialogClosed);
      msg.MessageData[DIALOG_HANDLE] = dialogHandle;
      msg.MessageData[DIALOG_RESULT] = result;
      ServiceRegistration.Get<IMessageBroker>().Send(CHANNEL, msg);
    }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:9,代码来源:DialogManagerMessaging.cs

示例7: CloseThis

				void CloseThis(DialogResult result= System.Windows.Forms.DialogResult.OK)
				{
					if (Loading)
						return;
					this.DialogResult = result;
					this.Close();
				}
开发者ID:robotsrulz,项目名称:Sardauscan,代码行数:7,代码来源:GLViewerConfigForm.cs

示例8: CreatePerson

 public void CreatePerson(Packet templatePacket = null)
 {
     FormMode = Mode.Create;
     saveDialogResult = DialogResult.None;
     btnClose.Visible = true;
     _templatePacket = templatePacket;
 }
开发者ID:AndyLem,项目名称:VisaCzech,代码行数:7,代码来源:PersonForm.cs

示例9: AddAction

    public void AddAction(string text, DialogResult result, Image image = null, bool isDefault = false)
    {
      int width = this.ClientSize.Width-20;
      var button = new SimpleButton();
      button.Text = text;
      button.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
      button.Image = image;
      button.Width = width;
      button.Left = 10;
      button.Height = ButtonHeight;
      button.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
      button.Tag = result;
      button.Click += button_Click;
      
      this.Controls.Add(button);

      if (isDefault)
        this.AcceptButton = button;

      button.DialogResult = result;
      if (result == DialogResult.Cancel)
      {
        this.CancelButton = button;
        this.ControlBox = true;
        this.SelectedAction = result;
      }
    }
开发者ID:CIHANGIRCAN,项目名称:ChanSort,代码行数:27,代码来源:ActionBox.cs

示例10: HandleResult

        /// <summary>
        /// <para>If DPAPI settings change, this saves the key algorithm out with the new settings.</para>
        /// </summary>
        /// <param name="dialogResult">
        /// <para>One of the <see cref="DialogResult"/> values.</para>
        /// </param>
        /// <param name="originalSettings">
        /// <para>The original <see cref="DpapiSettings"/> before editing.</para>
        /// </param>
        /// <param name="newSettingsData">
        /// <para>The new <see cref="DpapiSettingsData"/> from the editor.</para>
        /// </param>
        /// <returns>
        /// <para>If accepted, the new <see cref="DpapiSettings"/>; otherwise the <paramref name="originalSettings"/>.</para>
        /// </returns>
        protected override object HandleResult(DialogResult dialogResult, DpapiSettings originalSettings, DpapiSettingsData newSettingsData)
        {
            bool returnBaseResult = true;

            if (dialogResult == DialogResult.OK)
            {
                DpapiSettings newDpapiSettings = null;
                if (newSettingsData != null)
                {
                    newDpapiSettings = new DpapiSettings(newSettingsData);
                }

                if (newDpapiSettings != originalSettings)
                {
                    returnBaseResult = SaveKeyAlgorithmPairWithNewDapiSettings(newDpapiSettings, originalSettings);
                }
            }

            if (returnBaseResult)
            {
                return base.HandleResult(dialogResult, originalSettings, newSettingsData);
            }
            else
            {
                return originalSettings;
            }
        }
开发者ID:bnantz,项目名称:NCS-V1-1,代码行数:42,代码来源:FileKeyAlgorithmDpapiSettingsEditor.cs

示例11: ShowInputDialog

 /// <summary>
 /// Ввод значения из модального диалога
 /// </summary>
 /// <param name="caption">заголовок окна диалога</param>
 /// <param name="label">надпись в окне слева от поля ввода</param>
 /// <param name="enableCancel">видимость кнопки "Отмена"</param>
 /// <param name="inputText">начальное значение</param>
 /// <param name="rst">DialogResult.OK - нажата кнопка "Принять", DialogResult.Cancel - нажата кнопка "Отмена"</param>
 /// <returns></returns>
 public static string ShowInputDialog(string caption, string label,
     bool enableCancel, string inputText, out DialogResult rst)
 {
     var dlg = new SimpleDialog(caption, label, enableCancel, inputText);
     rst = dlg.ShowDialog();
     return dlg.InputValue;
 }
开发者ID:johnmensen,项目名称:TradeSharp,代码行数:16,代码来源:Dialogs.cs

示例12: btnAddProfile_Click

        private void btnAddProfile_Click(object sender, EventArgs e)
        {
            // Make sure the email is valid
            if (SGGlobals.IsEmailValid(txtDefaultAddress.Text) == false)
            {
                MessageBox.Show("Email address does not appear to be valid!", "Error creating profile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            // Make sure the profile doesn't exist
            try
            {
                UserProfiles.GetProfileByName(txtProfileName.Text);

                // Profile exists!
                MessageBox.Show("Profile name already exists!", "Error creating profile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            catch (ProfileNotFoundException)
            {
                // Profile does not exist, create it
                Profile objNewProfile = new Profile();
                objNewProfile.Name = txtProfileName.Text;
                objNewProfile.ToAddresses.Add(txtDefaultAddress.Text);
                objNewProfile.Save();
                this._objDialogStatus = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("An unknown error occured creating the new profile:"
                    + Environment.NewLine + ex.Message, "Error creating profile", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
开发者ID:s0lt4r,项目名称:spamgrabber,代码行数:34,代码来源:frmNewProfile.cs

示例13: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     SaveFileDialog sfd = new SaveFileDialog();
        sfd.AddExtension = true;
        sfd.DefaultExt = ".h";
        sfd.FileName = "os_cfg";
        DialogResult dr = new DialogResult();
        dr=sfd.ShowDialog();
        if (dr == DialogResult.OK)
        {
         String directory = @sfd.FileName;
         String text = textBox1.Text;
         if (File.Exists(directory))
         {
             StreamWriter swWriter = new StreamWriter(directory);
             swWriter.WriteLine(text);
             swWriter.Flush();
             swWriter.Close();
         }
         else
         {
             FileStream fs = File.Create(directory);
             fs.Flush();
             fs.Close();
             StreamWriter swWriter = new StreamWriter(directory);
             swWriter.WriteLine(text);
             swWriter.Flush();
             swWriter.Close();
         }
        }
 }
开发者ID:ZhanNeo,项目名称:test,代码行数:31,代码来源:Form1.cs

示例14: SettingsDlg_FormClosing

        private void SettingsDlg_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (uidBox.Focused && uidBox.Text != HatHConfig.UserID)
            {
                HatHConfig.UserID = uidBox.Text;
                exitWith = DialogResult.OK;
            }

            if (passBox.Focused && passBox.Text != HatHConfig.PassHash)
            {
                HatHConfig.PassHash = passBox.Text;
                exitWith = DialogResult.OK;
            }

            if (hathrootBox.Focused && hathrootBox.Text != HatHConfig.HatHRoot)
            {
                HatHConfig.HatHRoot = hathrootBox.Text;
                exitWith = DialogResult.OK;
            }

            if (outdirBox.Focused && outdirBox.Text != HatHConfig.OutputDirectory)
            {
                HatHConfig.OutputDirectory = outdirBox.Text;
                exitWith = DialogResult.OK;
            }

            DialogResult = exitWith;
        }
开发者ID:p1nkc0de,项目名称:hathCacheRipper,代码行数:28,代码来源:SettingsDlg.cs

示例15: OnRunStarted

        /// <summary>
        /// Runs custom wizard logic at the beginning of a template wizard run.
        /// </summary>
        protected override void OnRunStarted()
        {
            TraceService.WriteLine("WebRequestServiceWizard::OnRunStarted");

            WebRequestServiceView view = new WebRequestServiceView();
            view.ShowDialog();

            this.dialogResult = view.DialogResult;

            if (this.dialogResult == DialogResult.OK)
            {
                this.entityName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(view.EntityName);

                this.ReplacementsDictionary.Add("$webRequestEntityName$", this.entityName);

                this.AddGlobal("MockWebRequestService", "mock" + this.entityName + "WebRequestService");
                this.AddGlobal("InterfaceWebRequest", "I" + this.entityName + "WebRequestService");
                this.AddGlobal("webRequestInstance", this.entityName.LowerCaseFirstCharacter() + "WebRequestService");
                this.AddGlobal("WebRequestService", this.entityName + "WebRequestService");

                this.AddGlobal("SampleWebRequestService", this.entityName + "WebRequestService");

                this.AddGlobal("SampleWebRequestData", this.entityName);
                this.AddGlobal("WebRequestSampleData", this.entityName);

                this.AddGlobal("SampleWebRequestDataInstance", this.entityName.LowerCaseFirstCharacter());
                this.AddGlobal("SampleWebRequestTranslator", this.entityName + "Translator");
            }
        }
开发者ID:rmarinho,项目名称:NinjaCoderForMvvmCross,代码行数:32,代码来源:WebRequestServiceWizard.cs


注:本文中的DialogResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。