本文整理汇总了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;
}
示例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();
}
示例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();
}
}
示例4: Accept
void Accept(EventType type, int num)
{
EventType = type;
EventNumber = num;
this.DialogResult = DialogResult.OK;
Close();
}
示例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);
}
示例6: Send
public static void Send(int clientId, EventType eventType)
{
if (null != MonitoringNotificationSended)
{
MonitoringNotificationSended(null, new MonitorEventArgs(clientId, eventType, DateTime.Now));
}
}
示例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;
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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
}
}
示例13: Event
internal Event(Object obj, EventType type, int num)
{
Object = obj;
EventType = type;
EventNumber = num;
Actions = new List<Action>();
}
示例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));
}
示例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);
}