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()); }
public GameControl(IGUIClient guiClient) { this.guiClient = guiClient; score = new Score(); score.AddObserver(this); playTimer = new PlayTimer(this, this); playTimer.AddObserver(this); gameIsPaused = true; colorThemes = new ColorThemes(); highscore = new Highscore(); }
/// <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(); }
public HomeModel() { client = GUIClient.Instance(); }