本文整理汇总了C#中EventTypes.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# EventTypes.ToString方法的具体用法?C# EventTypes.ToString怎么用?C# EventTypes.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventTypes
的用法示例。
在下文中一共展示了EventTypes.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UniEvent
public UniEvent(EventTypes type)
{
Type = type;
Actions = new List<UniAction>();
Options = new JSONObject();
Options.AddField("type", Type.ToString());
}
示例2: EventHandlerProperty
public EventHandlerProperty(EventTypes eventType)
: base()
{
EventType = eventType;
TargetValueType = mdr.ValueTypes.Function;
//We should static or constants in the following methods to avoid expensive delegates!
OnGetDValue = (mdr.DObject This, ref mdr.DValue v) =>
{
var eventListeners = GetEventListeners(This, eventType);
var idlListener = eventListeners.IdlListener;
if (idlListener != null)
v.Set(idlListener);
else
v.Set(mdr.Runtime.Instance.DefaultDNull);
};
OnSetDValue = (mdr.DObject This, ref mdr.DValue v) =>
{
var eventListeners = GetEventListeners(This, eventType);
Debug.WriteLine("Setting the IDL listener for event type " + eventType.ToString() + " : type " + v.ValueType.ToString());
var idlListener = (v.ValueType == mdr.ValueTypes.Function) ? v.AsDFunction() : null;
eventListeners.IdlListener = idlListener;
};
}
示例3: CreateEventComment
XComment CreateEventComment( EventTypes aType, int aParameter )
{
string parameter = null;
Dictionary<int, string> parameterNames;
if ( aType == EventTypes.Create || aType == EventTypes.Destroy || aType == EventTypes.Draw )
return new XComment( "Node below refers to an event of type " + aType.ToString() );
else if ( aType == EventTypes.Alarm )
parameter = aParameter.ToString();
else if ( aType == EventTypes.Collision )
parameter = FindResourceName( m_gmk.Objects, aParameter );
else if ( aType == EventTypes.Keyboard || aType == EventTypes.KeyPress || aType == EventTypes.KeyRelease )
parameter = GetKeyName( aParameter );
else if ( aType == EventTypes.Trigger )
parameter = FindResourceName( m_gmk.Triggers, aParameter );
else if ( EventTable.TryGetValue( aType, out parameterNames ) )
parameter = parameterNames[aParameter];
else if ( aType == EventTypes.Other ) {
if ( aParameter >= 40 && aParameter <= 47 )
parameter = "Outside view " + (aParameter - 40);
else if ( aParameter >= 50 && aParameter <= 57 )
parameter = "Boundary view " + (aParameter - 50);
} else
return null;
return new XComment( "Node below refers to an event of type \"" + aType.ToString() +
"\" with parameter \"" + parameter + '"' );
}
示例4: GetEventInstanceByType
public static UniEvent GetEventInstanceByType(EventTypes type)
{
return (UniEvent)Activator.CreateInstance("Assembly-CSharp", "UniMaker.Events.Event" + type.ToString()).Unwrap();
}