本文整理汇总了C#中EventName类的典型用法代码示例。如果您正苦于以下问题:C# EventName类的具体用法?C# EventName怎么用?C# EventName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EventName类属于命名空间,在下文中一共展示了EventName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetStateClass
public static XStateClass GetStateClass(EventName eventName)
{
switch (eventName)
{
case (EventName.Подтверждение_тревоги):
case (EventName.Смена_пользователя):
case (EventName.Вход_пользователя_в_систему):
case (EventName.Выход_пользователя_из_системы):
case (EventName.Зависание_процесса_отпроса):
case (EventName.Отсутствует_лицензия):
case (EventName.Лицензия_обнаружена):
case (EventName.Ошибка_инициализации_мониторинга):
case (EventName.Применение_конфигурации):
return XStateClass.Norm;
case (EventName.Обновление_ПО_прибора):
case (EventName.Запись_конфигурации_в_прибор):
case (EventName.Чтение_конфигурации_из_прибора):
case (EventName.Синхронизация_времени):
case (EventName.Запрос_информации_об_устройсве):
case (EventName.Команда_оператора):
case (EventName.Отмена_операции):
case (EventName.ГК_в_технологическом_режиме):
case (EventName.ГК_в_рабочем_режиме):
return XStateClass.Info;
case (EventName.Ошибка_при_выполнении_команды):
case (EventName.Ошибка_при_выполнении_команды_над_устройством):
return XStateClass.Failure;
default:
return XStateClass.Unknown;
}
}
示例2: Equals_WhenComparingEquivalentValues_ReturnsTrue
public void Equals_WhenComparingEquivalentValues_ReturnsTrue()
{
var left = new EventName(SomeTestEvents.TestRequest);
var right = new EventName(SomeTestEvents.TestRequest);
bool result = left.Equals(right);
Assert.That(result, Is.True);
}
示例3: GetEventName
private static string GetEventName(EventName eventName)
{
switch (eventName)
{
case EventName.Help:
return "";
case EventName.SimpleSend:
return "Workshare Protect - Send Clicked";
case EventName.AdvancedSend:
return "Advanced Email Security Options - Send Clicked";
case EventName.AdvancedCancel:
return "Advanced Email Security Options Cancel";
default:
throw new Exception("Invalid event name");
}
}
示例4: AddMessage
public static JournalItem AddMessage(EventName name, string userName)
{
var journalItem = new JournalItem()
{
SystemDateTime = DateTime.Now,
DeviceDateTime = DateTime.Now,
JournalItemType = JournalItemType.System,
StateClass = XStateClass.Norm,
Name = name.ToDescription(),
ObjectStateClass = XStateClass.Norm,
UserName = userName,
SubsystemType = XSubsystemType.System
};
Add(journalItem);
return journalItem;
}
示例5: SendEvent
public static void SendEvent(EventName eventName, Dictionary<string, object> properties = null)
{
try
{
var analyticEvent = new AnalyticEvent()
{
EventName = GetEventName(eventName),
EventProperties = properties
};
analyticEvent.RaiseEvent();
}
catch (Exception ex)
{
Logger.LogError(ex);
}
}
示例6: it_should_parse_event_messages
public void it_should_parse_event_messages(string input, EventName eventName)
{
var parser = new Parser();
var rawInput = input.Replace("\r\n", "\n") + "\n\n";
foreach (char c in rawInput)
{
parser.Append(c);
}
Assert.True(parser.Completed);
var eventMessage = new EventMessage(parser.ExtractMessage());
Assert.NotNull(eventMessage);
Assert.Equal(eventName, eventMessage.EventName);
Console.WriteLine(eventMessage.ToString());
}
示例7: SendGesture2Finger
private void SendGesture2Finger(EventName message, Gesture gesture)
{
// Sent to user GameObject
if (receiverObject!=null){
if (receiverObject != gesture.pickObject){
receiverObject.SendMessage(message.ToString(), gesture,SendMessageOptions.DontRequireReceiver );
}
}
// Sent to the GameObject who is selected
if ( gesture.pickObject!=null){
gesture.pickObject.SendMessage(message.ToString(), gesture,SendMessageOptions.DontRequireReceiver );
}
// sent to gameobject
else{
SendMessage(message.ToString(), gesture,SendMessageOptions.DontRequireReceiver);
}
}
示例8: CmdTellServerSelectEvent
void CmdTellServerSelectEvent(EventName value, bool is_durian_boom)
{
select_event_ = value;
is_create_durian_boom_ = is_durian_boom;
}
示例9: RandEvent
void RandEvent()
{
if (time_limitter_ == null) return;
Debug.Log(game_start_director_.IsStart);
Debug.Log(game_start_director_.isLocalPlayer);
if (!game_start_director_.IsStart) return;
var time = time_limitter_.LimitCount;
if (time_ == time) return;
if (time == 60) return;
if (time <= 0) return;
if (time % TIME_BALANCE == 0)
{
switch (select_event_)
{
case EventName.DURIAN_BOMB:
if (is_create_durian_boom_)
{
FindObjectOfType<FruitCreater>().DorianCreate();
}
break;
case EventName.KUDAMON_BOUND:
FindObjectOfType<BounceKudamon>().Starter();
break;
case EventName.KUDAMON_RUSH:
FindObjectOfType<RushEventer>().StartEvent();
break;
}
time_ = time;
}
if(time == 50 || time == 30)
{
if (!isServer) return;
var select_event = (EventName)Random.Range(0, (int)EventName.EVENT_MAX);
var is_durian_boom = MyRandom.RandomBool();
select_event_ = select_event;
is_create_durian_boom_ = is_durian_boom;
CmdTellServerSelectEvent(select_event, is_durian_boom);
}
}
示例10: RemoveEventNotify
public void RemoveEventNotify(EventName Name, EventNotify Event)
{
List<EventNotify> L;
lock (_Notify)
{
if (_Notify.TryGetValue(Name.ToString(), out L))
L.Remove(Event);
}
lock (_ForceNotify)
{
if (_ForceNotify.TryGetValue(Name.ToString(), out L))
L.Remove(Event);
}
}
示例11: RpcSetSelectEvent
public void RpcSetSelectEvent(EventName value, bool is_durian_boom)
{
select_event_ = value;
is_create_durian_boom_ = is_durian_boom;
}
示例12: CreateGesture2Finger
private void CreateGesture2Finger(EventName message,Vector2 startPosition,Vector2 position,Vector2 deltaPosition,
float actionTime, SwipeDirection swipe, float swipeLength,Vector2 swipeVector,float twist,float pinch, float twoDistance){
bool firingEvent = true;
Gesture gesture = new Gesture();
gesture.isOverGui = false;
// NGui
if (enabledNGuiMode && message == EventName.On_TouchStart2Fingers){
gesture.isOverGui = gesture.isOverGui || ( IsTouchOverNGui(twoFinger.position) && IsTouchOverNGui(twoFinger.position));
}
gesture.touchCount=2;
gesture.fingerIndex=-1;
gesture.startPosition = startPosition;
gesture.position = position;
gesture.deltaPosition = deltaPosition;
gesture.actionTime = actionTime;
gesture.deltaTime=Time.deltaTime;
gesture.swipe = swipe;
gesture.swipeLength = swipeLength;
gesture.swipeVector = swipeVector;
gesture.deltaPinch = pinch;
gesture.twistAngle = twist;
gesture.twoFingerDistance = twoDistance;
gesture.pickedObject = twoFinger.pickedObject;
gesture.pickedCamera = twoFinger.pickedCamera;
gesture.isGuiCamera= twoFinger.isGuiCamera;
if (autoUpdatePickedObject){
if (message != EventName.On_Drag && message != EventName.On_DragEnd && message != EventName.On_Twist && message != EventName.On_TwistEnd && message != EventName.On_Pinch && message != EventName.On_PinchEnd
&& message != EventName.On_PinchIn && message != EventName.On_PinchOut){
if (GetTwoFingerPickedObject()){
gesture.pickedObject = pickedObject.pickedObj;
gesture.pickedCamera = pickedObject.pickedCamera;
gesture.isGuiCamera= pickedObject.isGUI;
}
else{
twoFinger.ClearPickedObjectData();
}
}
}
gesture.pickedUIElement = twoFinger.pickedUIElement;
gesture.isOverGui = twoFinger.isOverGui;
if (allowUIDetection && autoUpdatePickedUI){
if (message != EventName.On_Drag && message != EventName.On_DragEnd && message != EventName.On_Twist && message != EventName.On_TwistEnd && message != EventName.On_Pinch && message != EventName.On_PinchEnd
&& message != EventName.On_PinchIn && message != EventName.On_PinchOut){
if (message == EventName.On_SimpleTap2Fingers)
if (GetTwoFingerPickedUIElement()){
gesture.pickedUIElement = pickedObject.pickedObj;
gesture.isOverGui = true;
}
else{
twoFinger.ClearPickedUIData();
}
}
}
// Firing event ?
if ((enableUIMode || (enabledNGuiMode && allowUIDetection) ) ){
firingEvent = !gesture.isOverGui;
}
// Firing event
if ( firingEvent){
RaiseEvent(message, gesture);
}
else if (gesture.isOverGui){
if (message == EventName.On_TouchUp2Fingers){
RaiseEvent(EventName.On_UIElementTouchUp, gesture);
}
else{
RaiseEvent(EventName.On_OverUIElement, gesture);
}
}
}
示例13: CreateGesture
private void CreateGesture(int touchIndex,EventName message,Finger finger, SwipeDirection swipe, float swipeLength, Vector2 swipeVector){
bool firingEvent = true;
if (autoUpdatePickedUI && allowUIDetection){
finger.isOverGui = IsScreenPositionOverUI( finger.position );
finger.pickedUIElement = GetFirstUIElementFromCache();
}
// NGui
if (enabledNGuiMode && message == EventName.On_TouchStart){
finger.isOverGui = finger.isOverGui || IsTouchOverNGui(finger.position);
}
// firing event ?
if ((enableUIMode || enabledNGuiMode)){
firingEvent = !finger.isOverGui;
}
// The new gesture
Gesture gesture = finger.GetGesture();
// Auto update picked object
if (autoUpdatePickedObject && autoSelect){
if (message != EventName.On_Drag && message != EventName.On_DragEnd && message != EventName.On_DragStart){
if (GetPickedGameObject(finger)){
gesture.pickedObject = pickedObject.pickedObj;
gesture.pickedCamera = pickedObject.pickedCamera;
gesture.isGuiCamera = pickedObject.isGUI;
}
else{
gesture.pickedObject = null;
gesture.pickedCamera = null;
gesture.isGuiCamera = false;
}
}
}
gesture.swipe = swipe;
gesture.swipeLength = swipeLength;
gesture.swipeVector = swipeVector;
gesture.deltaPinch = 0;
gesture.twistAngle = 0;
// Firing event
if ( firingEvent){
RaiseEvent(message, gesture);
}
else if (finger.isOverGui){
if (message == EventName.On_TouchUp){
RaiseEvent(EventName.On_UIElementTouchUp, gesture);
}
else{
RaiseEvent(EventName.On_OverUIElement, gesture);
}
}
}
示例14: AddEventNotify
public void AddEventNotify(EventName Name, EventNotify Event)
{
AddEventNotify(Name, Event, false);
}
示例15: RunEventSchedule
public override void RunEventSchedule( EventName objEventName )
{
if( Enabled )
{
Scheduler.CoreScheduler s = new Scheduler.CoreScheduler( Debug, MaxThreads );
Scheduler.CoreScheduler.RunEventSchedule( objEventName );
}
}