Exemple #1
0
        // 因为是上下文路径,无需返回路径标识
        public static void BuildEventPath <TEvent>(string description, LogEnum logType, Type location, PathPriority priority, Action <TEvent> path)
            where TEvent : IEvent
        {
            var messagePathId = VirtualRoot.BuildMessagePath(description, logType, location, priority, path);

            _contextPathIds.Add(messagePathId);
        }
Exemple #2
0
        // 因为是上下文路径,无需返回路径标识
        public static void BuildCmdPath <TCmd>(string description, LogEnum logType, Action <TCmd> path, Type location)
            where TCmd : ICmd
        {
            var messagePathId = VirtualRoot.BuildMessagePath(description, logType, path, location);

            _contextPathIds.Add(messagePathId);
        }
Exemple #3
0
        public static void BuildCmdPath <TCmd>(this Window window, LogEnum logType, Action <TCmd> path, Type location)
            where TCmd : ICmd
        {
            if (WpfUtil.IsInDesignMode)
            {
                return;
            }
            if (window.Resources == null)
            {
                window.Resources = new ResourceDictionary();
            }
            List <IMessagePathId> messagePathIds = (List <IMessagePathId>)window.Resources[messagePathIdsResourceKey];

            if (messagePathIds == null)
            {
                messagePathIds = new List <IMessagePathId>();
                window.Resources.Add(messagePathIdsResourceKey, messagePathIds);
                window.Closed += UiElement_Closed;
            }
            MessageTypeAttribute messageTypeDescription = MessageTypeAttribute.GetMessageTypeAttribute(typeof(TCmd));
            string description   = "处理" + messageTypeDescription.Description;
            var    messagePathId = VirtualRoot.BuildMessagePath(description, logType, path, location);

            messagePathIds.Add(messagePathId);
        }
        public static void BuildEventPath <TEvent>(this Window window, string description, LogEnum logType, Type location, PathPriority priority, Action <TEvent> path)
            where TEvent : IEvent
        {
            if (WpfUtil.IsInDesignMode)
            {
                return;
            }
            if (window.Resources == null)
            {
                window.Resources = new ResourceDictionary();
            }
            List <IMessagePathId> messagePathIds = (List <IMessagePathId>)window.Resources[messagePathIdsResourceKey];

            if (messagePathIds == null)
            {
                messagePathIds = new List <IMessagePathId>();
                window.Resources.Add(messagePathIdsResourceKey, messagePathIds);
                window.Closed += UiElement_Closed;;
            }
            var messagePathId = VirtualRoot.BuildMessagePath(description, logType, location, priority, path);

            messagePathIds.Add(messagePathId);
        }