コード例 #1
0
ファイル: LogModel.cs プロジェクト: barak1224/ImageService
        /// <summary>
        /// C'tor
        /// </summary>
        public LogModel()
        {
            m_logEntries = new ObservableCollection <MessageRecievedEventArgs>();
            m_commands   = new Dictionary <int, CommandExecute>
            {
                { (int)CommandEnum.LogCommand, SetLogEntries }
            };
            communicationHandler = ModelCommunicationHandler.Instance;
            communicationHandler.DataReceived += GetCommand;
            MessageCommand mc = new MessageCommand();

            mc.CommandID  = (int)CommandEnum.LogCommand;
            mc.CommandMsg = "";
            communicationHandler.Client.Send(mc.ToJSON());
            Thread.Sleep(100);
        }
コード例 #2
0
        /// <summary>
        /// C'tor.
        /// </summary>
        public SettingsModel()

        {
            // need to remove this
            m_commands = new Dictionary <int, CommandExecute>
            {
                { (int)CommandEnum.GetConfigCommand, SetConfigSettings },
                { (int)CommandEnum.CloseCommand, RemoveDir }
            };
            communicationHandler = ModelCommunicationHandler.Instance;
            communicationHandler.DataReceived += GetCommand;
            MessageCommand mc = new MessageCommand();

            mc.CommandID  = (int)CommandEnum.GetConfigCommand;
            mc.CommandMsg = "";
            communicationHandler.Client.Send(mc.ToJSON());
            Thread.Sleep(1000);
        }