当前位置: 首页>>代码示例>>C#>>正文


C# EventContext类代码示例

本文整理汇总了C#中EventContext的典型用法代码示例。如果您正苦于以下问题:C# EventContext类的具体用法?C# EventContext怎么用?C# EventContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EventContext类属于命名空间,在下文中一共展示了EventContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnClickList

 void OnClickList(EventContext context)
 {
     //find out if there is an item in edit status
     //查找是否有项目处于编辑状态
     int cnt = _list.numChildren;
     for (int i = 0; i < cnt; i++)
     {
         GButton item = _list.GetChildAt(i).asButton;
         if (item.scrollPane.posX != 0)
         {
             //Check if clicked on the button
             if (item.GetChild("b0").asButton.IsAncestorOf(GRoot.inst.touchTarget)
                 || item.GetChild("b1").asButton.IsAncestorOf(GRoot.inst.touchTarget))
             {
                 return;
             }
             item.scrollPane.SetPosX(0, true);
             //avoid scroll pane default behavior
             //取消滚动面板可能发生的拉动。
             item.scrollPane.CancelDragging();
             _list.scrollPane.CancelDragging();
             break;
         }
     }
 }
开发者ID:fairygui,项目名称:FairyGUI-unity,代码行数:25,代码来源:ScrollPaneMain.cs

示例2: ChangingAnEventDisconnectedDoesNotCreateDuplicates

        public void ChangingAnEventDisconnectedDoesNotCreateDuplicates()
        {
            Event e;
            using (var context = new EventContext())
            {
                var eventUoW = new EventUnitOfWork(context);

                e = new Event();
                e.Brief = "Test";
                e.Detailed = "Test";
                e.ModificationState = ModificationState.Added;
                e.AppUser = context.Users.Single(t => t.UserName == "TestUser");

                eventUoW.Events.Attach(e);
                eventUoW.Save();
            }

            e.Brief = "MyBrief";
            e.Detailed = "MyDetailed";
            e.ModificationState = ModificationState.Modified;

            using (var context = new EventContext())
            {
                var eventUoW = new EventUnitOfWork(context);
                eventUoW.Events.Attach(e);
                eventUoW.Save();
            }

            using (var context = new EventContext())
            {
                context.Invoking(t => t.Events.Single()).ShouldNotThrow();
            }
        }
开发者ID:MissKalani,项目名称:EventsApp,代码行数:33,代码来源:EventRepositoryIntegrationTests.cs

示例3: OnRotate

    void OnRotate(EventContext context)
    {
        DOTween.Kill(_ball);

        RotationGesture gesture = (RotationGesture)context.sender;
        _ball.Rotate(Vector3.forward, -gesture.delta, Space.World);
    }
开发者ID:yinlei,项目名称:Fishing,代码行数:7,代码来源:GestureMain.cs

示例4: EvaluateOnTold

 public double EvaluateOnTold(Character perspectiveCharacter, Character evaluateCharacter, Game game)
 {
     //The perspectiveCharacter is the character performing the query.
     //The evaluateCharacter is the character whose opinion on the information we care about.
     EventContext observeContext = new EventContext(evaluateCharacter, parameters);
     return information.OnTold.Evaluate(game, observeContext, evaluateCharacter.GetWeights(perspectiveCharacter));
 }
开发者ID:jenn0108,项目名称:CourtIntrigue,代码行数:7,代码来源:InformationInstance.cs

示例5: ExecuteEvents

		private void ExecuteEvents(object ex = null)
		{
			var dict = new Dictionary<string, string>();

			foreach(var i in _dataProviders) {
				var results = i.AfterEvent();

				if(results != null) {
					foreach(var j in results) {
						dict[j.Key] = j.Value;
					}
				}
			}
				
			var eventContext = new EventContext(dict)
			{
				Name = _eventMetadata.Name,
				Exception = ex
			};
					
			foreach(var i in _eventHandlers) {
				i.OnEvent(eventContext);
			}

		}
开发者ID:ItsVeryWindy,项目名称:Autofac.Eventing,代码行数:25,代码来源:EventInterceptor.cs

示例6: EventProcessing

        public override void EventProcessing(EventContext context) {
            if (Settings.Current.WebsiteMode == WebsiteMode.Dev)
                return;

            // Throttle errors by client ip address to no more than X every 5 minutes.
            var ri = context.Event.GetRequestInfo();
            if (ri == null || String.IsNullOrEmpty(ri.ClientIpAddress))
                return;

            string throttleCacheKey = String.Concat("bot:", ri.ClientIpAddress, ":", DateTime.Now.Floor(_throttlingPeriod).Ticks);
            var requestCount = _cacheClient.Get<int?>(throttleCacheKey);
            if (requestCount != null) {
                _cacheClient.Increment(throttleCacheKey, 1);
                requestCount++;
            } else {
                _cacheClient.Set(throttleCacheKey, 1, _throttlingPeriod);
                requestCount = 1;
            }

            if (requestCount < Settings.Current.BotThrottleLimit)
                return;

            Log.Info().Message("Bot throttle triggered. IP: {0} Time: {1} Project: {2}", ri.ClientIpAddress, DateTime.Now.Floor(_throttlingPeriod), context.Event.ProjectId).Project(context.Event.ProjectId).Write();
            // the throttle was triggered, go and delete all the errors that triggered the throttle to reduce bot noise in the system
            Task.Run(() => _eventRepository.RemoveAllByClientIpAndDateAsync(ri.ClientIpAddress, DateTime.Now.Floor(_throttlingPeriod), DateTime.Now.Ceiling(_throttlingPeriod)));
            context.IsCancelled = true;
        }
开发者ID:jrheault,项目名称:Exceptionless,代码行数:27,代码来源:ThrottleBotsPlugin.cs

示例7: OnKeyDown

 void OnKeyDown(EventContext context)
 {
     if (context.inputEvent.keyCode == KeyCode.Escape)
     {
         Application.Quit();
     }
 }
开发者ID:yinlei,项目名称:Fishing,代码行数:7,代码来源:BasicsMain.cs

示例8: AsyncLocalNotifyUpdateCallback

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="listener"></param>
 /// <param name="data"></param>
 public AsyncLocalNotifyUpdateCallback(ICacheEventsListener listener, object key, object entry, OperationContext operationContext, EventContext eventContext)
 {
     _listener = listener;
     _key = key;
     _entry = entry;
     _operationContext = operationContext;
     _eventContext = eventContext;
 }
开发者ID:christrotter,项目名称:NCache,代码行数:13,代码来源:CacheBase.cs

示例9: OnPinch

    void OnPinch(EventContext context)
    {
        DOTween.Kill(_ball);

        FairyGUI.PinchGesture gesture = (FairyGUI.PinchGesture)context.sender;
        float newValue = Mathf.Clamp(_ball.localScale.x + gesture.delta, 0.3f, 2);
        _ball.localScale = new Vector3(newValue, newValue, newValue);
    }
开发者ID:yinlei,项目名称:Fishing,代码行数:8,代码来源:GestureMain.cs

示例10: EventUnitOfWork

 public EventUnitOfWork(EventContext context)
 {
     this.context = context;
     Events = new EventRepository(context);
     Users = new UserRepository(context, new UserManager<AppUser, string>(new UserStore<AppUser>(context)));
     Invites = new InviteRepository(context);
     InviteLinks = new InviteLinkRepository(context);
 }
开发者ID:MissKalani,项目名称:EventsApp,代码行数:8,代码来源:EventUnitOfWork.cs

示例11: Calculate

 public double Calculate(EventContext context, Game game)
 {
     double result = 0.0;
     foreach(var part in parts)
     {
         result += part.Calculate(context, game);
     }
     return result;
 }
开发者ID:jenn0108,项目名称:CourtIntrigue,代码行数:9,代码来源:Cacluate.cs

示例12: AsyncBroadcastCustomNotifyRemoval

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="listener"></param>
 /// <param name="data"></param>
 public AsyncBroadcastCustomNotifyRemoval(ClusterCacheBase parent, object key, CacheEntry entry, ItemRemoveReason reason, OperationContext operationContext, EventContext eventContext)
 {
     _parent = parent;
     _key = key;
     _entry = entry;
     _reason = reason;
     _operationContext = operationContext;
     _eventContext = eventContext;
 }
开发者ID:javithalion,项目名称:NCache,代码行数:14,代码来源:AsyncBroadcastCustomNotifyRemoval.cs

示例13: __joystickMove

 void __joystickMove(EventContext context)
 {
     float degree = (float)context.data;
     //-90:up 0:right 90:down 180/-180:left
     if (degree > -90 && degree < 90) //right
         _npc.Translate(0.01f, 0, 0, Space.World);
     else
         _npc.Translate(-0.01f, 0, 0, Space.World);
 }
开发者ID:hxyxj,项目名称:FairyGUI-unity,代码行数:9,代码来源:Main.cs

示例14: Initialize

        public static void Initialize(TestContext testContext)
        {
            var context = new EventContext();
            context.Database.Delete();

            var configuration = new TestMigrationConfiguration();
            var migrator = new DbMigrator(configuration);
            migrator.Update();
        }
开发者ID:MissKalani,项目名称:EventsApp,代码行数:9,代码来源:AssemblyInitialize.cs

示例15: Evaluate

 public bool Evaluate(EventContext context, Game game)
 {
     for(int i = 0; i < subexpressions.Length; ++i)
     {
         if (!subexpressions[i].Evaluate(context, game))
             return false;
     }
     return true;
 }
开发者ID:jenn0108,项目名称:CourtIntrigue,代码行数:9,代码来源:Logic.cs


注:本文中的EventContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。