本文整理汇总了C#中Event.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Event.ToString方法的具体用法?C# Event.ToString怎么用?C# Event.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Event
的用法示例。
在下文中一共展示了Event.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddMessageForEvent
public static void AddMessageForEvent(Event eventToPrint, StringBuilder output)
{
if (eventToPrint != null)
{
output.Append(eventToPrint.ToString() + Environment.NewLine);
}
}
示例2: PrintEvent
public static void PrintEvent(Event eventToPrint)
{
if (eventToPrint != null)
{
EventEngine.AddOutput(eventToPrint.ToString());
}
}
示例3: AddEvent
public void AddEvent(Event evt)
{
evt.Added();
evts.Add(evt);
mailService.SendMail("[email protected]", "Event Notification", evt.ToString());
display.ShowEvent(evt);
}
示例4: EventToString
public void EventToString()
{
Event<long> e = new Event<long>();
e.Time = new Time(2000, 1, 2);
e.Value = 172;
string datetString = new DateTime(2000, 1, 2).ToString();
e.ToString().Should().Be(datetString + "\t172");
Console.WriteLine(e);
}
示例5: onEvent
private void onEvent(Event scenarioEvent, string tag)
{
Console.WriteLine(scenarioEvent.ToString() + ':' + tag);
if (tag == null) tag = "";
foreach (ScenarioTrigger trigger in Triggers)
{
if (trigger.Trigger != scenarioEvent.ToString()) continue;
if (tag != trigger.Tag) continue;
if (Events.ContainsKey(trigger.Event_id))
{
Events[trigger.Event_id].Execute(this);
return;
}
}
}
示例6: notifyEvent
public void notifyEvent(Event ev, object data)
{
switch (ev)
{
case Event.CHANGE_IN_TASK_PRIORITY :
Task.TaskPriorityChange tpc = (Task.TaskPriorityChange) data;
removeTask( tpc.task);
addTask((int) tpc.newTaskPriority, tpc.task);
break;
case Event.TASK_COMPLETED :
Task task = data as Task;
Debug.Log("Task " + task.taskName + " is complete, removing");
removeTask(task);
break;
default :
Debug.LogWarning("Undefined event sent to TaskManager " + ev.ToString());
break;
}
}
示例7: EventList
public void EventList()
{
var ev = new Event();
Assert.Null(ev.Account);
Assert.Null(ev.Created);
Assert.Null(ev.RelatedObject);
Assert.Null(ev.RelatedObjectPreviousState);
Assert.Null(ev.TestMode);
Assert.Null(ev.Type);
// Generate 3 events for some invoice - created, changed, deleted
var inv = Invoice.Create(new Invoice
{
Amount = 13,
Currency = "RUB"
});
inv.Amount = 14;
inv.Save();
inv.Delete();
var events = Event.List(new Dictionary<string, object>
{
{"invoice", inv.Id},
{"type", "invoice.deleted"},
});
Assert.AreEqual(1, events.Count);
ev = Event.Get(events[0].Id);
Assert.AreEqual(events[0].ToString(), ev.ToString());
Assert.AreEqual(inv.Account, ev.Account);
Assert.AreEqual(inv.TestMode, ev.TestMode);
Assert.AreEqual("invoice.deleted", ev.Type);
Assert.True(ev.RelatedObject is Invoice);
var evInv = (Invoice) ev.RelatedObject;
Assert.AreEqual(evInv.Amount, inv.Amount);
Assert.True(evInv.Deleted);
}
示例8: Write
/// <summary>
/// Implementación de la escritura del log del evento
/// en el visor de sucesos de Windows.
/// </summary>
/// <param name="pEvent">Evento a loguear.</param>
public override void Write(Event pEvent)
{
if (string.IsNullOrEmpty(pEvent.Source))
pEvent.Source = "Fwk.Logging.Targets";
EventLog.WriteEntry(pEvent.Source, pEvent.ToString(), GetWindowsEventType(pEvent.LogType));
}
示例9: Emit
public void Emit(Event ev)
{
this.TraceData(TraceEventType.Verbose, () =>
{
return new object[] { String.Concat("EventEmitterBase.ParallelEmitter - Queuing for ", _sendToEP, ": ", ev.ToString(true)) };
});
_dataQueue.Enqueue(LwesSerializer.SerializeToMemoryBuffer(ev));
EnsureSenderIsActive();
}
示例10: recordEvent
// If recording is allowed, record an event from the data given
private void recordEvent(Event eventType, string dataXML)
{
if (_bAllowRecording)
{
Console.WriteLine("Recording an event of type '" + eventType.ToString() + "'");
try
{
wrapper.RecordEvent((int)eventType, _PlayerID, dataXML);
}
catch (Exception ex)
{
Console.WriteLine("Event recording failed! '" + ex.Message + "'");
DisableRecording();
}
}
}
示例11: onPadEvent
public override bool onPadEvent(Event.PadEvent pe)
{
System.Windows.MessageBox.Show(pe.ToString());
return true;
}
示例12: Write
/// <summary>
/// Implementación de la escritura del log del evento
/// en archivo .log.
/// </summary>
/// <param name="pEvent">Evento a loguear.</param>
public override void Write(Event pEvent)
{
CheckOpenStreamWriter();
Fwk.HelperFunctions.FileFunctions.SaveTextFile(this.FileName, pEvent.ToString(), true);
}
示例13: onTouchEvent
public override bool onTouchEvent(Event.TouchEvent te)
{
System.Windows.MessageBox.Show(te.ToString());
return true;
}
示例14: Log
void Log(Event evt)
{
Send(new ToClient
{
action = 2,
log = evt
}, 0);
event_log.Add(evt);
WriteHistory(evt.ToString());
}
示例15: onAcceleratorEvent
public override bool onAcceleratorEvent(Event.AccelerometerEvent ae)
{
System.Windows.MessageBox.Show(ae.ToString());
return true;
}