Exemple #1
0
        public DiskCommands(CommandIconService commandIconService)
        {
            Disposables = new CompositeDisposable();

            OpenDataFolderCommand = new CommandDefinition(
                "Data Folder",
                commandIconService.GetCompletionKindImage("FolderOpen"),
                ReactiveCommand.Create(OnOpenDataFolder).DisposeWith(Disposables));

            OpenWalletsFolderCommand = new CommandDefinition(
                "Wallets Folder",
                commandIconService.GetCompletionKindImage("FolderOpen"),
                ReactiveCommand.Create(OnOpenWalletsFolder).DisposeWith(Disposables));

            OpenLogFileCommand = new CommandDefinition(
                "Log File",
                commandIconService.GetCompletionKindImage("Log"),
                ReactiveCommand.Create(OnOpenLogFile).DisposeWith(Disposables));

            OpenTorLogFileCommand = new CommandDefinition(
                "Tor Log File",
                commandIconService.GetCompletionKindImage("Log"),
                ReactiveCommand.Create(OnOpenTorLogFile).DisposeWith(Disposables));

            OpenConfigFileCommand = new CommandDefinition(
                "Config File",
                commandIconService.GetCompletionKindImage("Settings"),
                ReactiveCommand.Create(OnOpenConfigFile).DisposeWith(Disposables));
        }
Exemple #2
0
        public HelpCommands(CommandIconService commandIconService)
        {
            _shell = IoC.Get <IShell>();

            AboutCommand = new CommandDefinition(
                "About", commandIconService.GetCompletionKindImage("Undo"), ReactiveCommand.Create(ShowAboutDialog));
        }
Exemple #3
0
        public ThemeCommands(CommandIconService commandIconService)
        {
            _shell = IoC.Get <IShell>();

            LightCommand = new CommandDefinition("Light", null, ReactiveCommand.Create(SetThemeLight));
            DarkCommand  = new CommandDefinition("Dark", null, ReactiveCommand.Create(SetThemeDark));
        }
Exemple #4
0
        public EditCommands(CommandIconService commandIconService)
        {
            _shell = IoC.Get <IShell>();

            //ShowQuickCommanderCommand = new CommandDefinition(
            //  "Show Quick Commander", null, ReactiveCommand.Create(ShowQuickCommander));

            UndoCommand = new CommandDefinition(
                "Undo",
                commandIconService.GetCompletionKindImage("Undo"),
                ReactiveCommand.Create(Undo));

            RedoCommand = new CommandDefinition(
                "Redo",
                commandIconService.GetCompletionKindImage("Redo"),
                ReactiveCommand.Create(Redo));

            CommentCommand = new CommandDefinition(
                "Comment",
                commandIconService.GetCompletionKindImage("CommentCode"),
                ReactiveCommand.Create(Comment));

            UncommentCommand = new CommandDefinition(
                "Uncomment",
                commandIconService.GetCompletionKindImage("UncommentCode"),
                ReactiveCommand.Create(Uncomment));
        }
        public ToolCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
        {
            Global = global.Global;
            var walletManagerCommand = ReactiveCommand.Create(OnWalletManager);

            var settingsCommand = ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new SettingsViewModel(Global));
            });

            Observable
            .Merge(walletManagerCommand.ThrownExceptions)
            .Merge(settingsCommand.ThrownExceptions)
            .Subscribe(OnException);

            WalletManagerCommand = new CommandDefinition(
                "Wallet Manager",
                commandIconService.GetCompletionKindImage("WalletManager"),
                walletManagerCommand);

            SettingsCommand = new CommandDefinition(
                "Settings",
                commandIconService.GetCompletionKindImage("Settings"),
                settingsCommand);
        }
Exemple #6
0
 public ExitCommands(CommandIconService commandIconService)
 {
     ExitCommand = new CommandDefinition(
         "Exit",
         commandIconService.GetCompletionKindImage("Exit"),
         ReactiveCommand.Create(OnExit));
 }
Exemple #7
0
        public ToolCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
        {
            Global = global.Global;
            var walletManagerCommand = ReactiveCommand.Create(OnWalletManager);

            var settingsCommand = ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new SettingsViewModel(Global));
            });

#if DEBUG
            var devToolsCommand = ReactiveCommand.Create(() =>
            {
                var devTools = new DevTools(Application.Current.Windows.FirstOrDefault());

                var devToolsWindow = new Window
                {
                    Width         = 1024,
                    Height        = 512,
                    Content       = devTools,
                    DataTemplates =
                    {
                        new ViewLocator <Avalonia.Diagnostics.ViewModels.ViewModelBase>()
                    }
                };

                devToolsWindow.Show();
            });
#endif

            Observable
            .Merge(walletManagerCommand.ThrownExceptions)
            .Merge(settingsCommand.ThrownExceptions)
#if DEBUG
            .Merge(devToolsCommand.ThrownExceptions)
#endif
            .Subscribe(OnException);

            WalletManagerCommand = new CommandDefinition(
                "Wallet Manager",
                commandIconService.GetCompletionKindImage("WalletManager"),
                walletManagerCommand);

            SettingsCommand = new CommandDefinition(
                "Settings",
                commandIconService.GetCompletionKindImage("Settings"),
                settingsCommand);

#if DEBUG
            DevToolsCommand = new CommandDefinition(
                "Dev Tools",
                commandIconService.GetCompletionKindImage("DevTools"),
                devToolsCommand);
#endif
        }
        public ExitCommands(CommandIconService commandIconService)
        {
            var exit = ReactiveCommand.Create(OnExit);

            exit.ThrownExceptions.Subscribe(ex => Logging.Logger.LogWarning <ExitCommands>(ex));

            ExitCommand = new CommandDefinition(
                "Exit",
                commandIconService.GetCompletionKindImage("Exit"),
                exit);
        }
Exemple #9
0
        public ToolCommands(CommandIconService commandIconService)
        {
            WalletManagerCommand = new CommandDefinition(
                "Wallet Manager",
                commandIconService.GetCompletionKindImage("WalletManager"),
                ReactiveCommand.Create(OnWalletManager));

            SettingsCommand = new CommandDefinition(
                "I Do Nothing",
                null,
                ReactiveCommand.Create(() => { }));
        }
        public SystemCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
        {
            Global = Guard.NotNull(nameof(Global), global.Global);

            var exit = ReactiveCommand.Create(OnExit);

            exit.ThrownExceptions.Subscribe(ex => Logger.LogWarning(ex));

            ExitCommand = new CommandDefinition(
                "Exit",
                commandIconService.GetCompletionKindImage("Exit"),
                exit);
        }
Exemple #11
0
        public ToolCommands(CommandIconService commandIconService)
        {
            WalletManagerCommand = new CommandDefinition(
                "Wallet Manager",
                commandIconService.GetCompletionKindImage("WalletManager"),
                ReactiveCommand.Create(OnWalletManager));

            SettingsCommand = new CommandDefinition(
                "Settings",
                commandIconService.GetCompletionKindImage("Settings"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new SettingsViewModel());
            }));
        }
Exemple #12
0
        public ToolCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
        {
            Global = global.Global;
            var walletManagerCommand = ReactiveCommand.Create(OnWalletManager);

            var settingsCommand = ReactiveCommand.Create(() =>
                                                         IoC.Get <IShell>().AddOrSelectDocument(() => new SettingsViewModel(Global)));

            var transactionBroadcasterCommand = ReactiveCommand.Create(() =>
                                                                       IoC.Get <IShell>().AddOrSelectDocument(() => new TransactionBroadcasterViewModel(Global)));

#if DEBUG
            var devToolsCommand = ReactiveCommand.Create(() =>
                                                         DevToolsExtensions.OpenDevTools((Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime).MainWindow));
#endif
            Observable
            .Merge(walletManagerCommand.ThrownExceptions)
            .Merge(settingsCommand.ThrownExceptions)
            .Merge(transactionBroadcasterCommand.ThrownExceptions)
#if DEBUG
            .Merge(devToolsCommand.ThrownExceptions)
#endif
            .ObserveOn(RxApp.TaskpoolScheduler)
            .Subscribe(ex => Logger.LogError(ex));

            WalletManagerCommand = new CommandDefinition(
                "Wallet Manager",
                commandIconService.GetCompletionKindImage("WalletManager"),
                walletManagerCommand);

            SettingsCommand = new CommandDefinition(
                "Settings",
                commandIconService.GetCompletionKindImage("Settings"),
                settingsCommand);

            TransactionBroadcasterCommand = new CommandDefinition(
                "Transaction Broadcaster",
                commandIconService.GetCompletionKindImage("BroadcastTransaction"),
                transactionBroadcasterCommand);

#if DEBUG
            DevToolsCommand = new CommandDefinition(
                "Dev Tools",
                commandIconService.GetCompletionKindImage("DevTools"),
                devToolsCommand);
#endif
        }
Exemple #13
0
        public FileCommands(CommandIconService commandIconService)
        {
            _studio = IoC.Get <IStudio>();
            _shell  = IoC.Get <IShell>();

            SaveCommand = new CommandDefinition(
                "Save",
                commandIconService.GetCompletionKindImage("Save"),
                ReactiveCommand.Create(Save, _shell.WhenAnyValue(x => x.SelectedDocument).Select(doc => doc != null)));

            SaveAllCommand = new CommandDefinition(
                "Save All",
                commandIconService.GetCompletionKindImage("SaveAll"),
                ReactiveCommand.Create(SaveAll));

            ExitCommand = new CommandDefinition("Exit", null, ReactiveCommand.Create(Exit));
        }
        public WalletCommands(CommandIconService commandIconService)
        {
            GenerateWalletCommand = new CommandDefinition(
                "Generate Wallet",
                commandIconService.GetCompletionKindImage("GenerateWallet"),
                ReactiveCommand.Create(OnGenerateWallet));

            RecoverWalletCommand = new CommandDefinition(
                "Recover Wallet",
                commandIconService.GetCompletionKindImage("RecoverWallet"),
                ReactiveCommand.Create(OnRecoverWallet));

            LoadWallet = new CommandDefinition(
                "Load Wallet",
                commandIconService.GetCompletionKindImage("LoadWallet"),
                ReactiveCommand.Create(OnLoadWallet));
        }
Exemple #15
0
        public DebugCommands(CommandIconService commandIconService)
        {
            _debugManager = IoC.Get <IDebugManager2>();

            StartDebuggingCommand = new CommandDefinition(
                "Start",
                commandIconService.GetCompletionKindImage("Run"),
                ReactiveCommand.Create(StartDebugging, _debugManager.CanStart));

            PauseDebuggingCommand = new CommandDefinition(
                "Pause",
                commandIconService.GetCompletionKindImage("PauseDebugger"),
                ReactiveCommand.Create(_debugManager.Pause, _debugManager.CanPause));

            StopDebuggingCommand = new CommandDefinition(
                "Stop",
                commandIconService.GetCompletionKindImage("Stop"),
                ReactiveCommand.Create(_debugManager.Stop, _debugManager.CanStop));

            RestartDebuggingCommand = new CommandDefinition(
                "Restart",
                commandIconService.GetCompletionKindImage("Restart"),
                ReactiveCommand.Create(_debugManager.Restart, _debugManager.CanStop));

            StepOverCommand = new CommandDefinition(
                "Step Over",
                commandIconService.GetCompletionKindImage("StepOver"),
                ReactiveCommand.Create(_debugManager.StepOver, _debugManager.CanStep));;

            StepIntoCommand = new CommandDefinition(
                "Step Into",
                commandIconService.GetCompletionKindImage("StepInto"),
                ReactiveCommand.Create(_debugManager.StepInto, _debugManager.CanStep));;

            StepOutCommand = new CommandDefinition(
                "Step Out",
                commandIconService.GetCompletionKindImage("StepOut"),
                ReactiveCommand.Create(_debugManager.StepOut, _debugManager.CanStep));

            StepInstructionCommand = new CommandDefinition(
                "Step Instruction",
                null,
                ReactiveCommand.Create(_debugManager.StepInstruction, _debugManager.CanStep));
        }
Exemple #16
0
        public DiskCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
        {
            Global = global.Global;
            var onOpenDataFolder    = ReactiveCommand.Create(OnOpenDataFolder);
            var onOpenWalletsFolder = ReactiveCommand.Create(OnOpenWalletsFolder);
            var onOpenLogFile       = ReactiveCommand.Create(OnOpenLogFile);
            var onOpenTorLogFile    = ReactiveCommand.Create(OnOpenTorLogFile);
            var onOpenConfigFile    = ReactiveCommand.Create(OnOpenConfigFile);

            Observable
            .Merge(onOpenConfigFile.ThrownExceptions)
            .Merge(onOpenWalletsFolder.ThrownExceptions)
            .Merge(onOpenLogFile.ThrownExceptions)
            .Merge(onOpenTorLogFile.ThrownExceptions)
            .Merge(onOpenConfigFile.ThrownExceptions)
            .ObserveOn(RxApp.TaskpoolScheduler)
            .Subscribe(ex => Logger.LogError(ex));

            OpenDataFolderCommand = new CommandDefinition(
                "Data Folder",
                commandIconService.GetCompletionKindImage("FolderOpen"),
                onOpenDataFolder);

            OpenWalletsFolderCommand = new CommandDefinition(
                "Wallets Folder",
                commandIconService.GetCompletionKindImage("FolderOpen"),
                onOpenWalletsFolder);

            OpenLogFileCommand = new CommandDefinition(
                "Log File",
                commandIconService.GetCompletionKindImage("Log"),
                onOpenLogFile);

            OpenTorLogFileCommand = new CommandDefinition(
                "Tor Log File",
                commandIconService.GetCompletionKindImage("Log"),
                onOpenTorLogFile);

            OpenConfigFileCommand = new CommandDefinition(
                "Config File",
                commandIconService.GetCompletionKindImage("Settings"),
                onOpenConfigFile);
        }
Exemple #17
0
        public BuildCommands(
            ISolutionExplorer solutionExplorer,
            CommandIconService commandIconService)
        {
            _studio           = IoC.Get <IStudio>();
            _solutionExplorer = solutionExplorer;

            var shellCanRunTask = _studio.CanRunTask();

            BuildCommand = new CommandDefinition(
                "Build",
                commandIconService.GetCompletionKindImage("Build"),
                ReactiveCommand.Create(_studio.Build, shellCanRunTask));

            CleanCommand = new CommandDefinition(
                "Clean",
                commandIconService.GetCompletionKindImage("Clean"),
                ReactiveCommand.Create(_studio.Clean, shellCanRunTask));
        }
Exemple #18
0
        public WalletCommands(CommandIconService commandIconService)
        {
            Disposables = new CompositeDisposable();

            GenerateWalletCommand = new CommandDefinition(
                "Generate Wallet",
                commandIconService.GetCompletionKindImage("GenerateWallet"),
                ReactiveCommand.Create(OnGenerateWallet).DisposeWith(Disposables));

            RecoverWalletCommand = new CommandDefinition(
                "Recover Wallet",
                commandIconService.GetCompletionKindImage("RecoverWallet"),
                ReactiveCommand.Create(OnRecoverWallet).DisposeWith(Disposables));

            LoadWallet = new CommandDefinition(
                "Load Wallet",
                commandIconService.GetCompletionKindImage("LoadWallet"),
                ReactiveCommand.Create(OnLoadWallet).DisposeWith(Disposables));
        }
        public SystemCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
        {
            Global = Guard.NotNull(nameof(Global), global.Global);

            ExitCommand = new CommandDefinition(
                "Exit",
                commandIconService.GetCompletionKindImage("Exit"),
                ReactiveCommand.Create(OnExit));

            LockScreenCommand = new CommandDefinition(
                "Lock Screen",
                commandIconService.GetCompletionKindImage("Lock"),
                ReactiveCommand.Create(() => { Global.UiConfig.LockScreenActive = true; }));

            Observable
            .Merge(ExitCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(ExitCommand.GetReactiveCommand().ThrownExceptions)
            .ObserveOn(RxApp.TaskpoolScheduler)
            .Subscribe(ex => Logger.LogWarning(ex));
        }
Exemple #20
0
        public SystemCommands(CommandIconService commandIconService)
        {
            var global = Locator.Current.GetService <Global>();

            ExitCommand = new CommandDefinition(
                "Exit",
                commandIconService.GetCompletionKindImage("Exit"),
                ReactiveCommand.Create(OnExit));

            LockScreenCommand = new CommandDefinition(
                "Lock Screen",
                commandIconService.GetCompletionKindImage("Lock"),
                ReactiveCommand.Create(() => global.UiConfig.LockScreenActive = true));

            Observable
            .Merge(ExitCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(ExitCommand.GetReactiveCommand().ThrownExceptions)
            .ObserveOn(RxApp.TaskpoolScheduler)
            .Subscribe(ex => Logger.LogWarning(ex));
        }
        public DiskCommands(CommandIconService commandIconService)
        {
            var onOpenDataFolder    = ReactiveCommand.Create(OnOpenDataFolder);
            var onOpenWalletsFolder = ReactiveCommand.Create(OnOpenWalletsFolder);
            var onOpenLogFile       = ReactiveCommand.Create(OnOpenLogFile);
            var onOpenTorLogFile    = ReactiveCommand.Create(OnOpenTorLogFile);
            var onOpenConfigFile    = ReactiveCommand.Create(OnOpenConfigFile);

            Observable
            .Merge(onOpenConfigFile.ThrownExceptions)
            .Merge(onOpenWalletsFolder.ThrownExceptions)
            .Merge(onOpenLogFile.ThrownExceptions)
            .Merge(onOpenTorLogFile.ThrownExceptions)
            .Merge(onOpenConfigFile.ThrownExceptions)
            .Subscribe(OnFileOpenException);

            OpenDataFolderCommand = new CommandDefinition(
                "Data Folder",
                commandIconService.GetCompletionKindImage("FolderOpen"),
                onOpenDataFolder);

            OpenWalletsFolderCommand = new CommandDefinition(
                "Wallets Folder",
                commandIconService.GetCompletionKindImage("FolderOpen"),
                onOpenWalletsFolder);

            OpenLogFileCommand = new CommandDefinition(
                "Log File",
                commandIconService.GetCompletionKindImage("Log"),
                onOpenLogFile);

            OpenTorLogFileCommand = new CommandDefinition(
                "Tor Log File",
                commandIconService.GetCompletionKindImage("Log"),
                onOpenTorLogFile);

            OpenConfigFileCommand = new CommandDefinition(
                "Config File",
                commandIconService.GetCompletionKindImage("Settings"),
                onOpenConfigFile);
        }
Exemple #22
0
        public ToolCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
        {
            Global = global.Global;
            var walletManagerCommand = ReactiveCommand.Create(OnWalletManager);

            var settingsCommand = ReactiveCommand.Create(() => IoC.Get <IShell>().AddOrSelectDocument(() => new SettingsViewModel(Global)));

#if DEBUG
            var devToolsCommand = ReactiveCommand.Create(() =>
            {
                DevToolsExtensions.OpenDevTools((Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime).MainWindow);
            });
#endif

            Observable
            .Merge(walletManagerCommand.ThrownExceptions)
            .Merge(settingsCommand.ThrownExceptions)
#if DEBUG
            .Merge(devToolsCommand.ThrownExceptions)
#endif
            .Subscribe(OnException);

            WalletManagerCommand = new CommandDefinition(
                "Wallet Manager",
                commandIconService.GetCompletionKindImage("WalletManager"),
                walletManagerCommand);

            SettingsCommand = new CommandDefinition(
                "Settings",
                commandIconService.GetCompletionKindImage("Settings"),
                settingsCommand);

#if DEBUG
            DevToolsCommand = new CommandDefinition(
                "Dev Tools",
                commandIconService.GetCompletionKindImage("DevTools"),
                devToolsCommand);
#endif
        }
Exemple #23
0
        public SystemCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
        {
            Global = Guard.NotNull(nameof(Global), global.Global);

            var exit = ReactiveCommand.Create(OnExit);

            exit.ThrownExceptions.Subscribe(ex => Logger.LogWarning(ex));

            ExitCommand = new CommandDefinition(
                "Exit",
                commandIconService.GetCompletionKindImage("Exit"),
                exit);

                                #pragma warning disable IDE0053 // Use expression body for lambda expressions
            var lockCommand = ReactiveCommand.Create(() => { Global.UiConfig.LockScreenActive = true; });
                                #pragma warning restore IDE0053 // Use expression body for lambda expressions

            lockCommand.ThrownExceptions.Subscribe(ex => Logger.LogWarning(ex));

            LockScreenCommand = new CommandDefinition(
                "Lock Screen",
                commandIconService.GetCompletionKindImage("Lock"),
                lockCommand);
        }
Exemple #24
0
        public WalletCommands(CommandIconService commandIconService)
        {
            GenerateWalletCommand = new CommandDefinition(
                "Generate Wallet",
                commandIconService.GetCompletionKindImage("GenerateWallet"),
                ReactiveCommand.Create(OnGenerateWallet));

            RecoverWalletCommand = new CommandDefinition(
                "Recover Wallet",
                commandIconService.GetCompletionKindImage("RecoverWallet"),
                ReactiveCommand.Create(OnRecoverWallet));

            LoadWallet = new CommandDefinition(
                "Load Wallet",
                commandIconService.GetCompletionKindImage("LoadWallet"),
                ReactiveCommand.Create(OnLoadWallet));

            Observable
            .Merge(GenerateWalletCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(RecoverWalletCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(LoadWallet.GetReactiveCommand().ThrownExceptions)
            .ObserveOn(RxApp.TaskpoolScheduler)
            .Subscribe(ex => Logger.LogError(ex));
        }
Exemple #25
0
        public HelpCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
        {
            Global       = global.Global;
            AboutCommand = new CommandDefinition(
                "About",
                commandIconService.GetCompletionKindImage("About"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global));
            }));

            CustomerSupportCommand = new CommandDefinition(
                "Customer Support",
                commandIconService.GetCompletionKindImage("CustomerSupport"),
                ReactiveCommand.Create(() =>
            {
                try
                {
                    IoHelpers.OpenBrowser("https://www.reddit.com/r/WasabiWallet/");
                }
                catch (Exception ex)
                {
                    Logging.Logger.LogWarning <HelpCommands>(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global));
                }
            }));

            ReportBugCommand = new CommandDefinition(
                "Report Bug",
                commandIconService.GetCompletionKindImage("ReportBug"),
                ReactiveCommand.Create(() =>
            {
                try
                {
                    IoHelpers.OpenBrowser("https://github.com/zkSNACKs/WalletWasabi/issues");
                }
                catch (Exception ex)
                {
                    Logging.Logger.LogWarning <HelpCommands>(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global));
                }
            }));

            FaqCommand = new CommandDefinition(
                "FAQ",
                commandIconService.GetCompletionKindImage("Faq"),
                ReactiveCommand.Create(() =>
            {
                try
                {
                    IoHelpers.OpenBrowser("https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Documentation/FAQ.md");
                }
                catch (Exception ex)
                {
                    Logging.Logger.LogWarning <HelpCommands>(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global));
                }
            }));

            PrivacyPolicyCommand = new CommandDefinition(
                "Privacy Policy",
                commandIconService.GetCompletionKindImage("PrivacyPolicy"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new PrivacyPolicyViewModel(Global));
            }));

            TermsAndConditionsCommand = new CommandDefinition(
                "Terms and Conditions",
                commandIconService.GetCompletionKindImage("TermsAndConditions"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new TermsAndConditionsViewModel(Global));
            }));

            LegalIssuesCommand = new CommandDefinition(
                "Legal Issues",
                commandIconService.GetCompletionKindImage("LegalIssues"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new LegalIssuesViewModel(Global));
            }));

#if DEBUG
            DevToolsCommand = new CommandDefinition(
                "Dev Tools",
                commandIconService.GetCompletionKindImage("DevTools"),
                ReactiveCommand.Create(() =>
            {
                var devTools = new DevTools(Application.Current.Windows.FirstOrDefault());

                var devToolsWindow = new Window {
                    Width         = 1024,
                    Height        = 512,
                    Content       = devTools,
                    DataTemplates =
                    {
                        new ViewLocator <Avalonia.Diagnostics.ViewModels.ViewModelBase>(),
                    }
                };

                devToolsWindow.Show();
            }));
#endif
        }
Exemple #26
0
        public HelpCommands(CommandIconService commandIconService)
        {
            AboutCommand = new CommandDefinition(
                "About",
                commandIconService.GetCompletionKindImage("About"),
                ReactiveCommand.Create(() => IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel())));

            CustomerSupportCommand = new CommandDefinition(
                "Customer Support",
                commandIconService.GetCompletionKindImage("CustomerSupport"),
                ReactiveCommand.CreateFromTask(async() =>
            {
                try
                {
                    await IoHelpers.OpenBrowserAsync("https://www.reddit.com/r/WasabiWallet/");
                }
                catch (Exception ex)
                {
                    Logger.LogWarning(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel());
                }
            }));

            ReportBugCommand = new CommandDefinition(
                "Report Bug",
                commandIconService.GetCompletionKindImage("ReportBug"),
                ReactiveCommand.CreateFromTask(async() =>
            {
                try
                {
                    await IoHelpers.OpenBrowserAsync("https://github.com/zkSNACKs/WalletWasabi/issues");
                }
                catch (Exception ex)
                {
                    Logger.LogWarning(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel());
                }
            }));

            DocsCommand = new CommandDefinition(
                "Documentation",
                commandIconService.GetCompletionKindImage("Documentation"),
                ReactiveCommand.CreateFromTask(async() =>
            {
                try
                {
                    await IoHelpers.OpenBrowserAsync("https://docs.wasabiwallet.io/");
                }
                catch (Exception ex)
                {
                    Logger.LogWarning(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel());
                }
            }));

            LegalDocumentsCommand = new CommandDefinition(
                "Legal Documents",
                commandIconService.GetCompletionKindImage("LegalDocuments"),
                ReactiveCommand.Create(() => IoC.Get <IShell>().AddOrSelectDocument(() => new LegalDocumentsViewModel())));

            Observable
            .Merge(AboutCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(CustomerSupportCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(ReportBugCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(DocsCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(LegalDocumentsCommand.GetReactiveCommand().ThrownExceptions)
            .ObserveOn(RxApp.TaskpoolScheduler)
            .Subscribe(ex => Logger.LogError(ex));
        }
Exemple #27
0
        public HelpCommands(CommandIconService commandIconService)
        {
            AboutCommand = new CommandDefinition(
                "About",
                commandIconService.GetCompletionKindImage("About"),
                ReactiveCommand.Create(() => IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel())));

            UserSupportCommand = new CommandDefinition(
                "User Support",
                commandIconService.GetCompletionKindImage("UserSupport"),
                ReactiveCommand.CreateFromTask(async() =>
            {
                try
                {
                    await IoHelpers.OpenBrowserAsync("https://www.reddit.com/r/Groestlcoin/");
                }
                catch (Exception ex)
                {
                    Logger.LogWarning(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel());
                }
            }));

            ReportBugCommand = new CommandDefinition(
                "Report Bug",
                commandIconService.GetCompletionKindImage("ReportBug"),
                ReactiveCommand.CreateFromTask(async() =>
            {
                try
                {
                    await IoHelpers.OpenBrowserAsync("https://github.com/Groestlcoin/WalletWasabi/issues");
                }
                catch (Exception ex)
                {
                    Logger.LogWarning(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel());
                }
            }));

            DocsCommand = new CommandDefinition(
                "Documentation",
                commandIconService.GetCompletionKindImage("Documentation"),
                ReactiveCommand.CreateFromTask(async() =>
            {
                try
                {
                    await IoHelpers.OpenBrowserAsync("https://groestlcoin.org/forum/");
                }
                catch (Exception ex)
                {
                    Logger.LogWarning(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel());
                }
            }));

            LegalDocumentsCommand = new CommandDefinition(
                "Legal Documents",
                commandIconService.GetCompletionKindImage("LegalDocuments"),
                ReactiveCommand.Create(() => IoC.Get <IShell>().AddOrSelectDocument(() => new LegalDocumentsViewModel(legalDoc: Locator.Current.GetService <Global>()?.LegalDocuments))));

            Observable
            .Merge(AboutCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(UserSupportCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(ReportBugCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(DocsCommand.GetReactiveCommand().ThrownExceptions)
            .Merge(LegalDocumentsCommand.GetReactiveCommand().ThrownExceptions)
            .ObserveOn(RxApp.TaskpoolScheduler)
            .Subscribe(ex =>
            {
                Logger.LogError(ex);
                NotificationHelpers.Error(ex.ToUserFriendlyString());
            });
        }
Exemple #28
0
 public EditCommands(CommandIconService commandIconService)
 {
     ShowQuickCommanderCommand = new CommandDefinition(
         "Show Quick Commander", null, ReactiveCommand.Create(ShowQuickCommander));
 }
Exemple #29
0
        public HelpCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
        {
            Global       = global.Global;
            AboutCommand = new CommandDefinition(
                "About",
                commandIconService.GetCompletionKindImage("About"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global));
            }));

            CustomerSupportCommand = new CommandDefinition(
                "Customer Support",
                commandIconService.GetCompletionKindImage("CustomerSupport"),
                ReactiveCommand.Create(() =>
            {
                try
                {
                    IoHelpers.OpenBrowser("https://www.reddit.com/r/WasabiWallet/");
                }
                catch (Exception ex)
                {
                    Logging.Logger.LogWarning <HelpCommands>(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global));
                }
            }));

            ReportBugCommand = new CommandDefinition(
                "Report Bug",
                commandIconService.GetCompletionKindImage("ReportBug"),
                ReactiveCommand.Create(() =>
            {
                try
                {
                    IoHelpers.OpenBrowser("https://github.com/zkSNACKs/WalletWasabi/issues");
                }
                catch (Exception ex)
                {
                    Logging.Logger.LogWarning <HelpCommands>(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global));
                }
            }));

            DocsCommand = new CommandDefinition(
                "Documentation",
                commandIconService.GetCompletionKindImage("Documentation"),
                ReactiveCommand.Create(() =>
            {
                try
                {
                    IoHelpers.OpenBrowser("https://docs.wasabiwallet.io/");
                }
                catch (Exception ex)
                {
                    Logging.Logger.LogWarning <HelpCommands>(ex);
                    IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global));
                }
            }));

            PrivacyPolicyCommand = new CommandDefinition(
                "Privacy Policy",
                commandIconService.GetCompletionKindImage("PrivacyPolicy"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new PrivacyPolicyViewModel(Global));
            }));

            TermsAndConditionsCommand = new CommandDefinition(
                "Terms and Conditions",
                commandIconService.GetCompletionKindImage("TermsAndConditions"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new TermsAndConditionsViewModel(Global));
            }));

            LegalIssuesCommand = new CommandDefinition(
                "Legal Issues",
                commandIconService.GetCompletionKindImage("LegalIssues"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new LegalIssuesViewModel(Global));
            }));
        }
        public HelpCommands(CommandIconService commandIconService)
        {
            AboutCommand = new CommandDefinition(
                "About",
                commandIconService.GetCompletionKindImage("About"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel());
            }));

            DataFolderCommand = new CommandDefinition(
                "Data Folder",
                commandIconService.GetCompletionKindImage("DataFolder"),
                ReactiveCommand.Create(() =>
            {
                IoHelpers.OpenFolderInFileExplorer(Global.DataDir);
            }));

            CustomerSupportCommand = new CommandDefinition(
                "Customer Support",
                commandIconService.GetCompletionKindImage("CustomerSupport"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new CustomerSupportViewModel());
            }));

            ReportBugCommand = new CommandDefinition(
                "Report Bug",
                commandIconService.GetCompletionKindImage("ReportBug"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new ReportBugViewModel());
            }));

            PrivacyPolicyCommand = new CommandDefinition(
                "Privacy Policy",
                commandIconService.GetCompletionKindImage("PrivacyPolicy"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new PrivacyPolicyViewModel());
            }));

            TermsAndConditionsCommand = new CommandDefinition(
                "Terms and Conditions",
                commandIconService.GetCompletionKindImage("TermsAndConditions"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new TermsAndConditionsViewModel());
            }));

            LegalIssuesCommand = new CommandDefinition(
                "Legal Issues",
                commandIconService.GetCompletionKindImage("LegalIssues"),
                ReactiveCommand.Create(() =>
            {
                IoC.Get <IShell>().AddOrSelectDocument(() => new LegalIssuesViewModel());
            }));

#if DEBUG
            DevToolsCommand = new CommandDefinition(
                "Dev Tools",
                commandIconService.GetCompletionKindImage("DevTools"),
                ReactiveCommand.Create(() =>
            {
                var devTools = new DevTools(Application.Current.Windows.FirstOrDefault());

                var devToolsWindow = new Window
                {
                    Width         = 1024,
                    Height        = 512,
                    Content       = devTools,
                    DataTemplates =
                    {
                        new ViewLocator <Avalonia.Diagnostics.ViewModels.ViewModelBase>(),
                    }
                };

                devToolsWindow.Show();
            }));
#endif
        }