示例#1
0
        private void CreateBackground()
        {
            MyRectangle r = new MyRectangle(MainCanvasStatistics, 600, 320, Color.FromArgb(0, 0, 0, 0), 0, 40, 1);

            r.SetStroke(Color.FromArgb(255, 20, 29, 83));
            chartCanvas = CanvasCreator.CreateCanvas(MainCanvasStatistics, 590, 350, Color.FromArgb(0, 0, 0, 0), 5, 40);
            new MyRectangle(chartCanvas, 600, 1, Color.FromArgb(255, 20, 29, 83), 0, 240);
            new MyRectangle(chartCanvas, 600, 1, Color.FromArgb(255, 20, 29, 83), 0, 160);
            new MyRectangle(chartCanvas, 600, 1, Color.FromArgb(255, 20, 29, 83), 0, 80);
            chartContentCanvas = new Canvas()
            {
                Width = 590, Height = 362
            };
            ScrollViewer sv = ScrollViewerCreator.CreateScrollViewer(chartCanvas, 590, 364, 0, 0, chartContentCanvas);

            sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            scalePercent    = new MyLabel[3];
            scalePercent[0] = new MyLabel(chartCanvas, "", 40, 30, 11, -20, 225, Color.FromArgb(160, 255, 255, 255), Color.FromArgb(0, 0, 0, 0));
            scalePercent[1] = new MyLabel(chartCanvas, "", 40, 30, 11, -20, 145, Color.FromArgb(160, 255, 255, 255), Color.FromArgb(0, 0, 0, 0));
            scalePercent[2] = new MyLabel(chartCanvas, "", 40, 30, 11, -20, 65, Color.FromArgb(160, 255, 255, 255), Color.FromArgb(0, 0, 0, 0));

            CommandParameters parameters = new CommandParameters();

            parameters.StartDate = DateTime.Now.AddDays(-5).ToShortDateString();
            parameters.EndDate   = DateTime.Now.ToShortDateString();
            List <Activity>          activity      = allData_db.GetDailyActivity(parameters);
            List <ActiveApplication> otherActivity = allData_db.GetActiveApplication(parameters, true);

            CreateChartActivity(activity, parameters, otherActivity);
        }
        private void CreateSettingsForm()
        {
            MainCanvasSettings         = CanvasCreator.CreateCanvas(contentPage, 620, 410, Color.FromArgb(255, 30, 39, 93), 10, 10);
            MainCanvasSettings.Opacity = 0;

            new MyRectangle(MainCanvasSettings, 295, 35, Color.FromArgb(255, 0, 125, 255), 0, 0);
            new MyRectangle(MainCanvasSettings, 295, 35, Color.FromArgb(255, 0, 125, 255), 305, 0);
            new MyRectangle(MainCanvasSettings, 276, 25, Color.FromArgb(255, 0, 125, 255), 10, 140);
            new MyLabel(MainCanvasSettings, "Wyjątki aktywnych aplikacji", 295, 30, 13, 0, 4, Color.FromArgb(255, 255, 255, 255), Color.FromArgb(0, 0, 0, 0));
            new MyLabel(MainCanvasSettings, "Zmiana braku aktywnego okna na aplikacje", 295, 30, 13, 305, 4, Color.FromArgb(255, 255, 255, 255), Color.FromArgb(0, 0, 0, 0));
            new MyLabel(MainCanvasSettings, "Dodane wyjątki", 276, 26, 11, 10, 140, Color.FromArgb(255, 255, 255, 255), Color.FromArgb(0, 0, 0, 0));

            exceptionApplicationCanvas = new Canvas()
            {
                Width = 300, Height = 220
            };
            ScrollViewer sv = ScrollViewerCreator.CreateScrollViewer(MainCanvasSettings, 300, 220, 0, 170, exceptionApplicationCanvas);

            nonTitleApplicationCanvas = new Canvas()
            {
                Width = 300, Height = 286
            };
            ScrollViewer sv_2 = ScrollViewerCreator.CreateScrollViewer(MainCanvasSettings, 300, 286, 300, 50, nonTitleApplicationCanvas);

            idAddExceptionApplicationList = new List <string>();
            CreateButtonsAndTextBox();
        }
示例#3
0
        public JoinApplications(ref Canvas canvas)
        {
            this.canvas = canvas;
            mainCanvas  = CanvasCreator.CreateCanvas(canvas, 620, 410, Color.FromArgb(255, 226, 240, 255), 0, 0);
            applicationsWithoutGroup = new Canvas()
            {
                Width = 600, Height = 300,
            };

            loadingWindow = new LoadingWindow(ref this.canvas);
            backgroundWorkerLoadingWindow         = new BackgroundWorker();
            backgroundWorkerLoadingWindow.DoWork += loadingWindow.Load;
            backgroundWorkerLoadingWindow.RunWorkerAsync();

            ScrollViewer sv = ScrollViewerCreator.CreateScrollViewer(mainCanvas, 560, 300, 30, 60, applicationsWithoutGroup);
            MyLabel      labelNonAssignedApplication = new MyLabel(mainCanvas, "Aplikacje bez przypisanej grupy",
                                                                   370, 38, 18, 30, 10, Color.FromArgb(255, 0, 123, 255), Color.FromArgb(200, 0, 56, 255));

            labelNonAssignedApplication.SetFont("Verdana");

            buttonCloseCanvas = ButtonCreator.CreateButton(mainCanvas, "Zamknij", 80, 30, 13, 510, 370,
                                                           Color.FromArgb(255, 0, 123, 255), Color.FromArgb(200, 0, 56, 255), 1);
            buttonCloseCanvas.MouseLeftButtonDown += buttonCloseCanvas_MouseLeftButtonDown;

            var backgroundWorkerUpdateContent = new BackgroundWorker();

            backgroundWorkerUpdateContent.DoWork += UpdateContent;
            backgroundWorkerUpdateContent.RunWorkerAsync();
        }
示例#4
0
        private void buttonShowApplications_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            showApplicationsCanvas       = CanvasCreator.CreateCanvas(canvas, 620, 400, Color.FromArgb(200, 30, 39, 93), 10, 10);
            contentCanvasShowApplication = new Canvas()
            {
                Width = 420, Height = 310, Background = new SolidColorBrush(Color.FromArgb(200, 30, 39, 93))
            };
            ScrollViewerCreator.CreateScrollViewer(showApplicationsCanvas, 420, 310, 80, 40, contentCanvasShowApplication);

            new MyLabel(showApplicationsCanvas, "x", 30, 50, 24, 573, 356, Color.FromArgb(255, 170, 170, 170),
                        Color.FromArgb(255, 70, 70, 70), 0);

            Label buttonExit = ButtonCreator.CreateButton(showApplicationsCanvas, "", 30, 30, 14, 573, 366,
                                                          Color.FromArgb(0, 155, 155, 155), Color.FromArgb(255, 155, 155, 155), 1);

            buttonExit.Background           = new SolidColorBrush(Color.FromArgb(0, 215, 215, 215));
            buttonExit.MouseEnter          += buttonExit_MouseEnter;
            buttonExit.MouseLeave          += buttonExit_MouseLeave;
            buttonExit.MouseLeftButtonDown += buttonCloseShowApplication_MouseLeftButtonDown;
            ButtonCreator.SetToolTip(buttonExit, "Zamknij okno");

            activeGroupId = Convert.ToInt32(((sender as Label).Name).Replace("ID_", ""));
            BackgroundWorker backgroundWorkerUpdateContent = new BackgroundWorker();

            backgroundWorkerUpdateContent.DoWork += LoadContent;
            backgroundWorkerUpdateContent.RunWorkerAsync();
        }
        private void CreateListOfAddedApps()
        {
            applicationInActivity = new Canvas()
            {
                Width = 140, Height = 146, Background = new SolidColorBrush(Color.FromArgb(255, 236, 236, 236))
            };
            ScrollViewer sv = ScrollViewerCreator.CreateScrollViewer(contentCanvas, 140, 146, 440, 60, applicationInActivity);

            sv.Focusable = false;

            new MyLabel(contentCanvas, "Dodane aplikacje", 140, 30, 14, 440, 20,
                        Color.FromArgb(205, 125, 125, 125), Color.FromArgb(200, 255, 255, 255), 0);

            Label buttonDeleteAllApplication = ButtonCreator.CreateButton(contentCanvas, "Usuń wszystkie", 120, 28, 12, 450, 220,
                                                                          Color.FromArgb(255, 255, 255, 255), Color.FromArgb(200, 255, 0, 0), 1);

            ButtonCreator.SetToolTip(buttonDeleteAllApplication, "Usuń wszystkie aplikacje z aktywności");
            buttonDeleteAllApplication.Background           = new SolidColorBrush(Color.FromArgb(120, 255, 93, 93));
            buttonDeleteAllApplication.MouseEnter          += buttonDeleteAllApplication_MouseEnter;
            buttonDeleteAllApplication.MouseLeave          += buttonDeleteAllApplication_MouseLeave;
            buttonDeleteAllApplication.MouseLeftButtonDown += buttonDeleteAllApplication_MouseLeftButtonDown;

            Label buttonEditActivity = ButtonCreator.CreateButton(contentCanvas, "Edytuj aktywność", 120, 28, 12, 450, 260,
                                                                  Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 0, 255, 0), 1);

            buttonEditActivity.Background           = new SolidColorBrush(Color.FromArgb(60, 0, 200, 0));
            buttonEditActivity.MouseEnter          += buttonEditActivity_MouseEnter;
            buttonEditActivity.MouseLeave          += buttonEditActivity_MouseLeave;
            buttonEditActivity.MouseLeftButtonDown += buttonEditActivity_MouseLeftButtonDown;
        }
        public WindowAddTo(Canvas parent, AddTo addTo)
        {
            InitializeComponent();
            IsClosed     = false;
            parentCanvas = parent;
            windowAddTo  = addTo;

            if (parent.Tag is int)
            {
                idMembership = Convert.ToInt32(parent.Tag);
            }
            if (idMembership == 0)
            {
                idApplication = parent.Name.Replace("ID_", "");
            }

            timerAnimation          = new DispatcherTimer();
            timerAnimation.Interval = new TimeSpan(0, 0, 0, 0, 10);
            repeatIntervals         = 0;

            Canvas activity = new Canvas()
            {
                Width = 150, Height = 200,
            };
            ScrollViewer sv = ScrollViewerCreator.CreateScrollViewer(addToCanvas, 150, 200, 0, 0, activity);

            Dictionary <string, string> names = new Dictionary <string, string>();

            if (addTo == AddTo.Activity)
            {
                names = NameActivity_db.GetNameActivityDictionary();
            }
            else if (addTo == AddTo.Group)
            {
                names = Membership_db.GetNameGroupsDictionaryIfIsActive();
            }

            int nextIndex = 0;

            foreach (KeyValuePair <string, string> name in names)
            {
                Label button = ButtonCreator.CreateButton(activity, name.Value, 150, 30, 12, 0, 29 * nextIndex,
                                                          Color.FromArgb(255, 255, 255, 255), Color.FromArgb(200, 255, 255, 255), 1);
                activity.Height += 29;

                button.MouseEnter          += button_MouseEnter;
                button.MouseLeave          += button_MouseLeave;
                button.MouseLeftButtonDown += button_MouseLeftButtonDown;
                button.Name = "ID_" + name.Key;
                nextIndex++;
            }
            activity.Height = ((activity.Height - 200) < 200) ? 200 : activity.Height - 199;

            timerAnimation.Tick += new EventHandler(AnimationAddShow);
            timerAnimation.Start();
        }
示例#7
0
        public ConfigurationGroups(ref Canvas canvas)
        {
            this.canvas = canvas;

            mainCanvas = CanvasCreator.CreateCanvas(canvas, 600, 390, Color.FromArgb(255, 30, 39, 93), 10, 10);
            new MyRectangle(mainCanvas, 600, 35, Color.FromArgb(255, 0, 125, 255), 0, 0);
            new MyLabel(mainCanvas, "Konfiguracje grup", 600, 40, 15, 0, 0, Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 230, 0, 0));

            contentCanvas = new Canvas()
            {
                Width = 300, Height = 316
            };
            ScrollViewer sv = ScrollViewerCreator.CreateScrollViewer(mainCanvas, 300, 316, 0, 50, contentCanvas);

            LoadGroupName();
            CreateControlUser();
        }
示例#8
0
        private void SetConfigurationButton()
        {
            chooseGroupCanvas = new Canvas()
            {
                Width = 200, Height = 126
            };
            ScrollViewer sv = ScrollViewerCreator.CreateScrollViewer(addConfigurationCanvas, 200, 126, 20, 60, chooseGroupCanvas);

            sv.Background = new SolidColorBrush(Color.FromArgb(255, 35, 45, 100));

            chooseGroup = ButtonCreator.CreateButton(addConfigurationCanvas, "Wybierz grupę", 200, 30, 14, 20, 20,
                                                     Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 155, 155, 155));
            chooseGroup.Background           = new SolidColorBrush(Color.FromArgb(50, 0, 125, 255));
            chooseGroup.MouseEnter          += buttonContent_MouseEnter;
            chooseGroup.MouseLeave          += buttonContent_MouseLeave;
            chooseGroup.MouseLeftButtonDown += buttonOpenChooseGroup;


            new MyLabel(addConfigurationCanvas, "x", 30, 50, 24, 573, 356, Color.FromArgb(255, 170, 170, 170),
                        Color.FromArgb(255, 70, 70, 70), 0);

            Label buttonExit = ButtonCreator.CreateButton(addConfigurationCanvas, "", 30, 30, 14, 573, 366,
                                                          Color.FromArgb(0, 155, 155, 155), Color.FromArgb(255, 155, 155, 155), 1);

            buttonExit.Background           = new SolidColorBrush(Color.FromArgb(0, 215, 215, 215));
            buttonExit.MouseEnter          += buttonExit_MouseEnter;
            buttonExit.MouseLeave          += buttonExit_MouseLeave;
            buttonExit.MouseLeftButtonDown += buttonExitConfigure_MouseLeftButtonDown;
            ButtonCreator.SetToolTip(buttonExit, "Zamknij okno");

            MyRectangle background = new MyRectangle(addConfigurationCanvas, 530, 140, Color.FromArgb(0, 244, 244, 255), 20, 200);

            background.SetFillColor(Color.FromArgb(255, 35, 45, 100));
            new MyLabel(addConfigurationCanvas, "Filtr", 50, 30, 14, 20, 209, Color.FromArgb(255, 255, 255, 255),
                        Color.FromArgb(255, 70, 70, 70));
            CreateCheckBox();
            CreateLabelWithInformation();
            CreateAddFilterButton();
            CreateAddFilterAccept();
            CreateApplyFilterButton();
            CreateDeleteApplicationWithFilterButton();
            CreateSaveDeleteConfigureButton();
        }
        private void buttonAddException_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (nameApplicationToException.Visibility == Visibility.Hidden)
            {
                nameApplicationToException.Visibility = Visibility.Visible;
                buttonAcceptAddException.Visibility   = Visibility.Visible;

                searchApplicationCanvas = new Canvas()
                {
                    Width = 300, Height = 252
                };
                showFindElement = ScrollViewerCreator.CreateScrollViewer(MainCanvasSettings, 300, 252, 0, 140, searchApplicationCanvas);
                searchApplicationCanvas.Background = new SolidColorBrush(Color.FromArgb(255, 30, 39, 93));
                buttonAddException.Content         = cancelApplicationToException;
            }
            else
            {
                SetDefaultDesignForException();
            }
        }
        private void CreateChart()
        {
            chartCanvas = new Canvas()
            {
                Width = 500, Height = 290, Background = new SolidColorBrush(Color.FromArgb(0, 236, 200, 200))
            };
            sv         = ScrollViewerCreator.CreateScrollViewer(contentCanvas, 500, 360, 70, 0, chartCanvas);
            scaleLabel = new MyLabel[5];
            sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Visible;

            new MyRectangle(contentCanvas, 500, 1, Color.FromArgb(80, 110, 110, 110), 70, 300);
            new MyRectangle(contentCanvas, 1, 280, Color.FromArgb(80, 110, 110, 110), 70, 20);

            for (int i = 0; i < 4; i++)
            {
                scaleLabel[i] = new MyLabel(contentCanvas, "0", 40, 30, 16, 24, 210 - (60 * i), Color.FromArgb(180, 150, 150, 150), Color.FromArgb(0, 20, 20, 20));
                new MyRectangle(contentCanvas, 30, 1, Color.FromArgb(100, 150, 150, 150), 40, 240 - (60 * i));
            }
            new MyLabel(contentCanvas, "[%]", 40, 30, 16, 30, 0, Color.FromArgb(180, 150, 150, 150), Color.FromArgb(180, 150, 150, 150));
        }
示例#11
0
        public ShowMemberships(ref Canvas canvas)
        {
            this.canvas = canvas;

            mainCanvas = CanvasCreator.CreateCanvas(canvas, 600, 390, Color.FromArgb(255, 30, 39, 93), 10, 10);
            new MyRectangle(mainCanvas, 600, 35, Color.FromArgb(255, 0, 125, 255), 0, 0);
            new MyLabel(mainCanvas, "LP", 30, 30, 13, 2, 2, Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 230, 0, 0));
            new MyLabel(mainCanvas, "Nazwa", 200, 30, 13, 32, 2, Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 230, 0, 0));
            new MyLabel(mainCanvas, "Akcje", 100, 30, 13, 232, 2, Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 230, 0, 0));
            new MyLabel(mainCanvas, "Konfiguracja", 110, 30, 13, 332, 2, Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 230, 0, 0));
            new MyLabel(mainCanvas, "Dodana", 100, 30, 13, 442, 2, Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 230, 0, 0));
            new MyLabel(mainCanvas, "Aktywna", 70, 30, 13, 532, 2, Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 230, 0, 0));


            contentCanvas = new Canvas()
            {
                Width = 600, Height = 310
            };
            ScrollViewer sv = ScrollViewerCreator.CreateScrollViewer(mainCanvas, 600, 310, 0, 45, contentCanvas);

            CreateControlUser();
            LoadGroups();
        }