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


C# EventName.ToDescription方法代码示例

本文整理汇总了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;
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:16,代码来源:GKDBHelper.cs

示例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);
        }
开发者ID:saeednazari,项目名称:Rubezh,代码行数:58,代码来源:GKProcessorManager.cs

示例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);
		}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:13,代码来源:Watcher.Main.cs


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