當前位置: 首頁>>代碼示例>>C#>>正文


C# Xwt.Command類代碼示例

本文整理匯總了C#中Xwt.Command的典型用法代碼示例。如果您正苦於以下問題:C# Command類的具體用法?C# Command怎麽用?C# Command使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Command類屬於Xwt命名空間,在下文中一共展示了Command類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: MenuItem

 public MenuItem(Command command)
     : this()
 {
     Label = command.Label;
     if (!string.IsNullOrEmpty (command.Icon))
         Image = Image.FromIcon (command.Icon, IconSize.Small);
 }
開發者ID:joncham,項目名稱:xwt,代碼行數:7,代碼來源:MenuItem.cs

示例2: SetCommand

 public void SetCommand(Command command, Action action)
 {
     Action oldAction;
     if (_commandMap.TryGetValue (command, out oldAction)) {
         _commandMap [command] = action;
     } else {
         _commandMap.Add (command, action);
     }
 }
開發者ID:residuum,項目名稱:MonoMultiJack,代碼行數:9,代碼來源:KeyMap.cs

示例3: Windows

        public Windows()
        {
            Button b = new Button ("Show borderless window");
            PackStart (b);
            b.Clicked += delegate {
                Window w = new Window ();
                w.Decorated = false;
                Button c = new Button ("This is a window");
            //				c.Margin.SetAll (10);
                w.Content = c;
                c.Clicked += delegate {
                    w.Dispose ();
                };
                var bpos = b.ScreenBounds;
                w.Bounds = new Rectangle (bpos.X, bpos.Y + b.Size.Height, w.Bounds.Width, w.Bounds.Height);
                w.Show ();
            };
            b = new Button ("Show message dialog");
            PackStart (b);
            b.Clicked += delegate {
                MessageDialog.ShowMessage (ParentWindow, "Hi there!");
            };

            Button db = new Button ("Show custom dialog");
            PackStart (db);
            db.Clicked += delegate {
                Dialog d = new Dialog ();
                d.Title = "This is a dialog";
                Table t = new Table ();
                t.Attach (new Label ("Some field:"), 0, 1, 0, 1);
                t.Attach (new TextEntry (), 1, 2, 0, 1);
                t.Attach (new Label ("Another field:"), 0, 1, 1, 2);
                t.Attach (new TextEntry (), 1, 2, 1, 2);
                d.Content = t;

                Command custom = new Command ("Custom");
                d.Buttons.Add (new DialogButton (custom));
                d.Buttons.Add (new DialogButton ("Custom OK", Command.Ok));
                d.Buttons.Add (new DialogButton (Command.Cancel));
                d.Buttons.Add (new DialogButton (Command.Ok));

                var r = d.Run (this.ParentWindow);
                db.Label = "Result: " + r.Label;
                d.Dispose ();
            };
        }
開發者ID:joncham,項目名稱:xwt,代碼行數:46,代碼來源:Windows.cs

示例4: OnCommandActivated

		/// <summary>
		/// Called when a dialog button is clicked
		/// </summary>
		/// <param name="cmd">The command</param>
		protected virtual void OnCommandActivated (Command cmd)
		{
			Respond (cmd);
		}
開發者ID:m13253,項目名稱:xwt,代碼行數:8,代碼來源:Dialog.cs

示例5: DialogButton

		public DialogButton (string label, Image icon, Command cmd)
		{
			this.label = label;
			this.command = cmd;
			this.image = icon;
		}
開發者ID:m13253,項目名稱:xwt,代碼行數:6,代碼來源:Dialog.cs

示例6: HideCommand

		public void HideCommand (Command cmd)
		{
			var btn = Buttons.GetCommandButton (cmd);
			if (btn != null)
				btn.Visible = false;
		}
開發者ID:m13253,項目名稱:xwt,代碼行數:6,代碼來源:Dialog.cs

示例7: DisableCommand

		public void DisableCommand (Command cmd)
		{
			var btn = Buttons.GetCommandButton (cmd);
			if (btn != null)
				btn.Sensitive = false;
		}
開發者ID:m13253,項目名稱:xwt,代碼行數:6,代碼來源:Dialog.cs

示例8: RequestClose

		bool RequestClose ()
		{
			requestingClose = true;
			try {
				if (OnCloseRequested ()) {
					if (!responding)
						resultCommand = null;
					loopEnded = true;
					return true;
				} else
					return false;
			} finally {
				responding = false;
				requestingClose = false;
			}
		}
開發者ID:m13253,項目名稱:xwt,代碼行數:16,代碼來源:Dialog.cs

示例9: Respond

 public void Respond(Command cmd)
 {
     resultCommand = cmd;
     if (!loopEnded) {
         loopEnded = true;
         Backend.EndLoop ();
     }
 }
開發者ID:vladimirvaragic,項目名稱:xwt,代碼行數:8,代碼來源:Dialog.cs

示例10: ConfirmationMessage

 public ConfirmationMessage(string primaryText, string secondaryText, Command button)
     : this(primaryText, button)
 {
     SecondaryText = secondaryText;
 }
開發者ID:Gaushick,項目名稱:xwt,代碼行數:5,代碼來源:MessageDialog.cs

示例11: Confirm

 public static bool Confirm(string primaryText, string secondaryText, Command button, bool confirmIsDefault)
 {
     return GenericAlert (RootWindow, StockIcons.Question, primaryText, secondaryText, confirmIsDefault ? 0 : 1, Command.Cancel, button) == button;
 }
開發者ID:Gaushick,項目名稱:xwt,代碼行數:4,代碼來源:MessageDialog.cs

示例12: RadioButtonMenuItem

 public RadioButtonMenuItem(Command command)
     : base(command)
 {
 }
開發者ID:RevolutionSmythe,項目名稱:xwt,代碼行數:4,代碼來源:RadioButtonMenuItem.cs

示例13: CheckBoxMenuItem

 public CheckBoxMenuItem(Command command)
     : base(command)
 {
 }
開發者ID:sandeep-datta,項目名稱:xwt,代碼行數:4,代碼來源:CheckBoxMenuItem.cs

示例14: OnCommandActivated

 /// <summary>
 /// Called when a dialog button is clicked
 /// </summary>
 /// <param name="cmd">The command</param>
 protected virtual void OnCommandActivated(Command cmd)
 {
     var args = new DialogCommandActivatedEventArgs (cmd);
     if (CommandActivated != null)
         CommandActivated (this, args);
     if (!args.Handled)
         Respond (cmd);
 }
開發者ID:akrisiun,項目名稱:xwt,代碼行數:12,代碼來源:Dialog.cs

示例15: Respond

		public void Respond (Command cmd)
		{
			resultCommand = cmd;
			responding = true;
			if (!loopEnded && !requestingClose) {
				Backend.EndLoop ();
			}
		}
開發者ID:m13253,項目名稱:xwt,代碼行數:8,代碼來源:Dialog.cs


注:本文中的Xwt.Command類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。