public override void BackPage() { if (Filters.Page > 0) { Filters.Page--; } NotifyRefresh?.Invoke(); }
public void GetMessageFromClient(object sender, string crea) { CommandRecievedEventArgs command = CommandRecievedEventArgs.FromJson(crea); if (command.CommandID == (int)CommandEnum.GetConfigCommand) { string m = command.Args[0]; JObject json = JObject.Parse(m); OutputDir = (string)json["OutputDir"]; string[] studs = ((string)json["Students"]).Split(';'); Students = new ObservableCollection <Student>(); foreach (string s in studs) { Students.Add(Student.fromString(s)); } NotifyRefresh?.Invoke(); } }
public void GetMessageFromClient(object sender, string message) { //If message if log - handle and notify, else ignore. CommandRecievedEventArgs command = CommandRecievedEventArgs.FromJson(message); if (command.CommandID == (int)CommandEnum.LogCommand) { ObservableCollection <LogType> list = new ObservableCollection <LogType>(); string[] logsStrings = command.Args[0].Split(';'); foreach (string s in logsStrings) { if (s.Contains("Status") && s.Contains("Message")) { try { MessageRecievedEventArgs m = MessageRecievedEventArgs.FromJson(s); list.Add(LogType.LogTypeFromMessageRecieved(m)); } catch (Exception e) { continue; } } } Logs = list; NotifyRefresh?.Invoke(); } else if (command.CommandID == (int)CommandEnum.NewLogEntryCommand) { try { MessageRecievedEventArgs m = MessageRecievedEventArgs.FromJson(command.Args[0]); ObservableCollection <LogType> tempList = new ObservableCollection <LogType>(Logs); tempList.Add(LogType.LogTypeFromMessageRecieved(m)); this.Logs = tempList; NotifyRefresh?.Invoke(); } catch (Exception e) { Console.WriteLine(e.ToString()); } } }
public void GetMessageFromClient(object sender, string crea) { CommandRecievedEventArgs command = CommandRecievedEventArgs.FromJson(crea); if (command.CommandID == (int)CommandEnum.RemovePhoto) { string thumbPath = command.Args[0]; if (ThumbnailsPath.Contains(thumbPath)) { ThumbnailsPath.Remove(thumbPath); foreach (PhotosInfo p in Photos) { if (p.ThumbPath.Equals(thumbPath)) { Photos.Remove(p); } } } NotifyRefresh?.Invoke(); } }
public void GetMessageFromClient(object sender, string crea) { Debug.WriteLine("recieved" + crea); CommandRecievedEventArgs command = CommandRecievedEventArgs.FromJson(crea); if (command.CommandID == (int)CommandEnum.GetConfigCommand) { string m = command.Args[0]; JObject json = JObject.Parse(m); OutputDir = (string)json["OutputDir"]; SourceName = (string)json["SourceName"]; ThumbnailSize = int.Parse((string)json["ThumbnailSize"]); LogName = (string)json["LogName"]; StudentsString = (string)json["Students"]; UpdateHandlersFromString((string)json["Handler"]); NotifyRefresh?.Invoke(); } else if (command.CommandID == (int)CommandEnum.CloseCommand) { UpdateHandlersFromString(command.Args[0]); NotifyRefresh?.Invoke(); } }
public void Update() { NotifyRefresh?.Invoke(); }
public override void NextPage() { Filters.Page++; NotifyRefresh?.Invoke(); }