示例#1
0
 /// <summary>
 /// コンストラクタ。
 /// </summary>
 /// <param name="rec"></param>
 public NeithNotificationModel(NeithNotificationRec rec)
 {
     Rec = rec;
 }
示例#2
0
 /// <summary>
 /// コンストラクタ。
 /// </summary>
 /// <param name="data"></param>
 public NeithLogNotify(NeithNotificationRec data)
     : base(data)
 {
 }
示例#3
0
 public static NeithNotificationRec Create()
 {
     var obj = new NeithNotificationRec();
     obj.ReceptionTime = UniqueTime.UtcNow;
     return obj;
 }
示例#4
0
 public MyExtensibleObject(NeithNotificationRec rec)
 {
     Rec = rec;
 }
示例#5
0
        /// <summary>
        /// ヘッダオブジェクトよりレコードを作成します。
        /// </summary>
        public static NeithNotificationRec FromHeaders(HeaderCollection headers)
        {
            var p = headers.GetHeaderStringValue(HeaderKeys.NOTIFICATION_PRIORITY, false);
            var priority = Neith.Growl.Connector.Priority.Normal;
            if (p != null) {
                int pval = 0;
                bool pok = int.TryParse(p, out pval);
                if (pok && Enum.IsDefined(typeof(Priority), pval))
                    priority = (Priority)pval;
            }
            var text = headers.GetHeaderStringValue(HeaderKeys.NOTIFICATION_TEXT, false);
            if (text == null) text = String.Empty;

            var item = new NeithNotificationRec()
            {
                Name = headers.GetHeaderStringValue(HeaderKeys.NOTIFICATION_NAME, true),
                Icon = headers.GetHeaderResourceValue(HeaderKeys.NOTIFICATION_ICON, false),

                ApplicationName = headers.GetHeaderStringValue(HeaderKeys.APPLICATION_NAME, true),
                ID = headers.GetHeaderStringValue(HeaderKeys.NOTIFICATION_ID, false),
                CoalescingID = headers.GetHeaderStringValue(HeaderKeys.NOTIFICATION_COALESCING_ID, false),
                Priority = priority,
                Sticky = headers.GetHeaderBooleanValue(HeaderKeys.NOTIFICATION_STICKY, false),
                Title = headers.GetHeaderStringValue(HeaderKeys.NOTIFICATION_TITLE, true),
                Text = text,

                EventTime = headers.GetHeaderDateTimeOffsetValue(NeithHeaderKeys.EVENT_TIME, false),
                ProcessKey = headers.GetHeaderStringValue(NeithHeaderKeys.PROCESS_KEY, false),
                User = headers.GetHeaderStringValue(NeithHeaderKeys.USER, false),
                LogText = headers.GetHeaderStringValue(NeithHeaderKeys.LOGTEXT, false),
                Category = headers.GetHeaderStringValue(NeithHeaderKeys.CATEGORY, false),
                Type = headers.GetHeaderStringValue(NeithHeaderKeys.TYPE, false),
                Target = headers.GetHeaderStringValue(NeithHeaderKeys.TARGET, false),
            };
            item.ToExtensibleObject().SetInhertiedAttributesFromHeaders(headers);
            return item;
        }
 /// <summary>
 /// コンストラクタ。
 /// </summary>
 /// <param name="rec"></param>
 public NeithNotificationRecWrapper(NeithNotificationRec rec)
 {
     Rec = rec;
 }