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


C# Dialog类代码示例

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


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

示例1: Main

    public static void Main(string[] args)
    {
        Application app = new Application(null, null);
        app.setMargin(new Margin(10));
        app.setLayout(new VBoxLayout());

        Dialog dialog1 = new Dialog("Dialog 1", Dialog.ButtonOption.NoButtonOption);
        ToolButton button1 = new ToolButton("Show dialog 1");
        button1.connectClick(new DelegateNotify(dialog1.execute));
        app.addWidget(button1);

        Dialog dialog2 = new Dialog("Dialog 2", Dialog.ButtonOption.CancelButtonOption);
        ToolButton button2 = new ToolButton("Show dialog 2");
        button2.connectClick(new DelegateNotify(dialog2.execute));
        app.addWidget(button2);

        Dialog dialog3 = new Dialog("Dialog 3", Dialog.ButtonOption.OKCancelButtonOption);
        ToolButton button3 = new ToolButton("Show dialog 3");
        button3.connectClick(new DelegateNotify(dialog3.execute));
        app.addWidget(button3);

        Dialog dialog4 = new Dialog("Dialog 4", Dialog.ButtonOption.YesNoCancelButtonOption);
        ToolButton button4 = new ToolButton("Show dialog 4");
        button4.connectClick(new DelegateNotify(dialog4.execute));
        app.addWidget(button4);

        app.exec();
    }
开发者ID:91yuan,项目名称:ilixi,代码行数:28,代码来源:Dialogs.cs

示例2: OnPointerClick

    public void OnPointerClick(PointerEventData eventData)
    {
        if (slices > 0)
        {
            slices--;
            eatSound.Play();
            Status food = GameStateManagerScript.Instance.GetStatus(StatusType.Food);

            GameStateManagerScript.Instance.Eat(Random.Range(40, 61));
            updateTooltip();
        }
        else
        {
            Dialog dialog = new Dialog();
            dialog.dialogText = "You have no more pizza.";
            DialogOption option = new DialogOption();
            option.optionText = "Ok";
            option.optionId = "ok";
            dialog.dialogOptions.Add(option);
            if (GameStateManagerScript.Instance.GetStatus(StatusType.Money).points >= 20)
            {
                option = new DialogOption();
                option.optionText = "Order more";
                option.optionId = "order";
                option.tooltipText = "-20$";
                dialog.dialogOptions.Add(option);
            }            
            DialogManagerScript.Instance.ShowDialog(dialog, optionChosen);
        }
    }
开发者ID:Absor,项目名称:RoadTo5k,代码行数:30,代码来源:PizzaScript.cs

示例3: BattleGUI

            internal BattleGUI(ScreenConstants screen, GUIManager manager, 
            Dialog messageFrame, MessageBox messageBox, 
            IMenuWidget<MainMenuEntries> mainWidget, 
            IMenuWidget<Move> moveWidget, IMenuWidget<Pokemon> pokemonWidget, 
            IMenuWidget<Item> itemWidget, IBattleStateService battleState, 
            BattleData data)
        {
            this.battleState = battleState;
            playerId = data.PlayerId;
            ai = data.Clients.First(id => !id.IsPlayer);
            this.moveWidget = moveWidget;
            this.itemWidget = itemWidget;
            this.mainWidget = mainWidget;
            this.pokemonWidget = pokemonWidget;

            this.messageBox = messageBox;
            this.messageFrame = messageFrame;

            InitMessageBox(screen, manager);

            InitMainMenu(screen, manager);
            InitAttackMenu(screen, manager);
            InitItemMenu(screen, manager);
            InitPKMNMenu(screen, manager);

        }
开发者ID:Nexus87,项目名称:PokeClone,代码行数:26,代码来源:BattleGUI.cs

示例4: Agregar

 void Agregar( object o, EventArgs args )
 {
     // crear dialogo
     Dialog dialog = new Dialog ("Agregar", window, Gtk.DialogFlags.DestroyWithParent);
     dialog.Modal = true;
     dialog.AddButton ("Aceptar", ResponseType.Ok);
     dialog.AddButton ("Cerrar", ResponseType.Close);
     Label lab = new Label("Información que desea agregar:");
     lab.Show();
     dialog.VBox.PackStart (lab , true, true, 5 );
     Table table = new Table (2, 2, false);
     Label labNombre = new Label("Nombre:");
     labNombre.Show();
     table.Attach(labNombre , 0, 1, 0, 1);
     entryNombre = new Entry();
     entryNombre.Show();
     table.Attach(entryNombre, 1, 2, 0, 1);
     Label labApe = new Label("Apellidos:");
     labApe.Show();
     table.Attach(labApe , 0, 1, 1, 2);
     entryApe = new Entry();
     entryApe.Show();
     table.Attach(entryApe , 1, 2, 1, 2);
     table.Show();
     dialog.VBox.PackStart (table, true, true, 5 );
     dialog.Response += new ResponseHandler (on_dialog_agregar);
     dialog.Run ();
     dialog.Destroy ();
 }
开发者ID:BackupTheBerlios,项目名称:boxerp-svn,代码行数:29,代码来源:tree.cs

示例5: HandleButtonButtonAction

        static void HandleButtonButtonAction(object sender, TouchEventArgs e)
        {
            //if (e.TouchEvent == TouchEventType.Down)
            {
                var dialog = new Dialog();
                Label label = new Label();
                label.X = 10.0f;
                label.Y = 50.0f;
                label.Text = "Test Dialog";

                Button button = new Button();
                button.Text = "Hidding Dialog...";
                button.TextColor = new UIColor(1.0f, 0.0f, 0.0f, 1.0f);
                button.SetPosition(5.0f, 5.0f);

                button.ButtonAction += (s, ea) =>
                {
                    dialog.Hide();
                };

                dialog.AddChildLast(button);
                dialog.AddChildLast(label);

                dialog.Show();
            }
        }
开发者ID:yutanaka,项目名称:PSSuite_RD,代码行数:26,代码来源:AppMain.cs

示例6: DialogManager

        public DialogManager(Dialog emptyDialog)
        {
            Check.Required<ArgumentNullException>(() => emptyDialog != null);

            _dialog = _emptyDialog = emptyDialog;
            emptyDialog.Initialize();
        }
开发者ID:evgri243,项目名称:pubic-demos,代码行数:7,代码来源:DialogManager.cs

示例7: OnPointerClick

 public void OnPointerClick(PointerEventData eventData)
 {
     if (workedToday)
     {
         Dialog dialog = new Dialog();
         dialog.dialogText = "You already went to work today.";
         DialogOption option = new DialogOption();
         option.optionText = "Ok";
         dialog.dialogOptions.Add(option);
         DialogManagerScript.Instance.ShowDialog(dialog, noOp);
     } 
     else if (allowWork && GameStateManagerScript.Instance.GetGameTime().hour > 14)
     {
         Dialog dialog = new Dialog();
         dialog.dialogText = "It's too late to go to work now.";
         DialogOption option = new DialogOption();
         option.optionText = "Ok";
         dialog.dialogOptions.Add(option);
         DialogManagerScript.Instance.ShowDialog(dialog, noOp);
     }
     else if (allowWork)
     {
         Dialog dialog = new Dialog();
         dialog.dialogText = "You went to work, you earned 20$.";
         DialogOption option = new DialogOption();
         option.optionText = "Ok";
         dialog.dialogOptions.Add(option);
         DialogManagerScript.Instance.ShowDialog(dialog, noOp);
         workedToday = true;
         GameStateManagerScript.Instance.AdvanceTime(8 * 60 + Random.Range(0, 30));
         GameStateManagerScript.Instance.ChangeMoney(20);
     }
 }
开发者ID:Absor,项目名称:RoadTo5k,代码行数:33,代码来源:DoorScript.cs

示例8: ShowDialog

    internal void ShowDialog(Dialog dialog, Sprite avatar = null, DialogEndAction endAction = null)
    {
        currentDialog = dialog;
        avatarImage.sprite = avatar;

        StartCoroutine(getAllLines(endAction));
    }
开发者ID:halbich,项目名称:TimeLapsus,代码行数:7,代码来源:DialogController.cs

示例9: StartDialog

    /**
     * Start Dialog is called from Dialog as the trigger to get the DialogGui
     * going.
     *
     * This is broadcast into he GameObject after the DialogGui class is created
     * and added to the GameObject. You should not need to use extends or alter
     * this method if you are using the DialogGuiAbstract as your base.
     *
     * This broadcasts DialogStarted into the GameObject after it is called.
     *
     */
    public void StartDialog(Dialog dialog)
    {
        Parley.GetInstance().SetInGui(true);

        this.dialog=dialog;

        // Change camera
        if (dialog.dialogCamera!=null){
            oldCamera=Camera.main;

            // Try calling the camera dolly
            dialog.dialogCamera.gameObject.SendMessage("SwitchCamera",SendMessageOptions.DontRequireReceiver);

            if (!dialog.dialogCamera.gameObject.activeSelf){
                oldCamera.gameObject.SetActive(false);
                dialog.dialogCamera.gameObject.SetActive(true);
            }
        }

        // Broadcast to player and this object that we have started a dialog
        GameObject.FindWithTag("Player").BroadcastMessage("DialogStarted",dialog,SendMessageOptions.DontRequireReceiver);
        BroadcastMessage("DialogStarted",dialog,SendMessageOptions.DontRequireReceiver);
        Parley.GetInstance().SetCurrentDialog(dialog);

        // Start at the correct dialog
        GotoDialogue(null,dialog.GetConversationIndex());
    }
开发者ID:ChristianHoj,项目名称:home_nursing,代码行数:38,代码来源:DialogGuiAbstract.cs

示例10: Dialog

 public Dialog(Dialog _dialog)
 {
     name=_dialog.name;
     //face=_dialog.face;
     text=_dialog.text;
     speed=_dialog.speed;
 }
开发者ID:nxp040,项目名称:Cat_Game,代码行数:7,代码来源:WalkingText.cs

示例11: OnButtonIngresarClicked

        protected void OnButtonIngresarClicked(object sender, EventArgs e)
        {
            ControladorBaseDatos Bd = new ControladorBaseDatos();

            string[] usuarioClave = new string[2];

            usuarioClave = Bd.ObtenerUsuarioContraseñaBd(entryUsuario.Text);

            if(usuarioClave[0].Equals(entryUsuario.Text) & usuarioClave[1].Equals(entryClave.Text))
            {
                //PrincipalWindow principal = new PrincipalWindow(entryUsuario.Text);
                VenderProductosDialog principal = new VenderProductosDialog(entryUsuario.Text);

                base.Destroy();
                principal.Show();
            }
            else
            {
                Dialog dialog = new Dialog("Iniciar Sesion", this, Gtk.DialogFlags.DestroyWithParent);
                dialog.Modal = true;
                dialog.Resizable = false;
                Gtk.Label etiqueta = new Gtk.Label();
                etiqueta.Markup = "Usuario/Clave incorrectos";
                dialog.BorderWidth = 8;
                dialog.VBox.BorderWidth = 8;
                dialog.VBox.PackStart(etiqueta, false, false, 0);
                dialog.AddButton ("Cerrar", ResponseType.Close);
                dialog.ShowAll();
                dialog.Run ();
                dialog.Destroy ();

            }
        }
开发者ID:pelao,项目名称:punto,代码行数:33,代码来源:IniciarSesionDialog.cs

示例12: Run

		public Command Run (WindowFrame transientFor, MessageDescription message)
		{
			this.icon = GetIcon (message.Icon);
			if (ConvertButtons (message.Buttons, out buttons)) {
				// Use a system message box
				if (message.SecondaryText == null)
					message.SecondaryText = String.Empty;
				else {
					message.Text = message.Text + "\r\n\r\n" + message.SecondaryText;
					message.SecondaryText = String.Empty;
				}
				var wb = (WindowFrameBackend)Toolkit.GetBackend (transientFor);
				if (wb != null) {
					this.dialogResult = MessageBox.Show (wb.Window, message.Text, message.SecondaryText,
														this.buttons, this.icon, this.defaultResult, this.options);
				}
				else {
					this.dialogResult = MessageBox.Show (message.Text, message.SecondaryText, this.buttons,
														this.icon, this.defaultResult, this.options);
				}
				return ConvertResultToCommand (this.dialogResult);
			}
			else {
				// Custom message box required
				Dialog dlg = new Dialog ();
				dlg.Resizable = false;
				dlg.Padding = 0;
				HBox mainBox = new HBox { Margin = 25 };

				if (message.Icon != null) {
					var image = new ImageView (message.Icon.WithSize (32,32));
					mainBox.PackStart (image, vpos: WidgetPlacement.Start);
				}
				VBox box = new VBox () { Margin = 3, MarginLeft = 8, Spacing = 15 };
				mainBox.PackStart (box, true);
				var text = new Label {
					Text = message.Text ?? ""
				};
				Label stext = null;
				box.PackStart (text);
				if (!string.IsNullOrEmpty (message.SecondaryText)) {
					stext = new Label {
						Text = message.SecondaryText
					};
					box.PackStart (stext);
				}
				dlg.Buttons.Add (message.Buttons.ToArray ());
				if (mainBox.Surface.GetPreferredSize (true).Width > 480) {
					text.Wrap = WrapMode.Word;
					if (stext != null)
						stext.Wrap = WrapMode.Word;
					mainBox.WidthRequest = 480;
				}
				var s = mainBox.Surface.GetPreferredSize (true);

				dlg.Content = mainBox;
				return dlg.Run ();
			}
		}
开发者ID:m13253,项目名称:xwt,代码行数:59,代码来源:AlertDialogBackend.cs

示例13: SetUp

        public void SetUp()
        {
            _responses = Enumerable.Range(1, 3)
                .Select(x => "Response" + x)
                .ToArray();

            _userDialog = new Dialog<string>(string.Empty, string.Empty, _responses);
        }
开发者ID:hispafox,项目名称:CMContrib,代码行数:8,代码来源:UserDialogViewModel_Fixture.cs

示例14: LoadDialog

 public void LoadDialog(Dialog dialog)
 {
     GameController.Instance ().pause ();
     this.dialog = dialog;
     speakerIcon.sprite = dialog.speakerImage;
     speakerName.text = dialog.speakerName;
     dialogContent.text = dialog.getCurrentDialog();
 }
开发者ID:TsubameDono,项目名称:Evolution,代码行数:8,代码来源:UIDialog.cs

示例15: OnButtonEditarNumBoletaClicked

        protected void OnButtonEditarNumBoletaClicked(object sender, EventArgs e)
        {
            numBoleta = this.db.ObtenerBoleta ();

            if (Int32.Parse (entryNumBoleta.Text.Trim ()) > numBoleta) {

                try {
                    Venta nuevaVenta = new Venta (Int32.Parse (entryNumBoleta.Text.Trim ()), DateTime.Now.ToString ("yyyy-MM-dd"), "0", "inicioBoletaNueva", Int32.Parse ("0"), usuario_, "false");
                    db.AgregarVentaBd (nuevaVenta);

                    entryNumBoleta.Text = "";

                    Dialog dialog = new Dialog ("EDITAR BOLETA", this, Gtk.DialogFlags.DestroyWithParent);
                    dialog.Modal = true;
                    dialog.Resizable = false;
                    Gtk.Label etiqueta = new Gtk.Label ();
                    etiqueta.Markup = "La operación ha sido realizada con éxito";
                    dialog.BorderWidth = 8;
                    dialog.VBox.BorderWidth = 8;
                    dialog.VBox.PackStart (etiqueta, false, false, 0);
                    dialog.AddButton ("Cerrar", ResponseType.Close);
                    dialog.ShowAll ();
                    dialog.Run ();
                    dialog.Destroy ();

                } catch (Exception ex) {
                    Dialog dialog = new Dialog ("EDITAR BOLETA", this, Gtk.DialogFlags.DestroyWithParent);
                    dialog.Modal = true;
                    dialog.Resizable = false;
                    Gtk.Label etiqueta = new Gtk.Label ();
                    etiqueta.Markup = "Ha ocurrido un error al editar boleta";
                    dialog.BorderWidth = 8;
                    dialog.VBox.BorderWidth = 8;
                    dialog.VBox.PackStart (etiqueta, false, false, 0);
                    dialog.AddButton ("Cerrar", ResponseType.Close);
                    dialog.ShowAll ();
                    dialog.Run ();
                    dialog.Destroy ();
                    Console.WriteLine ("error editar boleta: " + ex);
                }

            } else {

                Dialog dialog = new Dialog ("EDITAR BOLETA", this, Gtk.DialogFlags.DestroyWithParent);
                dialog.Modal = true;
                dialog.Resizable = false;
                Gtk.Label etiqueta = new Gtk.Label ();
                etiqueta.Markup = "La boleta ingresada es menor a la del sistema";
                dialog.BorderWidth = 8;
                dialog.VBox.BorderWidth = 8;
                dialog.VBox.PackStart (etiqueta, false, false, 0);
                dialog.AddButton ("Cerrar", ResponseType.Close);
                dialog.ShowAll ();
                dialog.Run ();
                dialog.Destroy ();

            }
        }
开发者ID:pelao,项目名称:punto,代码行数:58,代码来源:EditarNumBoletaDialog.cs


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