本文整理汇总了C#中EventInfo类的典型用法代码示例。如果您正苦于以下问题:C# EventInfo类的具体用法?C# EventInfo怎么用?C# EventInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EventInfo类属于命名空间,在下文中一共展示了EventInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EventReceivedHandler
public void EventReceivedHandler(object sender, EventInfo eventInfo)
{
if (eventInfo.Type == EventInfo.EventTypes.TAG_REPORT)
{
var tagid = eventInfo.GetParameter(EventInfo.EventTagReportParams.TagId);
var antenna = eventInfo.GetParameter(EventInfo.EventTagReportParams.Antenna);
var time = eventInfo.GetParameter(EventInfo.EventTagReportParams.Time);
var phase = eventInfo.GetParameter(EventInfo.EventTagReportParams.Phase);
var frequency = eventInfo.GetParameter(EventInfo.EventTagReportParams.Frequency);
var rssi = eventInfo.GetParameter(EventInfo.EventTagReportParams.Rssi);
var phaseAngle = _phaseUtils.PhaseAngle(phase);
if (tagid != null)
{
var reading = new Reading
{
TagId = tagid,
Antenna = antenna,
PhaseAngle = phaseAngle,
Frequency = frequency,
Rssi = rssi,
Time = time
};
//Console.WriteLine(reading);
Readings.Add(reading);
}
}
}
示例2: OnPreferencesChanged
protected override IEnumerator<object> OnPreferencesChanged(EventInfo evt, string[] prefNames)
{
string prefsJson = null;
yield return Preferences.GetAllJson().Bind(() => prefsJson);
yield return CallFunction("weaponhelper", "notifyPrefsChanged", prefsJson);
}
示例3: __GetDeclaredEvents
public override EventInfo[] __GetDeclaredEvents()
{
int token = this.MetadataToken;
// TODO use binary search?
for (int i = 0; i < module.EventMap.records.Length; i++)
{
if (module.EventMap.records[i].Parent == token)
{
int evt = module.EventMap.records[i].EventList - 1;
int end = module.EventMap.records.Length > i + 1 ? module.EventMap.records[i + 1].EventList - 1 : module.Event.records.Length;
EventInfo[] events = new EventInfo[end - evt];
if (module.EventPtr.RowCount == 0)
{
for (int j = 0; evt < end; evt++, j++)
{
events[j] = new EventInfoImpl(module, this, evt);
}
}
else
{
for (int j = 0; evt < end; evt++, j++)
{
events[j] = new EventInfoImpl(module, this, module.EventPtr.records[evt] - 1);
}
}
return events;
}
}
return Empty<EventInfo>.Array;
}
示例4: ColorChanged
void ColorChanged(EventInfo eventInfo)
{
ColorEventInfo info = (ColorEventInfo)eventInfo;
currentColor = info.newColor;
SetCurrentMaterials();
}
示例5: BroadcastStateChange
private void BroadcastStateChange(EventInfo eventInfo)
{
Debug.Log ("Broadcasting state change.");
foreach (ScreenController screenController in screenControllers) {
screenController.MatchStateChanged (eventInfo);
}
}
示例6: OnPreferencesChanged
protected override IEnumerator<object> OnPreferencesChanged(EventInfo evt, string[] prefNames)
{
long fontScale = 100, fontWidth = 100;
yield return Preferences.Get<long>("FontScale").Bind(() => fontScale);
yield return Preferences.Get<long>("FontWidth").Bind(() => fontWidth);
yield return CallFunction("fontsizer", "setFontSize", fontScale / 100.0f, fontWidth / 100.0f);
}
示例7: PlayerDied
public void PlayerDied(EventInfo eventInfo)
{
PlayerController playerController = ((PlayerSpawnedEventInfo)eventInfo).player;
switch (playerController.Id)
{
case 1: target1 = null; break;
case 2: target2 = null; break;
}
}
示例8: ColorChanged
//Test function
void ColorChanged(EventInfo eventInfo)
{
switch (((ColorEventInfo)eventInfo).newColor)
{
case ChromaColor.RED: RenderSettings.skybox.SetColor("_Tint", Color.red); break;
case ChromaColor.GREEN: RenderSettings.skybox.SetColor("_Tint", Color.green); break;
case ChromaColor.BLUE: RenderSettings.skybox.SetColor("_Tint", Color.blue); break;
case ChromaColor.YELLOW: RenderSettings.skybox.SetColor("_Tint", Color.yellow); break;
}
}
示例9: TaskSheduler_ResourceHistory_ShouldConstructCorrectly
// ReSharper disable InconsistentNaming
public void TaskSheduler_ResourceHistory_ShouldConstructCorrectly()
// ReSharper restore InconsistentNaming
{
var a = new List<IDebugState>();
var b = new EventInfo(new DateTime(2001, 01, 01), new TimeSpan(1, 0, 0), new DateTime(2001, 01, 01), ScheduleRunStatus.Error, "sdf");
var res = new ResourceHistory("output", a, b, "bob");
Assert.AreEqual(a, res.DebugOutput);
Assert.AreEqual(b, res.TaskHistoryOutput);
Assert.AreEqual("bob", res.UserName);
}
示例10: GetEventHandler
/// <summary>
/// Creates an event handler for the specified event
/// </summary>
/// <param Name="Info">The event info class of the event</param>
/// <returns>The created event handler help class.</returns>
public object GetEventHandler(EventInfo Info)
{
Type eventHandlerType = emitter.GetEventHandlerType(Info);
// Call constructor of event handler type to create event handler
ConstructorInfo myCtor = eventHandlerType.GetConstructor(new Type[] { typeof(EventInfo) });
object[] ctorArgs = new object[] { Info };
object eventHandler = myCtor.Invoke(ctorArgs);
return eventHandler;
}
示例11: GetEventHandlerType
/// <summary>
/// Emits dynamically a event handler with a given signature, which fills all arguments of the event in an object array
/// and calls a common event.
/// </summary>
/// <returns></returns>
public Type GetEventHandlerType(EventInfo Info)
{
string handlerName = assemblyName + Info.Name;
Type tpEventHandler = (Type)handlerTypes[handlerName];
if (tpEventHandler == null)
{
// Create the type
tpEventHandler = EmitHelperClass(handlerName, Info);
handlerTypes.Add(handlerName, tpEventHandler);
}
return tpEventHandler;
}
示例12: TestMethod1
public void TestMethod1()
{
EventInfo eventinfo = new EventInfo();
eventinfo.Name = "1";
eventinfo.Root = "helo";
eventinfo.Description = "helloo";
eventinfo.Save();
eventinfo = EventInfo.Load(1);
eventinfo.DeleteOnSave();
}
示例13: STElementInfo
public STElementInfo(JSONNode stJson)
{
string spriteName = stJson["sprite"];
m_alwaysSeen = stJson["doShow"].AsBool;
JSONNode color = stJson["color"];
Color col = Color.white;
if(color != null) {
col = new Color(color["r"].AsFloat, color["g"].AsFloat, color["b"].AsFloat);
}
m_spriteName = spriteName;
m_spriteColor = col;
m_eventInfo = new EventInfo(stJson);
}
示例14: LoadEventInfo
public void LoadEventInfo(MobManager mobManager, Storytrack storyTrack, EventInfo info)
{
ClearMobs();
m_st = storyTrack;
m_info = info;
foreach(string mobName in m_info.mobs) {
MobInfo mobInfo = mobManager.GetMobByName(mobName);
Mob mob = CreateMob(mobInfo, transform.position);
if(mob == null) continue;
m_mobs.Add(mob);
}
MoveMobsToSpawns();
}
示例15: ArrayToCommaList
public static string ArrayToCommaList(EventInfo[] ArrayToConvert)
{
string returnString = "";
if (ArrayToConvert.Length > 0)
{
returnString = ArrayToConvert[0].ToString();
for (int i = 1; i < ArrayToConvert.Length; i++)
{
returnString += ", " + ArrayToConvert[i].ToString();
}
}
return returnString;
}