Ejemplo n.º 1
0
        public LogModel()
        {
            client        = GUIClient.Instance();
            model_entries = new ObservableCollection <EventLogEntry>();
            //to enable non UI thread to update the collection
            BindingOperations.EnableCollectionSynchronization(model_entries, _lock);
            //enlisting for new log message event case
            client.NewMessage += UpdateLog;
            //sending request for log base
            JObject response = new JObject();

            response["commandID"] = (int)CommandEnum.LogCommand;
            client.SendMessage(response.ToString());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// ctor init as blank and than updating using event (different func)
 /// </summary>
 public ConfigModel()
 {
     client = GUIClient.Instance();
     //update setting on new message event
     client.NewMessage += UpdateSettings;
     //blank properties
     model_OPD = "";
     model_handlers = new ObservableCollection<string>();
     BindingOperations.EnableCollectionSynchronization(model_handlers, _lock);
     model_logName = "";
     model_source = "";
     model_thumbSize = "";
     //requesting config data
     JObject response = new JObject();
     response["commandID"] = (int)CommandEnum.GetConfigCommand;
     client.SendMessage(response.ToString());
     //waiting for update with delay
     Task.Delay(500).Wait();
 }
Ejemplo n.º 3
0
 public MainWindow()
 {
     InitializeComponent();
     //this context is to check if connected to color accordingly
     this.DataContext = GUIClient.Instance();
 }
Ejemplo n.º 4
0
 public HomeModel()
 {
     client = GUIClient.Instance();
 }