本文整理汇总了C#中EventName.ToDescription方法的典型用法代码示例。如果您正苦于以下问题:C# EventName.ToDescription方法的具体用法?C# EventName.ToDescription怎么用?C# EventName.ToDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventName
的用法示例。
在下文中一共展示了EventName.ToDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: AddGKMessage
public static void AddGKMessage(EventName message, string description, XBase xBase, string userName, bool isAdministrator = false)
{
Guid uid = Guid.Empty;
var journalItemType = JournalItemType.System;
if (xBase != null)
{
if (xBase is XDevice)
{
uid = (xBase as XDevice).UID;
journalItemType = JournalItemType.Device;
}
if (xBase is XZone)
{
uid = (xBase as XZone).UID;
journalItemType = JournalItemType.Zone;
}
if (xBase is XDirection)
{
uid = (xBase as XDirection).UID;
journalItemType = JournalItemType.Direction;
}
if (xBase is XDelay)
{
uid = (xBase as XDelay).UID;
journalItemType = JournalItemType.Delay;
}
if (xBase is XPim)
{
uid = (xBase as XPim).UID;
journalItemType = JournalItemType.Pim;
}
}
var journalItem = new JournalItem()
{
SystemDateTime = DateTime.Now,
DeviceDateTime = DateTime.Now,
JournalItemType = journalItemType,
StateClass = EventNamesHelper.GetStateClass(message),
Name = message.ToDescription(),
Description = description,
ObjectUID = uid,
ObjectStateClass = XStateClass.Norm,
UserName = userName,
SubsystemType = XSubsystemType.System
};
if (xBase != null)
{
journalItem.ObjectName = xBase.PresentationName;
journalItem.GKObjectNo = (ushort)xBase.GKDescriptorNo;
}
GKDBHelper.Add(journalItem);
OnNewJournalItem(journalItem, isAdministrator);
var gkCallbackResult = new GKCallbackResult();
gkCallbackResult.JournalItems.Add(journalItem);
OnGKCallbackResult(gkCallbackResult);
}
示例3: AddFailureJournalItem
void AddFailureJournalItem(EventName name, EventDescription description)
{
var journalItem = new JournalItem()
{
Name = name.ToDescription(),
Description = description.ToDescription(),
StateClass = XStateClass.Unknown,
ObjectStateClass = XStateClass.Norm,
GKIpAddress = GkDatabase.RootDevice.GetGKIpAddress()
};
GKDBHelper.Add(journalItem);
GKCallbackResult.JournalItems.Add(journalItem);
}