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


C# Dialog.Respond方法代码示例

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


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

示例1: EditPlayer

        public override void EditPlayer(Text text)
        {
            playerText = text;
            if (playerDialog == null) {
                Gtk.Dialog d = new Gtk.Dialog (Catalog.GetString ("Select player"),
                                   this, DialogFlags.Modal | DialogFlags.DestroyWithParent,
                                   Stock.Cancel, ResponseType.Cancel);
                d.WidthRequest = 600;
                d.HeightRequest = 400;

                DrawingArea da = new DrawingArea ();
                TeamTagger tagger = new TeamTagger (new WidgetWrapper (da));
                tagger.ShowSubstitutionButtons = false;
                tagger.LoadTeams ((ViewModel.Project as ProjectLongoMatch).LocalTeamTemplate, (ViewModel.Project as ProjectLongoMatch).VisitorTeamTemplate,
                                  (ViewModel.Project as ProjectLongoMatch).Dashboard.FieldBackground);
                tagger.PlayersSelectionChangedEvent += players => {
                    if (players.Count == 1) {
                        Player p = players [0];
                        playerText.Value = p.ToString ();
                        d.Respond (ResponseType.Ok);
                    }
                    tagger.ResetSelection ();
                };
                d.VBox.PackStart (da, true, true, 0);
                d.ShowAll ();
                playerDialog = d;
            }
            if (playerDialog.Run () != (int)ResponseType.Ok) {
                text.Value = null;
            }
            playerDialog.Hide ();
        }
开发者ID:LongoMatch,项目名称:longomatch,代码行数:32,代码来源:SportDrawingTool.cs

示例2: ShowSimOnlyDialog

		public static void ShowSimOnlyDialog ()
		{
			if (!SimOnly)
				return;
			
			var dialog = new Dialog ();
			dialog.Title =  GettextCatalog.GetString ("Evaluation Version");
			
			dialog.VBox.PackStart (
			 	new Label ("<b><big>Feature Not Available In Evaluation Version</big></b>") {
					Xalign = 0.5f,
					UseMarkup = true
				}, true, false, 12);
			
			var align = new Gtk.Alignment (0.5f, 0.5f, 1.0f, 1.0f) { LeftPadding = 12, RightPadding = 12 };
			dialog.VBox.PackStart (align, true, false, 12);
			align.Add (new Label (
				"You should upgrade to the full version of MonoTouch to target and deploy\n" +
				" to the device, and to enable your applications to be distributed.") {
					Xalign = 0.5f,
					Justify = Justification.Center
				});
			
			align = new Gtk.Alignment (0.5f, 0.5f, 1.0f, 1.0f) { LeftPadding = 12, RightPadding = 12 };
			dialog.VBox.PackStart (align, true, false, 12);
			var buyButton = new Button (
				new Label (GettextCatalog.GetString ("<big>Buy MonoTouch</big>")) { UseMarkup = true } );
			buyButton.Clicked += delegate {
				System.Diagnostics.Process.Start ("http://monotouch.net");
				dialog.Respond (ResponseType.Accept);
			};
			align.Add (buyButton);
			
			dialog.AddButton (GettextCatalog.GetString ("Continue evaluation"), ResponseType.Close);
			dialog.ShowAll ();
			
			MessageService.ShowCustomDialog (dialog);
		}
开发者ID:Ein,项目名称:monodevelop,代码行数:38,代码来源:IPhoneFramework.cs

示例3: TextPrompt

    public static void TextPrompt(string title, string labelText, string entryText, string buttonText,
   int position, int selectStart, int selectEnd, TextPromptHandler onOk)
    {
        Dialog d = new Dialog();
        d.Modal = false;
        d.ActionArea.Layout = ButtonBoxStyle.Spread;
        d.HasSeparator = false;
        d.BorderWidth = 10;
        d.Title = title;
        Label label = new Label (labelText);
        label.UseUnderline = false;
        d.VBox.Add (label);
        Entry e = new Entry (entryText);
        e.WidthChars = Math.Min(100, e.Text.Length + 10);
        e.Activated += new EventHandler (delegate { d.Respond(ResponseType.Ok); });
        d.VBox.Add (e);
        d.AddButton (buttonText, ResponseType.Ok);

        d.Response += new ResponseHandler(delegate (object obj, ResponseArgs args) {
          if (args.ResponseId == ResponseType.Ok) {
        onOk(e.Text);
          } else {
        LogError (args.ResponseId);
          }
          d.Unrealize ();
          d.Destroy ();
        });

        d.ShowAll ();
        e.Position = position;
        e.SelectRegion(selectStart, selectEnd);
    }
开发者ID:kig,项目名称:filezoo,代码行数:32,代码来源:helpers.cs


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