本文整理汇总了C#中CommandEventHandler类的典型用法代码示例。如果您正苦于以下问题:C# CommandEventHandler类的具体用法?C# CommandEventHandler怎么用?C# CommandEventHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CommandEventHandler类属于命名空间,在下文中一共展示了CommandEventHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateChildControls
protected internal override void CreateChildControls()
{
this.Controls.Clear();
this._logInLinkButton = new LinkButton();
this._logInImageButton = new ImageButton();
this._logOutLinkButton = new LinkButton();
this._logOutImageButton = new ImageButton();
this._logInLinkButton.EnableViewState = false;
this._logInImageButton.EnableViewState = false;
this._logOutLinkButton.EnableViewState = false;
this._logOutImageButton.EnableViewState = false;
this._logInLinkButton.EnableTheming = false;
this._logInImageButton.EnableTheming = false;
this._logInLinkButton.CausesValidation = false;
this._logInImageButton.CausesValidation = false;
this._logOutLinkButton.EnableTheming = false;
this._logOutImageButton.EnableTheming = false;
this._logOutLinkButton.CausesValidation = false;
this._logOutImageButton.CausesValidation = false;
CommandEventHandler handler = new CommandEventHandler(this.LogoutClicked);
this._logOutLinkButton.Command += handler;
this._logOutImageButton.Command += handler;
handler = new CommandEventHandler(this.LoginClicked);
this._logInLinkButton.Command += handler;
this._logInImageButton.Command += handler;
this.Controls.Add(this._logOutLinkButton);
this.Controls.Add(this._logOutImageButton);
this.Controls.Add(this._logInLinkButton);
this.Controls.Add(this._logInImageButton);
}
示例2: Command
/// <summary>
/// Creates a new Command
/// </summary>
/// <param name="cmd">The name of the command</param>
/// <param name="desc">The description of the command</param>
/// <param name="expectedArgs">A list of a list of expected command arguments where each outer list is a new argument set</param>
/// <param name="callback">The CommandEventHandler delegate to callback to</param>
public Command(string cmd, string desc, List<List<CommandArgument>> expectedArgs,
CommandEventHandler callback)
{
Name = cmd;
ExpectedArgs = expectedArgs;
Callback = callback;
Description = desc;
}
示例3: AppendDetailViewFields
public static void AppendDetailViewFields(string sDETAIL_NAME, HtmlTable tbl, IDataReader rdr, L10N L10n, TimeZone T10n, CommandEventHandler Page_Command)
{
if ( tbl == null )
{
SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), "HtmlTable is not defined for " + sDETAIL_NAME);
return;
}
DataTable dtFields = SplendidCache.DetailViewFields(sDETAIL_NAME);
AppendDetailViewFields(dtFields.DefaultView, tbl, rdr, L10n, T10n, Page_Command, false);
}
示例4: Register
public static void Register(string option, CommandEventHandler handler, bool requiresValue)
{
string optionKey = PrepareOptionKey(option);
OptionRoute route;
if (CommandRouter.routes.ContainsKey(optionKey))
throw new Exception("Komut opsiyon key'i zaten mevcut");
route = new OptionRoute() { Option = option, Handler = handler, RequiresValue = requiresValue };
CommandRouter.routes.Add(optionKey, route);
}
示例5: PrototypeDevice
public PrototypeDevice()
{
DcClient = new DeviceHive.HttpClient(Resources.GetString(Resources.StringResources.CloudUrl), DateTime.MinValue, RequestTimeout);
Initializing += new ConnectEventHandler(PreInit);
Connecting += new ConnectEventHandler(PreConnect);
Connected += new ConnectEventHandler(PostConnect);
BeforeCommand += new CommandEventHandler(PreProcessCommand);
AfterCommand += new CommandEventHandler(PostProcessCommand);
BeforeNotification += new NotificationEventHandler(PreProcessNotification);
AfterNotification += new NotificationEventHandler(PostProcessNotification);
Disconnected += new SimpleEventHandler(OnDisconnect);
LastTemp = 0.0f;
}
示例6: Register
public static bool Register(string value, AccessLevel access, CommandEventHandler handler)
{
if (String.IsNullOrWhiteSpace(value))
{
return false;
}
if (CommandSystem.Entries.ContainsKey(value))
{
return Replace(value, access, handler, value);
}
CommandSystem.Register(value, access, handler);
return true;
}
示例7: Register
public static bool Register(string value, AccessLevel access, CommandEventHandler handler, out CommandEntry entry)
{
entry = null;
if (String.IsNullOrWhiteSpace(value))
{
return false;
}
if (CommandSystem.Entries.ContainsKey(value))
{
return Replace(value, access, handler, value, out entry);
}
CommandSystem.Register(value, access, handler);
return CommandSystem.Entries.TryGetValue(value, out entry);
}
示例8: Command
/// <summary>
/// Creates a new command.
/// </summary>
/// <param name="name">Name for the new command.</param>
/// <param name="callback">Callback for the new command.</param>
public Command(string name, CommandEventHandler callback)
{
foreach (object o in callback.Method.GetCustomAttributes(false))
{
if (o is AlertAttribute)
{
alert = true;
}
else if (o is AliasAttribute)
{
aliases = ((AliasAttribute)o).aliases;
}
else if (o is DescriptionAttribute)
{
desc = ((DescriptionAttribute)o).description;
}
}
this.callback = callback;
this.name = name.ToLower();
}
示例9: Replace
public static bool Replace(string value, AccessLevel access, CommandEventHandler handler, string newValue)
{
if (String.IsNullOrWhiteSpace(value))
{
if (String.IsNullOrWhiteSpace(newValue))
{
return false;
}
value = newValue;
}
if (handler == null)
{
if (!CommandSystem.Entries.ContainsKey(value))
{
return false;
}
handler = CommandSystem.Entries[value].Handler;
}
if (value != newValue)
{
if (String.IsNullOrWhiteSpace(newValue))
{
Unregister(value);
return true;
}
value = newValue;
}
Unregister(value);
CommandSystem.Register(value, access, handler);
return true;
}
示例10: AppendButtons
public static void AppendButtons(string sVIEW_NAME, Guid gASSIGNED_USER_ID, Control ctl, bool bIsMobile, DataRow rdr, L10N L10n, CommandEventHandler Page_Command)
{
if ( ctl == null )
{
SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), "AppendButtons ctl is not defined");
return;
}
//ctl.Controls.Clear();
Hashtable hashIDs = new Hashtable();
// 05/06/2010 Use a special Page flag to override the default IsPostBack behavior.
bool bIsPostBack = ctl.Page.IsPostBack;
bool bNotPostBack = false;
if ( ctl.TemplateControl is SplendidControl )
{
bNotPostBack = (ctl.TemplateControl as SplendidControl).NotPostBack;
bIsPostBack = ctl.Page.IsPostBack && !bNotPostBack;
}
bool bShowUnassigned = Crm.Config.show_unassigned();
DataTable dt = SplendidCache.DynamicButtons(sVIEW_NAME);
if ( dt != null )
{
foreach(DataRow row in dt.Rows)
{
Guid gID = Sql.ToGuid (row["ID" ]);
int nCONTROL_INDEX = Sql.ToInteger(row["CONTROL_INDEX" ]);
string sCONTROL_TYPE = Sql.ToString (row["CONTROL_TYPE" ]);
string sMODULE_NAME = Sql.ToString (row["MODULE_NAME" ]);
string sMODULE_ACCESS_TYPE = Sql.ToString (row["MODULE_ACCESS_TYPE"]);
string sTARGET_NAME = Sql.ToString (row["TARGET_NAME" ]);
string sTARGET_ACCESS_TYPE = Sql.ToString (row["TARGET_ACCESS_TYPE"]);
bool bMOBILE_ONLY = Sql.ToBoolean(row["MOBILE_ONLY" ]);
bool bADMIN_ONLY = Sql.ToBoolean(row["ADMIN_ONLY" ]);
string sCONTROL_TEXT = Sql.ToString (row["CONTROL_TEXT" ]);
string sCONTROL_TOOLTIP = Sql.ToString (row["CONTROL_TOOLTIP" ]);
string sCONTROL_ACCESSKEY = Sql.ToString (row["CONTROL_ACCESSKEY" ]);
string sCONTROL_CSSCLASS = Sql.ToString (row["CONTROL_CSSCLASS" ]);
string sTEXT_FIELD = Sql.ToString (row["TEXT_FIELD" ]);
string sARGUMENT_FIELD = Sql.ToString (row["ARGUMENT_FIELD" ]);
string sCOMMAND_NAME = Sql.ToString (row["COMMAND_NAME" ]);
string sURL_FORMAT = Sql.ToString (row["URL_FORMAT" ]);
string sURL_TARGET = Sql.ToString (row["URL_TARGET" ]);
string sONCLICK_SCRIPT = Sql.ToString (row["ONCLICK_SCRIPT" ]);
// 07/28/2010 We need a flag to exclude a button from a mobile device.
bool bEXCLUDE_MOBILE = false;
try
{
bEXCLUDE_MOBILE = Sql.ToBoolean(row["EXCLUDE_MOBILE"]);
}
catch
{
}
// 03/14/2014 Allow hidden buttons to be created.
bool bHIDDEN = false;
try
{
bHIDDEN = Sql.ToBoolean(row["HIDDEN"]);
}
catch
{
}
// 09/01/2008 Give each button an ID to simplify validation.
// Attempt to name the control after the command name. If no command name, then use the control text.
string sCONTROL_ID = String.Empty;
if ( !Sql.IsEmptyString(sCOMMAND_NAME) )
{
sCONTROL_ID = sCOMMAND_NAME;
}
else if ( !Sql.IsEmptyString(sCONTROL_TEXT) )
{
sCONTROL_ID = sCONTROL_TEXT;
if ( sCONTROL_TEXT.IndexOf('.') >= 0 )
{
sCONTROL_ID = sCONTROL_TEXT.Split('.')[1];
sCONTROL_ID = sCONTROL_ID.Replace("LBL_", "");
sCONTROL_ID = sCONTROL_ID.Replace("_BUTTON_LABEL", "");
}
}
if ( !Sql.IsEmptyString(sCONTROL_ID) )
{
// 09/01/2008 Cleanup the ID.
sCONTROL_ID = sCONTROL_ID.Trim();
sCONTROL_ID = sCONTROL_ID.Replace(' ', '_');
sCONTROL_ID = sCONTROL_ID.Replace('.', '_');
sCONTROL_ID = "btn" + sCONTROL_ID.ToUpper();
// 12/16/2008 Add to hash after cleaning the ID.
if ( hashIDs.Contains(sCONTROL_ID) )
sCONTROL_ID = sVIEW_NAME.Replace('.', '_') + "_" + nCONTROL_INDEX.ToString();
if ( !hashIDs.Contains(sCONTROL_ID) )
hashIDs.Add(sCONTROL_ID, null);
else
sCONTROL_ID = String.Empty; // If ID still exists, then don't set the ID.
}
// 03/21/2008 We need to use a view to search for the rows for the ColumnName.
// 11/22/2010 Convert data reader to data table for Rules Wizard.
//DataView vwSchema = null;
//if ( rdr != null )
// vwSchema = new DataView(rdr.GetSchemaTable());
//.........这里部分代码省略.........
示例11: CreateMoveButton
private LinkButton CreateMoveButton(string direction, string tooltip, CommandEventHandler handler)
{
var b = new LinkButton();
b.ID = ID + "_" + direction + "_" + itemEditorIndex;
b.Text = "<b class='fa fa-arrow-" + direction + "'></b>";
b.ToolTip = tooltip;
b.CommandArgument = itemEditorIndex.ToString();
b.CausesValidation = false;
b.Command += handler;
return b;
}
示例12: Register
public static void Register( string command, CommandEventHandler handler )
{
CommandSystem.Register( command, MC.AccessLevelReq, handler );
}
示例13: RegisterButtonEvents
public static void RegisterButtonEvents(Control container, CommandEventHandler eventHandler)
{
foreach (var button in container.Controls.OfType<IButtonControl>())
button.Command += eventHandler;
}
示例14: AppendDetailViewFields
protected void AppendDetailViewFields(string sDETAIL_NAME, HtmlTable tbl, IDataReader rdr, CommandEventHandler Page_Command)
{
// 12/02/2005 Paul. AppendEditViewFields will get called inside InitializeComponent(),
// which occurs before OnInit(), so make sure to initialize L10n.
SplendidDynamic.AppendDetailViewFields(sDETAIL_NAME, tbl, rdr, GetL10n(), GetT10n(), Page_Command);
}
示例15: Register
public static void Register( string command, AccessLevel access, CommandEventHandler handler )
{
Server.Commands.Register( command, access, handler );
}