private void CommandMessage(object sender, CommandMessageEventArgs e)
        {
            if (e.NotifyCode != NativeMethods.THBN_CLICKED)
            {
                return;
            }

            switch (e.ControlID)
            {
            case 1:
                FirstImage();
                break;

            case 2:
                PreviousImage();
                break;

            case 3:
                NextImage();
                break;

            case 4:
                LastImage();
                break;
            }
        }
示例#2
0
        /// <summary>
        /// The Function is processing the incoming messages from the server
        /// </summary>
        /// <param name="sender">The source of the message</param>
        /// <param name="e">The CommandMessageEventArgs arguments that were
        ///                 send along the message</param>
        public void ProcessMessage(object sender, CommandMessageEventArgs e)
        {
            //Extract the message from the EventArgs
            CommandMessage msg = e.Message;

            switch (msg.Type)
            {
            //Checking if the message is interesting to the Logs
            case CommandEnum.LogAdded:
                foreach (LogMessage log in msg.LogMessages)
                {
                    if (Logs.Count >= 2048)
                    {
                        Logs.RemoveAt(0);
                    }
                    Logs.Add(log);
                }
                lock (waitForUpdateLock)
                {
                    Monitor.PulseAll(waitForUpdateLock);
                }
                break;

            default:
                break;
            }
        }
示例#3
0
        /// <summary>
        /// Processes the message.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The instance containing the event data, arguments</param>
        public void ProcessMessage(object sender, CommandMessageEventArgs e)
        {
            //Extract the message from the EventArgs
            CommandMessage msg = e.Message;

            switch (msg.Type)
            {
            //Checking if the message is interesting to the Settings
            case CommandEnum.AddHandler:
                foreach (string handler in msg.Handlers)
                {
                    Handlers.Add(handler);
                }
                break;

            case CommandEnum.RemoveHandler:
                foreach (string handler in msg.Handlers)
                {
                    Handlers.Remove(handler);
                }
                break;

            case CommandEnum.ConfigMessage:
                OutputDir  = msg.OutputDir;
                SourceName = msg.LogSource;
                LogName    = msg.LogName;
                ThumbSize  = msg.ThumbSize.ToString();
                Handlers   = new List <string>();
                foreach (string handler in msg.Handlers)
                {
                    Handlers.Add(handler);
                }
                Handlers.RemoveAll(item => String.IsNullOrWhiteSpace(item));
                lock (waitForUpdateLock)
                {
                    Monitor.PulseAll(waitForUpdateLock);
                }
                break;

            default:
                break;
            }
        }
        /// <summary>
        /// Processes the message.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">instance containing the event data, arguments</param>
        public void ProcessMessage(object sender, CommandMessageEventArgs e)
        {
            //Extract the message from the EventArgs
            CommandMessage msg = e.Message;

            switch (msg.Type)
            {
            //Checking if the message is interesting to RemoveHandler
            case CommandEnum.RemoveHandler:
                foreach (string handler in msg.Handlers)
                {
                    removedHandlers.Add(handler);
                }
                lock (waitForUpdateLock)
                {
                    Monitor.PulseAll(waitForUpdateLock);
                }
                break;
            }
        }
        public void ProcessMessage(object sender, CommandMessageEventArgs e)
        {
            //Extract the message from the EventArgs
            CommandMessage msg = e.Message;

            switch (msg.Type)
            {
            //Checking if the message is interesting to the Settings
            case CommandEnum.AddHandler:
                foreach (string handler in msg.Handlers)
                {
                    Handlers.Add(handler);
                }
                NotifyPropertyChanged("Handlers");
                break;

            case CommandEnum.RemoveHandler:
                foreach (string handler in msg.Handlers)
                {
                    Handlers.Remove(handler);
                }
                NotifyPropertyChanged("Handlers");
                break;

            case CommandEnum.ConfigMessage:
                OutputDir  = msg.OutputDir;
                SourceName = msg.LogSource;
                LogName    = msg.LogName;
                ThumSize   = msg.ThumbSize.ToString();
                foreach (string handler in msg.Handlers)
                {
                    Handlers.Add(handler);
                }
                NotifyPropertyChanged("Handlers");
                break;

            default:
                break;
            }
        }
        private void CommandMessage(object sender, CommandMessageEventArgs e)
        {
            if (e.NotifyCode != NativeMethods.THBN_CLICKED)
            {
                return;
            }

            switch (e.ControlID)
            {
                case 1:
                    FirstImage();
                    break;
                case 2:
                    PreviousImage();
                    break;
                case 3:
                    NextImage();
                    break;
                case 4:
                    LastImage();
                    break;
            }
        }
示例#7
0
        public void ProcessMessage(object sender, CommandMessageEventArgs e)
        {
            //Extract the message from the EventArgs
            CommandMessage msg = e.Message;

            switch (msg.Type)
            {
            //Checking if the message is interesting to the Logs
            case CommandEnum.LogAdded:
                foreach (LogMessage log in msg.LogMessages)
                {
                    if (Logs.Count >= 2048)
                    {
                        Logs.RemoveAt(0);
                    }
                    Logs.Add(log);
                    NotifyPropertyChanged("Logs");
                }
                break;

            default:
                break;
            }
        }