public static void InitAlwaysThereButtons()
        {
            string mojeDanePath = ButtonPathGenerator.GetMyDataPath();
            string AllDanePath  = ButtonPathGenerator.GetAllDataPath();

            AlwaysThereButtons = new List <ButtonFacade>
            {
                new MyDataItem("Moje Dane", mojeDanePath, "Inne")
                {
                    GroupId = 2, CanDelete = false, TagName = MojeDaneTag
                },
                new ButtonFacade {
                    Path = AllDanePath, Name = "All Dane", GroupId = 2, CanDelete = false, TagName = AllDaneTag
                },
                new MyDataItem("Moje Screeny", mojeDanePath, "Screeny")
                {
                    GroupId = 2, CanDelete = false, TagName = ScreenyTag
                },
                new MyDataNotes("Moje Notatki", mojeDanePath, "Notatki")
                {
                    GroupId = 2, CanDelete = false, TagName = NotatkiTag
                },
            };
        }
Beispiel #2
0
 public void InitData()
 {
     ButtonPathGenerator.InitDailyNotes();
     Path = ButtonPathGenerator.GetNotesPath();
 }
Beispiel #3
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            //create the notifyicon (it's a resource declared in NotifyIconResources.xaml
            NotifyIcon = (TaskbarIcon)FindResource("NotifyIcon");

            Screener screener = new Screener(); //to make screen

            List <ShortcutModel> Shurtcuts = new List <ShortcutModel>
            {
                new ShortcutModel()
                {
                    Name                         = "Kombajn do pracy",
                    Describes                    = "Skrótowe wejście w potrzebne foldery",
                    AllModifs                    = false,
                    SelectedModificator          = ModificatorNumeration.Ctrl,
                    AlternateSelectedModificator = ModificatorNumeration.None,
                    KeyCode                      = "1",
                    actionOnClick                = () =>
                    {
                        string kombajnDoPracyPath = @"C:\Users\dante\source\Repos 2020\KombajnyDeluxe\KombajnyDeluxe\bin\Release\KombajnDoPracy.exe";
                        Process.Start(kombajnDoPracyPath);
                    }
                },

                new ShortcutModel()
                {
                    Name                         = "Screener",
                    Describes                    = "Robi screena aktualnego monitora i wrzuca go do folderu zbiorczego z innymi screenami",
                    AllModifs                    = false,
                    SelectedModificator          = ModificatorNumeration.Ctrl,
                    AlternateSelectedModificator = ModificatorNumeration.None,
                    KeyCode                      = "2",
                    actionOnClick                = () =>
                    {
                        try
                        {
                            string screenPath      = screener.TakeScreenshot();
                            var    screenAnimation = new ScreenAnimationWindow(screenPath);
                            screenAnimation.Left = SystemParameters.VirtualScreenWidth - 250;
                            screenAnimation.Top  = 0;

                            screenAnimation.Show();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.ToString(), "Exception", MessageBoxButton.OK, MessageBoxImage.Warning);
                            LogError(ex.ToString());
                        }
                    }
                },

                new ShortcutModel()
                {
                    Describes                    = "Wycina określony obszar",
                    AllModifs                    = false,
                    SelectedModificator          = ModificatorNumeration.Ctrl,
                    AlternateSelectedModificator = ModificatorNumeration.None,
                    KeyCode       = "E",
                    actionOnClick = () =>
                    {
                        string snippingToolProcess = string.Empty;

                        if (!Environment.Is64BitProcess)
                        {
                            snippingToolProcess = @"C:\Windows\sysnative\SnippingTool.exe";
                        }
                        else
                        {
                            snippingToolProcess = @"C:\WINDOWS\system32\SnippingTool.exe";
                        }

                        Process process = new Process();
                        process.StartInfo.FileName = snippingToolProcess;
                        process.Start();
                        IntPtr handle = process.Handle;
                        WinApiHelper.SetForegroundWindow(handle);
                    }
                },

                new ShortcutModel()
                {
                    Name                         = "Linijka",
                    Describes                    = "Miarka pikselów na ekranie",
                    AllModifs                    = false,
                    SelectedModificator          = ModificatorNumeration.Ctrl,
                    AlternateSelectedModificator = ModificatorNumeration.None,
                    KeyCode                      = "L",
                    actionOnClick                = () =>
                    {
                        string rulerProcessPath = @"C:\Users\dante\source\Repos 2020\Linijka\MojaLinijka\bin\Debug\Linijka.exe";

                        Process process = new Process();
                        process.StartInfo.FileName = rulerProcessPath;
                        process.Start();
                        IntPtr handle = process.Handle;
                        WinApiHelper.SetForegroundWindow(handle);
                    }
                },

                new ShortcutModel()
                {
                    Name                         = "Color Picker",
                    Describes                    = "Pokazuje kolor z hexa",
                    AllModifs                    = false,
                    SelectedModificator          = ModificatorNumeration.Ctrl,
                    AlternateSelectedModificator = ModificatorNumeration.None,
                    KeyCode                      = "T",
                    actionOnClick                = () =>
                    {
                        string snippingCzasowyWylacznik = @"C:\Users\dante\source\Repos 2020\GetColor\GetColor\bin\Debug\GetColor.exe";
                        Process.Start(snippingCzasowyWylacznik);
                    }
                },

                new ShortcutModel()
                {
                    Name                         = "Open Daily text file",
                    Describes                    = "Otwiera plik tekstowy z folderu Notatki na dany dzień",
                    AllModifs                    = false,
                    SelectedModificator          = ModificatorNumeration.Ctrl,
                    AlternateSelectedModificator = ModificatorNumeration.None,
                    KeyCode                      = "3",
                    actionOnClick                = () =>
                    {
                        string dailyTextFile = ButtonPathGenerator.GetDailyFileFullPath(".txt");

                        Process process = new Process();
                        process.StartInfo.FileName = dailyTextFile;
                        process.Start();
                        IntPtr handle = process.Handle;
                        WinApiHelper.SetForegroundWindow(handle);
                    }
                },

                new ShortcutModel()
                {
                    Name                         = "Open All Dane -> Wazne Notsy",
                    Describes                    = "Otwiera plik tekstowy z waznym tekstem",
                    AllModifs                    = false,
                    SelectedModificator          = ModificatorNumeration.Ctrl,
                    AlternateSelectedModificator = ModificatorNumeration.None,
                    KeyCode                      = "4",
                    actionOnClick                = () =>
                    {
                        string dailyTextFile = ButtonPathGenerator.GetAllDataNoteFullPath();

                        Process process = new Process();
                        process.StartInfo.FileName = dailyTextFile;
                        process.Start();
                        IntPtr handle = process.Handle;
                        WinApiHelper.SetForegroundWindow(handle);
                    }
                },

                new ShortcutModel()
                {
                    Name                         = "DisplayScreens from today",
                    Describes                    = "Wszystkie screeny z dzisiaj",
                    AllModifs                    = false,
                    SelectedModificator          = ModificatorNumeration.Ctrl,
                    AlternateSelectedModificator = ModificatorNumeration.None,
                    KeyCode                      = "5",
                    actionOnClick                = () =>
                    {
                        string path = @"C:\Users\dante\source\Repos 2020\KombajnyDeluxe\DisplayScreens\bin\Release\netcoreapp3.1\DisplayScreens.exe";

                        string searchScreenFrom = @"C:\Users\dante\OneDrive\Pulpit\MojeDane";
                        int    dateRange        = 24;

                        Process process = new Process();
                        process.StartInfo.FileName  = path;
                        process.StartInfo.Arguments = $"{dateRange} \"{searchScreenFrom}\"";
                        process.Start();
                        IntPtr handle = process.Handle;
                        WinApiHelper.SetForegroundWindow(handle);
                    }
                },


                new ShortcutModel()
                {
                    Name                         = "DisplayScreens from weeek",
                    Describes                    = "Wszystkie screeny z tygodnia",
                    AllModifs                    = false,
                    SelectedModificator          = ModificatorNumeration.Ctrl,
                    AlternateSelectedModificator = ModificatorNumeration.None,
                    KeyCode                      = "6",
                    actionOnClick                = () =>
                    {
                        string path = @"C:\Users\dante\source\Repos 2020\KombajnyDeluxe\DisplayScreens\bin\Release\netcoreapp3.1\DisplayScreens.exe";

                        string searchScreenFrom = @"C:\Users\dante\OneDrive\Pulpit\MojeDane";
                        int    dateRange        = 1;

                        Process process = new Process();
                        process.StartInfo.FileName  = path;
                        process.StartInfo.Arguments = $"{dateRange} \"{searchScreenFrom}\"";
                        process.Start();
                        IntPtr handle = process.Handle;
                        WinApiHelper.SetForegroundWindow(handle);
                    }
                },


                new ShortcutModel()
                {
                    Name                         = "Process Killer",
                    Describes                    = "Zabija proces po nazwie",
                    AllModifs                    = true,
                    SelectedModificator          = ModificatorNumeration.Ctrl,
                    AlternateSelectedModificator = ModificatorNumeration.Alt,
                    KeyCode                      = "R",
                    actionOnClick                = () =>
                    {
                        string processKiller = @"C:\Users\dante\source\Repos 2020\Process Killer\Process Killer\bin\Debug\Process Killer.exe";
                        Process.Start(processKiller);
                    }
                },

                new ShortcutModel()
                {
                    Name                         = "Quit PC",
                    Describes                    = "Wyłącza PC",
                    AllModifs                    = true,
                    SelectedModificator          = ModificatorNumeration.Ctrl,
                    AlternateSelectedModificator = ModificatorNumeration.Alt,
                    KeyCode                      = "Q",
                    actionOnClick                = () =>
                    {
                        //MessageBox.Show("shutdown");
                        Process.Start("shutdown", "/s /t 0");
                    }
                }
            };

            //Set global hook
            GlobalHook = new GlobalHookBase(Shurtcuts);

            //assign list to notifyIcon
            if (NotifyIcon != null)
            {
                NotifyIcon.DataContext = new NotifyIconViewModel(Shurtcuts);
            }
        }