本文整理汇总了C#中CustomEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# CustomEventArgs类的具体用法?C# CustomEventArgs怎么用?C# CustomEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CustomEventArgs类属于命名空间,在下文中一共展示了CustomEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CaseLockedPage_AskForLockManualMA
private void CaseLockedPage_AskForLockManualMA(object sender, CustomEventArgs.AccessionOrderReturnEventArgs e)
{
UI.AppMessaging.MessagingPath.Instance.StartSendRequest(e.AccessionOrder, this.m_CuttingWorkspaceWindow.PageNavigator);
//AppMessaging.MessagingPath.Instance.LockWasReleased += MessageQueuePath_LockWasReleasedManualMA;
//AppMessaging.MessagingPath.Instance.HoldYourHorses += Instance_HoldYourHorses;
UI.AppMessaging.MessagingPath.Instance.Nevermind += MessageQueuePath_Nevermind;
}
示例2: PageManager1_CustomEvent
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
{
if (e.EventArgument == "SAVE")
{
SaveAndClose();
}
}
示例3: Player_PlaybackBitrateChanged
private void Player_PlaybackBitrateChanged(object sender, CustomEventArgs<long> e)
{
if (e.Value > 0)
{
LastBitrate = e.Value;
}
}
开发者ID:Ginichen,项目名称:Silverlight-Player-for-PlayReady-with-Token-Auth,代码行数:7,代码来源:SMFPlayerStartupBitrate.cs
示例4: poll_Tick
private void poll_Tick(object o)
{
lock (pollLock)
{
HashSet<Action<DirectInputData>> action;
BufferedDataCollection queue = null;
try
{
_device.Poll();
queue = _device.GetBufferedData();
}
catch
{
Debug.Print("DirectInputKeyboard::poll_tick exception");
_pollTimer.Change(Timeout.Infinite, Timeout.Infinite);
if (OnError != null)
OnError(this, EventArgs.Empty);
return;
}
if (queue != null)
{
foreach (BufferedData data in queue)
{
Key dataType = (Key)data.Offset;
KeyState state = (KeyState)data.Data;
DirectInputData keyData = new DirectInputData()
{
Value = data.Data,
KeyboardKey = dataType,
Type = DIDataType.Keyboard,
DeviceName = Name
};
CustomEventArgs<DirectInputData> eventArg = new CustomEventArgs<DirectInputData>(keyData);
_actionMap.TryGetValue(dataType, out action);
if (action != null)
action.ToList().ForEach(a => a(keyData));
if (state == KeyState.Down && OnKeyDown != null)
OnKeyDown(this, eventArg);
if (state == KeyState.Up)
{
if (OnKeyUp != null)
OnKeyUp(this, eventArg);
if (OnKeyPress != null)
OnKeyPress(this, eventArg);
}
}
}
}
}
示例5: OnRaiseCustomEvent
private void OnRaiseCustomEvent(CustomEventArgs args)
{
EventHandler<CustomEventArgs> handler = RaiseCustomEvent;
if (handler != null)
{
handler(this, args);
}
}
示例6: Pulse
public override void Pulse()
{
if (DateTime.Now > nextUIupdate)
{
nextUIupdate = DateTime.Now.AddMilliseconds(updateinterval);
CustomEventArgs args = new CustomEventArgs();
if (UpdateUI != null)
UpdateUI(args);
}
}
示例7: RaiseEvent
public void RaiseEvent()
{
// Write some code that does something useful here
// then raise the event. You can also raise an event
// before you execute a block of code.
CustomEventArgs args = new CustomEventArgs();
args.TimeReached = DateTime.Now;
OnRaiseCustomEvent(args);
}
示例8: CheckRequestTimeoutMessageInError
public void CheckRequestTimeoutMessageInError()
{
CustomEventArgs<string> cea = new CustomEventArgs<string> ();
cea.CurrRequestType = CurrentRequestType.Subscribe;
cea.IsError = true;
cea.IsTimeout = false;
cea.Message = "The request timed out.";
cea.PubnubRequestState = null;
Assert.IsTrue(Utility.CheckRequestTimeoutMessageInError<string> (cea));
}
示例9: ShouldFireEventHandlerViaFireWithOneArgumentWithCorrentData
public void ShouldFireEventHandlerViaFireWithOneArgumentWithCorrentData()
{
var eventArgs = new CustomEventArgs();
_customEventHandler.Fire(eventArgs);
Thread.Sleep(50);
Assert.NotNull(_customEventHandlerData);
Assert.Null(_customEventHandlerData.Sender);
Assert.AreEqual(eventArgs, _customEventHandlerData.EventArgs);
}
示例10: PageManager1_CustomEvent
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
{
if (e.EventArgument == "Confirm_OK")
{
Alert.Show("执行了确定操作!");
}
else if (e.EventArgument == "Confirm_Cancel")
{
Alert.Show("执行了取消操作!");
}
}
示例11: OpenNewChatFormOnMsgReceived
/// <summary>
/// 새로운 대화메시지 수신시 대화창 생성
/// </summary>
/// <param name="ar">d|formkey|id/id/...|name|메시지내용</param>
private void OpenNewChatFormOnMsgReceived(object sender, CustomEventArgs e) //ar = d|formkey|id/id/...|name|메시지내용
{
try
{
ChatObj chatObj = (ChatObj)e.GetItem;
ChatForm chatForm = new ChatForm(connection, miscCtrl, chatObj);
}
catch (Exception exception)
{
Logger.error(exception.ToString());
}
}
示例12: OnRaiseCustomEvent
protected virtual void OnRaiseCustomEvent(CustomEventArgs e)
{
// Make a temporary copy of the event
EventHandler<CustomEventArgs> handler = RaiseCustomEvent;
// Event will be null if there are no subscribers
if (handler != null)
{
// Use the () operator to raise the event.
handler(this, e);
}
}
示例13: DataContractEventArgsSerializerTest
public DataContractEventArgsSerializerTest()
{
this.eventArgsToSerialize = new CustomEventArgs(true);
using (MemoryStream ms = new MemoryStream())
{
var serializer = new DataContractSerializer(typeof(CustomEventArgs));
serializer.WriteObject(ms, this.eventArgsToSerialize);
this.inputAndOutput = Convert.ToBase64String(ms.ToArray());
}
this.testee = new DataContractEventArgsSerializer();
}
示例14: OnRaiseEvent
protected virtual void OnRaiseEvent(CustomEventArgs e)
{
EventHandler<CustomEventArgs> handler = RaiseCustomEvent;
if (handler != null)
{
e.Message += String.Format("{0:hh:mm:ss}", DateTime.Now);
handler(this, e);
}
else
{
Console.WriteLine("There are no listeners.");
}
}
示例15: BinaryEventArgsSerializerTest
public BinaryEventArgsSerializerTest()
{
this.eventArgsToSerialize = new CustomEventArgs(true);
using (MemoryStream ms = new MemoryStream())
{
var formatter = new BinaryFormatter();
formatter.Serialize(ms, this.eventArgsToSerialize);
this.inputAndOutput = Convert.ToBase64String(ms.ToArray());
}
this.testee = new BinaryEventArgsSerializer();
}