Beispiel #1
0
        public PackageCheckerVM(IR2PreUploadChecker preUploadChecker)
        {
            _preCheckr = preUploadChecker;

            CheckPackageCmd = R2Command.Async(CheckUploadability,
                                              _ => Package != null);
        }
Beispiel #2
0
 private void EncodeNewDraft()
 {
     SaveDraftCmd = R2Command.Async(ExecuteSaveDraft, _ => CanSave(), $"Save {TypeDescription}");
     Draft        = new TDraft();
     SetNewDraftDefaults(Draft);
     this.Show <TWindow>(showModal: true);
 }
Beispiel #3
0
        public PreviousVerTabVM(IPackagePartManager packagePartManager)
        {
            _partsMgr = packagePartManager;

            GetVersionsCmd = R2Command.Async(GetVersions,
                                             _ => !Filename.IsBlank());
        }
Beispiel #4
0
 public JVsByDateRow(DateTime date, MainWindowVM2 mainWindow)
 {
     Date         = date;
     MainWindow   = mainWindow;
     RefreshCmd   = R2Command.Async(FillBothCells, _ => !IsBusy);
     UpdateRntCmd = R2Command.Async(UpdateRnt, _ => CanUpdateRnt(), "Import");
 }
 public MainWindowVMBase(TArg appArguments)
 {
     AppArgs        = appArguments;
     RefreshCmd     = R2Command.Async(DoRefresh, _ => !IsBusy, "Refresh");
     CloseWindowCmd = R2Command.Relay(CloseWindow, null, "Close Window");
     SetCaption($"as {AppArgs?.Credentials?.NameAndRole ?? "Anonymous"}");
 }
Beispiel #6
0
 public StallsListVM(MainWindowVM mainWindowVM, AppArguments appArguments) : base(appArguments.MarketState.Stalls, appArguments, false)
 {
     _main            = mainWindowVM;
     Crud             = new StallCrudVM(appArguments);
     _stallIdToLeases = GetStallsLookup();
     AddMultipleCmd   = R2Command.Async(AddMultipleStalls, _ => !_main.IsBusy, "Add Multiple Stalls");
 }
 public MainWindowVmBase()
 {
     _exeVer     = CurrentExe.GetVersion();
     ExitCmd     = R2Command.Async(_ => ExitApp(false));
     RelaunchCmd = R2Command.Async(_ => ExitApp(true));
     AppendToCaption("...");
 }
Beispiel #8
0
 public LeaseRowVM(LeaseDTO leaseDTO, MainWindowVM2 mainWindowVM2)
 {
     Lease        = leaseDTO;
     MainWindow   = mainWindowVM2;
     RefreshCmd   = R2Command.Async(LoadRntCell, _ => !IsBusy);
     UpdateRntCmd = R2Command.Async(UpdateRntDB, _ => !IsBusy, "Update RNT");
 }
Beispiel #9
0
        private void CreateCommands()
        {
            StartUploadCmd = R2Command.Async(StartUpload,
                                             x => CanUpload(), "Upload Package");

            StopUploadCmd = R2Command.Relay(StopUpload,
                                            x => _pkgUploadr.IsUploading, "stop uploading");
        }
Beispiel #10
0
 public ConverterRowBase(MainWindowVM2 mainWindowVM2)
 {
     Main          = mainWindowVM2;
     RefreshCmd    = R2Command.Async(this.GetDifferences, _ => !IsBusy, "Get Diffs");
     UpdateRntCmd  = R2Command.Async(this.UpdateRnt, _ => this.CanUpdateRnt(), "Update RNT");
     Remediate1Cmd = CreateRemediate1Cmd();
     Remediate2Cmd = CreateRemediate2Cmd();
 }
Beispiel #11
0
 public PeriodRowVM(DateTime date, MainWindowVM2 mainWindowVM2)
 {
     Date         = date;
     MainWindow   = mainWindowVM2;
     RefreshCmd   = R2Command.Async(FillBothCells, _ => !IsBusy);
     QueryByfCmd  = R2Command.Async(FillByfCell, _ => !IsBusy, "Query BYF");
     UpdateRntCmd = R2Command.Async(_ => this.UpdateRNT(Date), _ => CanUpdateRnt(), "Update RNT");
 }
Beispiel #12
0
 public bool?EditCurrentRecord(TDraft currentItem)
 {
     SaveDraftCmd = R2Command.Async(ExecuteUpdateRecord, _ => CanSave(), $"Save {TypeDescription}");
     //Draft        = new TDraft();
     //LoadValuesToDraft(currentItem, Draft);
     Draft = CreateDraftFromRecord(currentItem);
     return(this.Show <TWindow>(showModal: true));
 }
Beispiel #13
0
 public DailyTransactionRow(DateTime date, MainWindowVM mainWindowVM)
 {
     Date         = date;
     MainWindow   = mainWindowVM;
     RefreshCmd   = R2Command.Async(FillBothCells, _ => !IsBusy);
     QueryByfCmd  = R2Command.Async(FillByfCell, _ => !IsBusy, "Query BYF");
     UpdateRntCmd = R2Command.Async(this.UpdateRnt, _ => this.CanUpdateRnt(), "Update RNT");
 }
 public LeaseBalAdjustmentsVM(LeaseDTO lease, MainWindowVM2 mainWindowVM2) : base(mainWindowVM2.AppArgs)
 {
     Lease     = lease;
     Main      = mainWindowVM2;
     Rows      = new LeaseBalAdjsList();
     ImportCmd = R2Command.Async(_ => Rows.Import(this), null, "Import");
     SetCaption($"{Lease}");
     ClickRefresh();
 }
Beispiel #15
0
 public PackageVersionRowVM(IGrouping <string, R2PackagePart> grouping, IPackagePartManager packagePartManager)
 {
     _parts           = grouping.ToList();
     _partsMgr        = packagePartManager;
     VersionHash      = grouping.Key;
     UploadDate       = grouping.FirstOrDefault(x => x.PartNumber == 1)?.created;
     DeleteVersionCmd = R2Command.Async(DeleteParts);
     DeleteVersionCmd.DisableWhenDone = true;
 }
Beispiel #16
0
 private void EncodeNewDraft()
 {
     SaveDraftCmd = R2Command.Async(ExecuteSaveDraft, _ => CanSave(), $"Save {TypeDescription}");
     Draft        = GetNewDraft();
     if (Draft != null)
     {
         this.Show <TWindow>(showModal: true);
     }
 }
Beispiel #17
0
 public SoaViewerVM(LeaseDTO leaseDTO, ITenantDBsDir appArguments) : base(appArguments)
 {
     Lease = leaseDTO;
     UpdateBalanceFromDateCmd = R2Command.Async(UpdateBalanceFromDate,
                                                _ => AppArgs.CanForceLeaseBalanceUpdate(false), "Recompute Balances starting from this date");
     SetCaption($"[{Lease.Id}]  {Lease.TenantAndStall}");
     Rows.ItemOpened += (s, e) => OnItemOpened(e);
     ClickRefresh();
 }
Beispiel #18
0
 public AllInactiveLeasesVM(MainWindowVM main, ITenantDBsDir dir) : base(main, dir)
 {
     AddStallToTenantCmd   = LeaseCRUD1VM.GetAddStallToTenantCmd(this);
     RenewInactiveLeaseCmd = LeaseCRUD1VM.GetRenewInactiveLeaseCmd(this);
     UndoTerminationCmd    = R2Command.Relay(UndoTermination,
                                             _ => AppArgs.CanUndoLeaseTermination(false),
                                             "Undo Lease Termination");
     RebuildSoaCmd = R2Command.Async(RebuildSoA, _ => AppArgs.CanRunAdHocTask(false),
                                     "Rebuild Statement of Account");
 }
 public ProblemReporter1VM(IMessageBroadcastClient messageBroadcastListener,
                           ClientStateComposer1 clientStateComposer1)
 {
     _client         = messageBroadcastListener;
     _composr        = clientStateComposer1;
     ShowDialogueCmd = R2Command.Relay(ShowDialogueWindow, _ => !IsBusy, IDLE_STATUS);
     SubmitReportCmd = R2Command.Async(SendProblemReport, _ => !IsBusy, "Submit");
     SubmitReportCmd.DisableWhenDone = true;
     SetStatus(IDLE_STATUS);
 }
Beispiel #20
0
 public ConfigEditorVM(IHubClientSettings hubClientSettings,
                       IHubSessionsClient hubSessionsClient)
 {
     _hub             = hubSessionsClient;
     _key             = hubClientSettings.SharedKey;
     EncryptCmd       = R2Command.Relay(EncryptUnsaved, _ => !IsEncrypted, "Encrypt");
     DecryptCmd       = R2Command.Relay(DecryptUnsaved, _ => IsEncrypted, "Decrypt");
     PrettifyCmd      = R2Command.Relay(PrettifyUnsaved, _ => !IsEncrypted, "Prettify");
     SaveCmd          = R2Command.Async(SaveUnsaved, CanSave, "Save");
     PropertyChanged += ConfigEditorVM_PropertyChanged;
 }
        public CurrentClienteleVM(IHubSessionsClient clientStatusHubProxy1)
        {
            _hub = clientStatusHubProxy1;
            _hub.ClientConnected    += (s, e) => RefreshWhenNotBusy();
            _hub.ClientInteracted   += (s, e) => RefreshWhenNotBusy();
            _hub.ClientDisconnected += (s, e) => RefreshWhenNotBusy();

            GetCurrentListCmd = R2Command.Async(_ => RefreshList(),
                                                _ => !IsBusy, "Refresh List");
            RequestStatesCmd = R2Command.Async(RequestStates, _ => !IsBusy, "Request States");
        }
Beispiel #22
0
        public SignalrServerToggleVM(ISignalRServerSettings signalRServerSettings,
                                     SharedLogListVM commonLogListVM)
        {
            _cfg = signalRServerSettings;
            _log = commonLogListVM;

            StartServerCmd = R2Command.Relay(StartServer);
            StopServerCmd  = R2Command.Async(StopServer);

            StatusChanged += (s, e) => _log.Add(e);
        }
Beispiel #23
0
        public ProductsListTabVM(ProductsCache productsCache)
        {
            UpdateTitle("Products List");

            _cache        = productsCache;
            UpdateListCmd = R2Command.Async(UpdateList, _ => !IsBusy, "Update List");

            _cache.StatusChanged += (s, e) => SetStatus(e);
            this.StatusChanged   += (s, e) => AsUI(_ => Logs.Add(e));

            UpdateListCmd.ExecuteIfItCan();
        }
        public async Task SetupForInsert()
        {
            Draft = GetNewDraft();
            if (Draft == null)
            {
                return;
            }
            ModifyDraftForInserting(Draft);
            await ModifyDraftForInsertAsync(Draft);

            SaveDraftCmd = R2Command.Async(ExecuteSaveDraft, _ => CanSave(), $"Save {TypeDescription}");
            SetupForInsertCompleted?.Invoke(this, Draft);
        }
Beispiel #25
0
        public TabbedMainWindowBase(IFileSystemAccesor fs)
        {
            _exeVer = fs.CurrentExeVersion;
            ExitCmd = R2Command.Async(ExitApp);
            AppendToCaption("...");

            PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == nameof(SelectedTabIndex))
                {
                    _selectedTabChanged.Raise(SelectedTabIndex);
                }
            };
        }
Beispiel #26
0
        private void CreateCommands()
        {
            CheckCredentialsCmd = R2Command.Async(StartChecking,
                                                  x => Config != null, "Check Credentials");

            StopCheckingCredsCmd = R2Command.Relay(() =>
            {
                IsChecking = false;
                _client.StopEnablingWriteAccess();
            },
                                                   _ => _client.IsEnablingWriteAccess);

            //StopCheckingCredsCmd.DisableWhenDone = true;
        }
        public MainVersionKeeperWindowVM(SignalrServerToggleVM signalRServerToggleVM,
                                         CurrentHubClientsVM currentHubClientsVM,
                                         SharedLogListVM commonLogListVM,
                                         VersionKeeperSettings versionKeeperSettings,
                                         ClonedCopyExeUpdater clonedCopyExeUpdater,
                                         AppUpdateNotifierVM appUpdateNotifierVM)
        {
            Config       = versionKeeperSettings;
            Clients      = currentHubClientsVM;
            CommonLogs   = commonLogListVM;
            Updater      = appUpdateNotifierVM;
            _cloneUpdatr = clonedCopyExeUpdater;

            ServerToggle = signalRServerToggleVM;
            ServerToggle.StartServerCmd.ExecuteIfItCan();

            TestSend1Cmd = R2Command.Async(TestSend1, null, "Request States");
            TestSend2Cmd = R2Command.Async(TestSend2, null, "Test Broadcast");
        }
 public DailyTransactionsVM(MainWindowVM mainWindowVM)
 {
     MainWindow  = mainWindowVM;
     DateChooser = new DateChooserVM(this);
     RefreshCmd  = R2Command.Async(LoadPickedDates, _ => !IsBusy);
 }
 public ComparisonsListBase(MainWindowVM mainWindowVM)
 {
     MainWindow   = mainWindowVM;
     ImportAllCmd = R2Command.Async(this.ImportAll, _ => CanImportAll(), $"Import {MainWindow.PickedListName}");
 }
Beispiel #30
0
 public MainWindowVmBase()
 {
     _exeVer = CurrentExe.GetVersion();
     ExitCmd = R2Command.Async(ExitApp);
     AppendToCaption("...");
 }