Esempio n. 1
0
 public override void BackPage()
 {
     if (Filters.Page > 0)
     {
         Filters.Page--;
     }
     NotifyRefresh?.Invoke();
 }
Esempio n. 2
0
        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();
            }
        }
Esempio n. 3
0
        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());
                }
            }
        }
Esempio n. 4
0
        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();
            }
        }
Esempio n. 5
0
        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();
            }
        }
Esempio n. 6
0
 public void Update()
 {
     NotifyRefresh?.Invoke();
 }
Esempio n. 7
0
 public override void NextPage()
 {
     Filters.Page++;
     NotifyRefresh?.Invoke();
 }