Exemplo n.º 1
0
        public void SendTaskProgressTotal(int count, TotalType totalType)
        {
            var sf = new StackFrame();
            var mn = sf.GetMethod().Name;

            var msgEntity = ProgressInfoMessageBuilder.Create()
                            .WithCallbackMethodName(mn)
                            .WithServiceType(serviceType)
                            .WithTotal(count)
                            .WithTotalType(totalType)
                            .Build();

            distributionFacility.Push(msgEntity);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Noitify mesasge to clients and log it.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="logLevel">The logLevel.</param>
        /// <param name="user">The user.</param>
        protected void NotifyAndLog(string message, LogLevel logLevel, string user)
        {
            var sf        = new StackFrame(2);
            var method    = sf.GetMethod();
            var className = method.DeclaringType.Name;

            var messageEntity = MessageEntityBuilder.Create()
                                .WithServiceType(ServiceType)
                                .WithMsgContent(message)
                                .WithMessageType(EMessageType.Info)
                                .WithUser(user)
                                .WithLogLevel(logLevel.ToString())
                                .WithClassName(className)
                                .WithMethodName(method.Name)
                                .Build();

            distributionFacility.Push(messageEntity);
        }