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


C# MessageDialog.Show方法代码示例

本文整理汇总了C#中Gtk.MessageDialog.Show方法的典型用法代码示例。如果您正苦于以下问题:C# MessageDialog.Show方法的具体用法?C# MessageDialog.Show怎么用?C# MessageDialog.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.MessageDialog的用法示例。


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

示例1: OnEnviarClicked

        protected void OnEnviarClicked(object sender, EventArgs e)
        {
            try{
                MailMessage mail = new MailMessage();
                SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
                mail.From = new MailAddress("[email protected]");
                mail.To.Add(Para.Text);
                mail.Subject =  Asunto.Text;
                mail.Body = Body.Text;
                SmtpServer.Port = 587;
                SmtpServer.Credentials = new System.Net.NetworkCredential("dgarciaverdin", "abcjpr_f4e");
                SmtpServer.EnableSsl = true;
                ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
                SmtpServer.Send(mail);

                MessageDialog md = new MessageDialog (null,
                    DialogFlags.Modal,
                    MessageType.Info,
                    ButtonsType.None, "Mail enviado correctamente");
                md.Show();
                this.padre.tabla();

            }
            catch(Exception Msg){

                MessageDialog md = new MessageDialog (null,
                    DialogFlags.Modal,
                    MessageType.Error,
                    ButtonsType.None, "Ouch"+ Msg.ToString() );
                md.Show();
            }
        }
开发者ID:ricardointeractive,项目名称:ProyectoBD,代码行数:32,代码来源:mailForm.cs

示例2: ShowErrorWindow

 public static void ShowErrorWindow( string errorMessage, Window parentWindow=null )
 {
     var dialog = new MessageDialog(
         parentWindow,
         DialogFlags.Modal,
         MessageType.Error,
         ButtonsType.Ok,
         errorMessage
     );
     dialog.WindowPosition = WindowPosition.Center;
     dialog.Show();
     dialog.Run();
     dialog.Hide();
 }
开发者ID:RamiLego4Game,项目名称:PlatformerWorld-Launcher,代码行数:14,代码来源:GTKInterface.cs

示例3: Show

        public static MessageDialog Show(Window parent_window, string msg, MessageType messageType, Boolean showModal)
        {
            MessageDialog md = new MessageDialog (parent_window, DialogFlags.Modal, messageType, ButtonsType.Ok, msg);
            if (showModal)
			{
	            md.Run ();
			}
			else
			{
	            md.Show ();
			}
			
			return md;
        }
开发者ID:pipermatt,项目名称:blinkstick-client,代码行数:14,代码来源:MessageBox.cs

示例4: NotAdminErrorAndExit

 private static void NotAdminErrorAndExit(bool isMicro)
 {
     MessageDialog md = new MessageDialog (null, DialogFlags.DestroyWithParent,
         MessageType.Error,
         ButtonsType.Close,
         String.Format (
             "Для работы текущей версии программы необходимо провести{0} обновление базы, " +
             "но у вас нет для этого прав. Зайдите в программу под администратором.",
             isMicro ? " микро" : ""
         ));
     md.Show ();
     md.Run ();
     md.Destroy ();
     Environment.Exit(1);
 }
开发者ID:QualitySolution,项目名称:QSProjects,代码行数:15,代码来源:DBUpdater.cs

示例5: Info

 public static void Info(string msg)
 {
     GLib.Idle.Add (new GLib.IdleHandler (delegate() {
         MessageDialog md = new MessageDialog(null, DialogFlags.DestroyWithParent,
             MessageType.Info, ButtonsType.Ok, msg);
         md.DeleteEvent += delegate(object o, DeleteEventArgs args) {
             md.Destroy();
         };
         md.Response += delegate(object o, ResponseArgs args) {
             md.Hide();
             md.Destroy();
         };
         md.Show ();
         return false;
     }));
 }
开发者ID:niwakazoider,项目名称:unicast,代码行数:16,代码来源:Dialog.cs

示例6: ShowConfirmationDialog

		public static void ShowConfirmationDialog (string title, string text, string icon_name, System.Action action)
		{
			MessageDialog md = new MessageDialog (null, 0, MessageType.Question, ButtonsType.None, text);
			
			md.Title = title;
			md.Image = Image.NewFromIconName (icon_name, Gtk.IconSize.Dialog);
			md.Image.Visible = true;
			md.Image.Show ();
			
			md.AddButton (Stock.Cancel, ResponseType.Cancel);
			md.AddButton (title, ResponseType.Ok);
			md.DefaultResponse = ResponseType.Ok;
			
			md.Response += (o, args) => { 
				if (args.ResponseId == ResponseType.Ok)
					action.Invoke ();
				md.Destroy ();
			};
			
			md.Show ();
		}
开发者ID:Aurora-and-Equinox,项目名称:docky,代码行数:21,代码来源:SessionManagerActionItem.cs

示例7: OnStopbuttonClicked

        protected virtual void OnStopbuttonClicked(object sender, System.EventArgs e)
        {
            int res;

            if(capturer == null)
                return;

            MessageDialog md = new MessageDialog((Gtk.Window)this.Toplevel, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo,
                                                 Catalog.GetString("You are going to stop and finish the current capture."+"\n"+
                                                                 "Do you want to proceed?"));
            res = md.Run();
            md.Destroy();
            if(res == (int)ResponseType.Yes) {
                md = new MessageDialog((Gtk.Window)this.Toplevel, DialogFlags.Modal, MessageType.Info, ButtonsType.None,
                                       Catalog.GetString("Finalizing file. This can take a while"));
                md.Show();
                Stop();
                md.Destroy();
                recbutton.Visible = true;
                pausebutton.Visible = false;
                stopbutton.Visible = false;
                if(CaptureFinished != null)
                    CaptureFinished(this, new EventArgs());
            }
        }
开发者ID:dineshkummarc,项目名称:longomatch,代码行数:25,代码来源:CapturerBin.cs

示例8: validaciones

        private void validaciones()
        {
            try{

            }catch(Exception e){
                MessageDialog md = new MessageDialog (
                    null,
                    DialogFlags.Modal,
                    MessageType.Error,
                    ButtonsType.None, "Ocurrio un error: " + e.Message
                );
                md.Show();
            }
        }
开发者ID:ricardointeractive,项目名称:ProyectoBD,代码行数:14,代码来源:NuevoForm.cs

示例9: SetLabel

		void SetLabel ()
		{
			Gtk.MessageDialog md = new Gtk.MessageDialog (null, 
					  0,
					  Gtk.MessageType.Question, 
					  Gtk.ButtonsType.None,
					  "<b>" + Catalog.GetString ("Set the timer's label to:") + "</b>");
			md.Title = "Docky Timer";
			md.Icon = DockServices.Drawing.LoadIcon ("docky", 22);
			md.Modal = false;
			
			md.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
			md.AddButton (Catalog.GetString ("_Set Label"), Gtk.ResponseType.Ok);
			md.DefaultResponse = Gtk.ResponseType.Ok;
			
			Gtk.Entry labelEntry = new Gtk.Entry ("" + label);
			labelEntry.Activated += delegate {
				Label = labelEntry.Text;
				md.Destroy ();
			};
			labelEntry.Show ();
			md.VBox.PackEnd (labelEntry);

			md.Response += (o, args) => {
				if (args.ResponseId != Gtk.ResponseType.Cancel)
					Label = labelEntry.Text;
				md.Destroy ();
			};
			
			md.Show ();
		}
开发者ID:Aurora-and-Equinox,项目名称:docky,代码行数:31,代码来源:TimerDockItem.cs

示例10: LaunchError

		protected void LaunchError (string format, params string[] args)
		{
			string message = String.Format (format, args);
			MessageDialog dlg = new MessageDialog (null,
							       0,
							       MessageType.Error,
							       ButtonsType.Ok,
							       message);
			
			dlg.Response += OnErrorDialogResponse;
			dlg.Show ();

		}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:13,代码来源:Tile.cs

示例11: insertarNuevo

        private void insertarNuevo()
        {
            if (!this.validarNoVacio ()) {

                MessageDialog md = new MessageDialog (
                    null,
                    DialogFlags.Modal,
                    MessageType.Error,
                    ButtonsType.None, "Ocurrio un error: " + "Campos vacios"
                );
                md.Show ();
            } else {
                AccionesDeRegistros acciones = new AccionesDeRegistros ();
                Registros Persona = new Registros ();

                Persona.apellidoP = txtApellidoP.Text;
                Persona.apellidoM = txtApellidoM.Text;
                Persona.nombre = txtNombre.Text;
                Persona.domicilio = txtDomicilio.Text;
                Persona.cp = txtCp.Text;
                Persona.municipio = txtMun.Text;
                Persona.estado = txtEst.Text;
                Persona.pais = txtPais.ActiveText.ToString ();
                Persona.mapa = txtMail.Text;
                Persona.telefono = txtTel1.Text;
                Persona.celular = txtCelular.Text;
                Persona.radio = txtRadio.Text;
                Persona.observaciones = txtObs.Text;

                if (acciones.insertarRegistroNuevo (Persona, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))) {
                    MessageDialog md = new MessageDialog (null,
                        DialogFlags.Modal,
                        MessageType.Info,
                        ButtonsType.None, "Acción realizada con exito.");
                    md.Show ();
                    this.txtNombre.Text = "";
                    this.txtApellidoM.Text = "";
                    this.txtApellidoP.Text = "";
                    this.txtDomicilio.Text = "";
                    this.txtCp.Text = "";
                    this.txtMail.Text = "";
                    this.txtMun.Text= "";
                    this.txtEst.Text = "";
                    this.txtTel1.Text= "";
                    this.txtCelular.Text= "";
                    this.txtRadio.Text= "";
                    this.txtObs.Text= "";

                    this.padre.tabla ();
                } else {
                    MessageDialog md = new MessageDialog (
                        null,
                        DialogFlags.Modal,
                        MessageType.Error,
                        ButtonsType.None, "Ocurrio un error: "
                    );
                    md.Show ();

                }
            }
        }
开发者ID:ricardointeractive,项目名称:ProyectoBD,代码行数:61,代码来源:NuevoForm.cs

示例12: PrintTicket

 private void PrintTicket(int id)
 {
     MessageDialog WinAsk = new MessageDialog(this, DialogFlags.Modal, MessageType.Question,
                                              ButtonsType.YesNo, "Распечатать квитанцию?");
     WinAsk.Show ();
     if((ResponseType) WinAsk.Run () == ResponseType.Yes)
     {
         string param = "id=" + id.ToString ();
         ViewReportExt.Run ("PaymentTicket", param);
     }
     WinAsk.Destroy ();
 }
开发者ID:QualitySolution,项目名称:Bazar,代码行数:12,代码来源:PayAccrual.cs

示例13: on_generateButton_clicked

    private void on_generateButton_clicked(object o, EventArgs e)
    {
        try {
            if (Directory.Exists(outputDirectoryEntry.Text) == false) {
                Gtk.MessageDialog dialog = new Gtk.MessageDialog(window,
                        Gtk.DialogFlags.Modal, Gtk.MessageType.Question, Gtk.ButtonsType.YesNo,
                        "The specified directory does not exist, would you like it to be created?");

                if (dialog.Run() == (int)Gtk.ResponseType.Yes) {
                    Directory.CreateDirectory(outputDirectoryEntry.Text);
                    dialog.Destroy();
                } else {
                    dialog.Destroy();
                    return;
                }

            }

            DirectoryInfo dir = new DirectoryInfo(outputDirectoryEntry.Text);
            if (dir.GetFiles().Length > 0) {

                Gtk.MessageDialog dialog = new Gtk.MessageDialog(window,
                        Gtk.DialogFlags.Modal, Gtk.MessageType.Question, Gtk.ButtonsType.YesNo,
                           	"The specified directory is not empty, any files with the same " +
                        "names as your top-level widgets will be over-written. Do you want to continue?");

                if (dialog.Run() != (int)Gtk.ResponseType.Yes) {
                    dialog.Destroy();
                    return;
                 } else {
                    dialog.Destroy();
                 }
            }

            if (languageComboBox.Active == 0)
                codegen.GenerateCode(Language.CSharp, outputDirectoryEntry.Text);
            else if (languageComboBox.Active == 1)
                codegen.GenerateCode(Language.VisualBasic, outputDirectoryEntry.Text);
            else if (languageComboBox.Active == 2)
                codegen.GenerateCode(Language.Boo, outputDirectoryEntry.Text);
            else if (languageComboBox.Active == 3)
                codegen.GenerateCode(Language.Nemerle, outputDirectoryEntry.Text);
            else
                throw new Exception ("What is " + languageComboBox.Active + "??");

            Gtk.MessageDialog msg = new Gtk.MessageDialog(window, Gtk.DialogFlags.Modal,
                       Gtk.MessageType.Info, Gtk.ButtonsType.Ok,
                       "Code generation completed!!");
            msg.Show();
            msg.Run();
            msg.Destroy();

            //TODO: This sucks!
            System.Diagnostics.Process.Start("gnome-open", outputDirectoryEntry.Text);

        } catch (Exception ex) {
            Console.WriteLine(ex);
            Gtk.MessageDialog errordialog = new Gtk.MessageDialog(window,
                    Gtk.DialogFlags.Modal,
                    Gtk.MessageType.Error,
                    Gtk.ButtonsType.Ok,
                    ex.Message);

            errordialog.Run();
            errordialog.Destroy();
        }
    }
开发者ID:codebutler,项目名称:glade-sharp-code-generator,代码行数:67,代码来源:GtkGladeCodeGenerator.cs

示例14: on_contact_key_press

 public void on_contact_key_press(object o, KeyPressEventArgs args)
 {
     switch(args.Event.HardwareKeycode)
        {
     case 22:
     case 107:
      {
       TreeSelection tSelect = ContactTreeView.Selection;
       if(tSelect.CountSelectedRows() > 0)
       {
        MessageDialog dialog = new MessageDialog(CBApp,
      DialogFlags.Modal |
        DialogFlags.DestroyWithParent,
      MessageType.Question,
      ButtonsType.YesNo,
      "Do you want to delete the selected Contacts?");
        dialog.Response += new ResponseHandler(
      DeleteContactResponse);
        dialog.Title = "Delete Contacts";
        dialog.Show();
       }
       break;
      }
        }
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:25,代码来源:ContactBrowser.cs

示例15: validaciones

        private void validaciones()
        {
            try{

                if(!this.validarNoVacio()){
                    throw new Exception("Uno de los campos esta vacio.");
                }

                if(!this.validarTamano()){
                    throw new Exception("La longitd de los datos no es valida.");
                }

            }catch(Exception e){
                MessageDialog md = new MessageDialog (
                    null,
                    DialogFlags.Modal,
                    MessageType.Error,
                    ButtonsType.None, "Ocurrio un error: " + e.Message
                );
                md.Show();
            }
        }
开发者ID:ricardointeractive,项目名称:ProyectoBD,代码行数:22,代码来源:Editar.cs


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