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 LightStartForm(LoginForm tLoginForm)
        {
            InitializeComponent();

            LoginForm = tLoginForm;

            TM = new TablesManager();

            MaximumSize = Screen.PrimaryScreen.WorkingArea.Size;

            //CurrentTimeLabel.Text = DateTime.Now.ToString("HH:mm");
            //CurrentDayOfWeekLabel.Text = DateTime.Now.ToString("dddd");
            //CurrentDayMonthLabel.Text = DateTime.Now.ToString("dd MMMM");

            AnimateTimer.Enabled = true;

            UserLabel.Text = Security.CurrentUserRName;

            //UpdatesPanel.Width = UserPanel.Left - UpdatesPanel.Left - 5;

            PhotoBox.Image = UserProfile.GetUserPhoto();

            InfiniumStart = new Infinium.InfiniumStart();
            InfiniumTilesContainer.ItemsDataTable = InfiniumStart.ModulesDataTable;
            InfiniumTilesContainer.MenuItemID     = 0;
            InfiniumTilesContainer.InitializeItems();

            ActiveNotifySystem = new Infinium.ActiveNotifySystem();
            InfiniumNotifyList.ModulesDataTable = InfiniumStart.FullModulesDataTable;

            InfiniumStartMenu.ItemsDataTable = InfiniumStart.MenuItemsDataTable;
            InfiniumStartMenu.InitializeItems();
            InfiniumStartMenu.Selected = 0;

            InfiniumMinimizeList.ModulesDataTable = InfiniumStart.FullModulesDataTable;

            if (InfiniumStart.ModulesDataTable.Select("MenuItemID = 0").Count() == 0)
            {
                InfiniumStartMenu.Selected = 1;
            }

            TopForm = null;
            if (TopForm != null)
            {
                OnLineControl.IamOnline(ActiveNotifySystem.GetModuleIDByForm(TopForm.Name), true);
            }
            else
            {
                OnLineControl.IamOnline(0, true);
            }

            OnLineControl.SetOffline();

            NotifyRefreshT = new NotifyRefresh(FuckingNotify);
            OnlineFuck     = new OnlineFuckingDelegate(GetTopMostAndModuleName);

            NotifyThread = new Thread(delegate() { NotifyCheck(); });
            NotifyThread.Start();

            while (!SplashForm.bCreated)
            {
                ;
            }
        }
Esempio n. 7
0
 public void Update()
 {
     NotifyRefresh?.Invoke();
 }
Esempio n. 8
0
 public override void NextPage()
 {
     Filters.Page++;
     NotifyRefresh?.Invoke();
 }