Ejemplo n.º 1
0
        //Removes all controls except new log control
        public void removePanelControls()
        {
            logPanel.Controls.Clear();
            Logs.Clear();
            NewLog newLogControl = new NewLog();

            newLogControl.Width       = 115;
            newLogControl.Height      = 115;
            newLogControl.Location    = new Point(3, 3);
            newLogControl.MouseClick += newLog1_MouseClick;
            logPanel.Controls.Add(newLogControl);
        }
Ejemplo n.º 2
0
        public void fillTheLogsByName(string name)
        {
            int res       = 0;
            int logStartX = 3;
            int logStartY = 3;

            logPanel.Controls.Clear();
            NewLog newLogControl = new NewLog();

            newLogControl.Width       = 115;
            newLogControl.Height      = 115;
            newLogControl.Location    = new Point(3, 3);
            newLogControl.MouseClick += newLog1_MouseClick;
            logPanel.Controls.Add(newLogControl);
            if (LogOperations.areThereLogsOfThisUser(activeUser))
            {
                Dictionary <string, string> LogInfo = LogOperations.getThisUsersLogsInfo(activeUser);
                DirectoryInfo DirInfo = new DirectoryInfo(Application.StartupPath + @"\Data\Logs");
                FileInfo[]    Files   = DirInfo.GetFiles("*.txt");
                for (int i = 0; i < Files.Length; i++)
                {
                    if (Files[i].Name.Contains(Encryption.MD5encryption(this.activeUser)))
                    {
                        string[] info = LogInfo[Files[i].Name.Replace(Encryption.MD5encryption(this.activeUser), "").Replace(".txt", "")].Split('@');
                        if ((info[0].Contains(name) || info[0] == name) && Logs.ContainsValue(info[0]))
                        {
                            logStartX += 150;
                            if (logStartX > 900)
                            {
                                logStartX  = logStartX % 900;
                                logStartY += 200;
                            }
                            createLog(logStartX, logStartY, info[0]);
                            res++;
                        }
                    }
                }
            }
            sortText.Text = "Sorted by name : " + name;
            result        = res;
        }