/// <summary> /// removing handler on remove click /// </summary> /// <param name="path"></param> public void RemoveHandler(string path) { JObject response = new JObject(); response["commandID"] = ((int)CommandEnum.CloseCommand).ToString(); response["args"] = ""; response["path"] = path; client.SendMessage(response.ToString()); }
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()); }
/// <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(); }