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


C# EventType类代码示例

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


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

示例1: UpdateData

 public UpdateData(EventType eventType, string message, string imageName, ImageStatus imageStatus)
 {
     this.EventType = eventType;
     this.Message = message;
     this.ImageName = imageName;
     this.ImageStatus = imageStatus;
 }
开发者ID:ToreFranzen,项目名称:janky-juggler,代码行数:7,代码来源:UpdateData.cs

示例2: Event

        /// <summary>
        /// Initializes a new instance of the <see cref="Event" /> class.
        /// </summary>
        /// <param name="msg">The event message to record.</param>
        /// <param name="data">Additional optional data to record. May be null.</param>
        /// <param name="galleryId">The ID of the gallery the <paramref name="msg" /> is associated with. If it is not specific to a gallery
        ///   or the gallery ID is unknown, specify the ID for the template gallery.</param>
        /// <param name="eventType">Type of the event. Defaults to <see cref="Business.EventType.Info" /> when not specified.</param>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when <paramref name="galleryId" /> is <see cref="Int32.MinValue" />.</exception>
        internal Event(string msg, int galleryId, EventType eventType = EventType.Info, Dictionary<string, string> data = null)
        {
            if (galleryId == int.MinValue)
                throw new ArgumentOutOfRangeException("galleryId", string.Format("The galleryId parameter in the Event contructor must represent an existing gallery. Instead, it was {0}", galleryId));

            EventId = int.MinValue;
            EventType = eventType;
            _message = msg;
            _galleryId = galleryId;
            _timeStampUtc = DateTime.UtcNow;

            _exceptionType = String.Empty;
            _source = String.Empty;
            _targetSite = String.Empty;
            _stackTrace = String.Empty;

            _innerExType = String.Empty;
            _innerExMessage = String.Empty;
            _innerExSource = String.Empty;
            _innerExTargetSite = String.Empty;
            _innerExStackTrace = String.Empty;

            if (data != null)
            {
                foreach (var dataItem in data)
                {
                    _eventData.Add(dataItem);
                }
            }

            ExtractVersion();

            ExtractHttpContextInfo();
        }
开发者ID:Jiyuu,项目名称:galleryserverpro,代码行数:43,代码来源:Event.cs

示例3: NotifyMe

        public void NotifyMe(EventType type, object data)
        {
            if (type == EventType.LanguageChanged)
            {
                var lDGridBindingExpr = lDataGridDescription.GetBindingExpression(Label.ContentProperty);
                if (lDGridBindingExpr != null) lDGridBindingExpr.UpdateTarget();

                var tBlockBindingExpr = DateTextBlock.GetBindingExpression(TextBlock.TextProperty);
                if (tBlockBindingExpr != null) tBlockBindingExpr.UpdateTarget();

                var tBlock1BindingExpr = textBlock1.GetBindingExpression(TextBlock.TextProperty);
                if (tBlock1BindingExpr != null) tBlock1BindingExpr.UpdateTarget();
            }
            else
                if (type == EventType.SelectedDateChanged)
                {
                    m_DtList = ((IData)data).DtList;

                    //foreach (var item in m_DtList)
                    //{
                    //    DateTime dt = new DateTime(item.Date.Year, item.Date.Month, item.Date.Day);
                    //    MainCalendar.SelectedDates.Add(dt);
                    //}

                    //menu1.Focus();
                    //bAddNote.Focus();
                }
        }
开发者ID:KrzysztofBrzostowski,项目名称:WPF_Cs_LINQ_EF_Calendar_Notes,代码行数:28,代码来源:MainWindow.xaml.cs

示例4: Accept

 void Accept(EventType type, int num)
 {
     EventType = type;
     EventNumber = num;
     this.DialogResult = DialogResult.OK;
     Close();
 }
开发者ID:joshwyant,项目名称:game-creator,代码行数:7,代码来源:EventForm.cs

示例5: GetText

		public string GetText(string template, string language, EventType type, ApplicationData application,
			byte[] bytes)
		{
			var data = GetTextLocalizedData(type, application, language, bytes);

			return _bulder.GetText(template, language, data);
		}
开发者ID:UHgEHEP,项目名称:test,代码行数:7,代码来源:TextBuilder.cs

示例6: Send

 public static void Send(int clientId, EventType eventType)
 {
     if (null != MonitoringNotificationSended)
     {
         MonitoringNotificationSended(null, new MonitorEventArgs(clientId, eventType, DateTime.Now));
     }
 }
开发者ID:huoxudong125,项目名称:HQF.Tutorial.WCF,代码行数:7,代码来源:EventMonitor.cs

示例7: ConnectListener

        public void ConnectListener(EventType eventType, Delegate listener)
        {
            if (disposed) { return; }
            var ex = events[eventType].CheckListener(listener);
            if (ex != null)
            {
                throw ex;
            }

            if (!ConnectedListeners.ContainsKey(eventType))
            {
                ConnectedListeners[eventType] = new ConcurrentDictionary<int, Delegate>();
            }
            else if (ConnectedListeners[eventType].Values.Contains(listener))
            {
                throw new ArgumentException("'listener' has already been connected to this event type.", "listener");
            }

            if (ConnectedListeners[eventType].Count == 0)
            {
                ConnectedListeners[eventType][0] = listener;
            }
            else
            {
                var index = ConnectedListeners[eventType].Keys.Max() + 1;
                ConnectedListeners[eventType][index] = listener;
            }
        }
开发者ID:thebecwar,项目名称:ChatExchange.Net,代码行数:28,代码来源:EventManager.cs

示例8: Write

        public void Write(EventType eventType, Func<string> logMessage)
        {
            if (eventType >= _minLevel)
            {
                string message;
                try
                {
                    message = logMessage();
                    const int maxLogMessageLength = 10000;
                    if (message.Length > maxLogMessageLength)
                        message = message.Substring(0, maxLogMessageLength)
                            + " ... (trimmed to max " + GetType().Name + " message length of " + maxLogMessageLength + ")";

                    Write(eventType, _eventName, message);
                }
                catch (Exception ex)
                {
                    Write(EventType.Error, GetType().Name, string.Format(
                        "Error while getting the log message ({0}: {1}). {2}",
                        eventType, _eventName, ex.ToString()));
                }
            }

            if (_decoratedLogger != null)
                _decoratedLogger.Write(eventType, logMessage);
        }
开发者ID:kmeze,项目名称:Rhetos,代码行数:26,代码来源:ConsoleLogProvider.cs

示例9: QueueActivity

    public static void QueueActivity(
      string userId, 
      EventType eventType, 
      string message)
    {
      try
      {
        var cloudStorageAccount = 
          CloudStorageAccount.Parse(
            CloudConfigurationManager.GetSetting("StorageConnectionString"));

        var queueReference = 
          cloudStorageAccount.CreateCloudQueueClient()
            .GetQueueReference("activity");

        queueReference.CreateIfNotExists();

        var activity = new Activity
        {
          UserId = userId,
          Event = eventType,
          Date = DateTime.Now,
          Message = message
        };

        var cloudQueueMessage = 
          new CloudQueueMessage(JsonConvert.SerializeObject(activity));

        queueReference.AddMessage(cloudQueueMessage);
      }
      catch (Exception exception)
      {
        Trace.TraceError(exception.Message);
      }
    }
开发者ID:rafaelmtz,项目名称:HeroVsRobot,代码行数:35,代码来源:ActivityService.cs

示例10: ReadProcessData

		public void ReadProcessData(XmlElement xmlElement, CreationContext creationContext)
		{
			DefinitionObjectImpl definitionObject = creationContext.DefinitionObject;

			// first make sure the definitionObject has got an id
			DbSession dbSession = creationContext.DbSession;
			dbSession.SaveOrUpdate(definitionObject);

			// store the reference link to the definitionObject 
			this._definitionObjectId = definitionObject.Id;

			log.Debug("adding action : ");
			log.Debug("  definitionObjectId: " + _definitionObjectId);
			log.Debug("  definitionObject: " + definitionObject);

			this._eventType = EventTypeHelper.fromText(xmlElement.GetAttribute("event"));

			log.Debug("action on eventType '" + _eventType + "' and definitionObject " + creationContext.DefinitionObject);

			// reading the action delegation
			creationContext.DelegatingObject = this;
			this._actionDelegation = new DelegationImpl();
			this._actionDelegation.ReadProcessData(xmlElement, creationContext);
			creationContext.DelegatingObject = null;

			dbSession.SaveOrUpdate(this);
		}
开发者ID:qwinner,项目名称:NetBPM,代码行数:27,代码来源:ActionImpl.cs

示例11: Add

        private ActionResult Add(string projectId, int? transitionId, EventLevel level, EventType eventType, AppUser creator, object item, DateTime? createdOn = null)
        {
            try
            {
                var i = new ProjectHistory
                {
                    CreatedBy = creator,
                    CreatedOn = createdOn ?? DateTime.UtcNow,
                    Description = JsonConvert.SerializeObject(item),
                    Level = level,
                    ProjectId = projectId,
                    TransitionId = transitionId,
                    Type = eventType
                };

                if (!_dbContext.ChangeTracker.Entries().Where(e => e.State != EntityState.Unchanged).Any())
                {
                    _dbContext.ProjectHistory.Add(i);
                    _dbContext.SaveChanges();
                }
                else
                {
                    _dbContext.ProjectHistory.Add(i);
                }

                return ActionResult.Success(item);
            }
            catch(Exception ex)
            {
                return ActionResult.Failed(ex);
            }
        }
开发者ID:PUG-IT,项目名称:06Etanche,代码行数:32,代码来源:ProjectHistoryManager.cs

示例12: PrepareMovement

        public void PrepareMovement(Int64 goTime, double phase, IGamePlugin who, EventType ev, int speed)
        {
            IMovableElement gamePlugin = who as IMovableElement;

            if (gamePlugin != null)
            {
                // Change X, Y coordinates

                if (((MovableEssentials)gamePlugin).ImmediatelyOccupyNewField == false)
                {
                    gamePlugin.InitializeMove((MovementDirection)ev);
                }
                else
                {
                    gamePlugin.FinishMove((MovementDirection)ev);
                }
                
                gamePlugin.MovementStartTime = goTime;
                gamePlugin.MovementStartTimePhase = phase;
                gamePlugin.MovementEndTime = goTime + speed;
                gamePlugin.LastMovementEvent = ev;

                // Forced event!
                MakePlan("PrepMovWentXXX", gamePlugin.MovementEndTime, who, (EventType)((int)ev + 10), true); // goXXX -> wentXXX
            }
        }
开发者ID:MartyIX,项目名称:SoTh,代码行数:26,代码来源:MovableEssentials.cs

示例13: Event

 internal Event(Object obj, EventType type, int num)
 {
     Object = obj;
     EventType = type;
     EventNumber = num;
     Actions = new List<Action>();
 }
开发者ID:MilesBoulanger,项目名称:game-creator,代码行数:7,代码来源:Event.cs

示例14: Notify

 public void Notify(EventType e)
 {
     if (e == EventType.Death)
         _observers.ForEach(o => o.UpdateObserver(_mother.ID, e));
     else if (e == EventType.Birth)
         _observers.ForEach(o => o.UpdateObserver(_pregnancy.ID, e));
 }
开发者ID:thebuchanan3,项目名称:ContinentsCs,代码行数:7,代码来源:PregnantEntity.Control.cs

示例15: SystemExclusiveEvent

        /// <summary>
        /// パラメータを指定して新しい SystemExclusiveEvent クラスのインスタンスを初期化します。
        /// </summary>
        /// <param name="deltaTime">デルタタイム。</param>
        /// <param name="tick">ティック位置。</param>
        /// <param name="type">イベントのタイプ。</param>
        /// <param name="br">読み込まれるバイトリーダ。</param>
        internal SystemExclusiveEvent(int deltaTime, long tick, EventType type, BinaryReader br)
            : base(deltaTime, tick)
        {
            this.Type = type;

            this.Load(br);
        }
开发者ID:nanase,项目名称:ux,代码行数:14,代码来源:SystemExclusiveEvent.cs


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