本文整理汇总了C#中Xwt.Command类的典型用法代码示例。如果您正苦于以下问题:C# Command类的具体用法?C# Command怎么用?C# Command使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Command类属于Xwt命名空间,在下文中一共展示了Command类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: DialogCommandActivatedEventArgs
public DialogCommandActivatedEventArgs(Command command)
{
Command = command;
}
开发者ID:akrisiun,项目名称:xwt,代码行数:4,代码来源:Dialog.cs
示例17: EnableCommand
public void EnableCommand (Command cmd)
{
var btn = Buttons.GetCommandButton (cmd);
if (btn != null)
btn.Sensitive = true;
}
开发者ID:m13253,项目名称:xwt,代码行数:6,代码来源:Dialog.cs
示例18: OnAddConfiguration
void OnAddConfiguration (object sender, EventArgs e)
{
var okCommand = new Command (GettextCatalog.GetString ("Create"));
using (var dlg = new RunConfigurationNameDialog (ParentWindow, "", okCommand, panel.Configurations.Select (c => c.EditedConfig.Name))) {
dlg.Title = GettextCatalog.GetString ("New Configuration");
if (dlg.Run () == okCommand) {
var config = new MultiItemSolutionRunConfiguration (dlg.NewName, dlg.NewName);
panel.AddConfiguration (config);
Fill ();
}
}
}
开发者ID:kdubau,项目名称:monodevelop,代码行数:12,代码来源:SolutionRunConfigurationsPanel.cs
示例19: ShowCommand
public void ShowCommand (Command cmd)
{
var btn = Buttons.GetCommandButton (cmd);
if (btn != null)
btn.Visible = true;
}
开发者ID:m13253,项目名称:xwt,代码行数:6,代码来源:Dialog.cs
示例20: OnRenameConfiguration
void OnRenameConfiguration (object sender, EventArgs e)
{
var config = (MultiItemSolutionRunConfiguration)list.SelectedConfiguration;
var okCommand = new Command (GettextCatalog.GetString ("Rename"));
using (var dlg = new RunConfigurationNameDialog (ParentWindow, config.Name, okCommand, panel.Configurations.Select (c => c.EditedConfig.Name))) {
dlg.Title = GettextCatalog.GetString ("Rename Configuration");
if (dlg.Run () != Command.Cancel) {
var copy = new MultiItemSolutionRunConfiguration (config, dlg.NewName);
panel.ReplaceConfiguration (config, copy);
Fill ();
}
}
}
开发者ID:kdubau,项目名称:monodevelop,代码行数:13,代码来源:SolutionRunConfigurationsPanel.cs
注:本文中的Xwt.Command类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论