示例#1
0
 void RegisterCombinationReleased()
 {
     isCombinationDown = false;
     if (PasteCombinationReleased != null)
     {
         mainThreadInvoker.Invoke(() => PasteCombinationReleased(this, new PasteCombinationReleasedEventArgument()));
     }
 }
        void RegisterCombinationReleased()
        {
            if (PasteCombinationReleased == null)
            {
                return;
            }

            logger.Information("Firing " + nameof(PasteCombinationReleased) + " event.");
            mainThreadInvoker.Invoke(
                () =>
                PasteCombinationReleased(
                    this,
                    new PasteCombinationReleasedEventArgument
                        ()));
        }
示例#3
0
        private async void OnInit(object sender, EventArgs args)
        {
            Initializing -= OnInit;

            while (_walletManager.CurrentWallet == null || _walletManager.CurrentWallet.State < WalletState.Initialized)
            {
                await Task.Delay(200);
            }
            IsWalletInitialized = true;
            _mainThreadInvoker.Invoke(() =>
            {
                //CoinList = new CoinListViewModel();
                Observable.FromEventPattern(_walletManager.CurrentWallet.TransactionProcessor, nameof(_walletManager.CurrentWallet.TransactionProcessor.WalletRelevantTransactionProcessed))
                .Throttle(TimeSpan.FromSeconds(0.1))
                .ObserveOn(RxApp.MainThreadScheduler)
                .Subscribe(_ =>
                {
                    // TODO make ObservableAsPropertyHelper
                    Balance = _walletManager.CurrentWallet.Coins.TotalAmount().ToString();
                });

                Observable.FromEventPattern(_walletManager.CurrentWallet, nameof(_walletManager.CurrentWallet.NewBlockProcessed))
                .Merge(Observable.FromEventPattern(_walletManager.CurrentWallet.TransactionProcessor, nameof(_walletManager.CurrentWallet.TransactionProcessor.WalletRelevantTransactionProcessed)))
                .Throttle(TimeSpan.FromSeconds(3))
                .ObserveOn(RxApp.MainThreadScheduler)
                .Subscribe(async _ => await TryRewriteTableAsync());
            });
        }
        public IClipboardDataControlPackage CreateFromDataPackage(IClipboardDataPackage dataPackage)
        {
            ClipboardDataControlPackage package = null;

            mainThreadInvoker.Invoke(
                () => package = CreateDataControlPackageFromDataPackage(dataPackage));

            return(package);
        }
        public IClipboardDataControlPackage CreateFromCurrentClipboardData()
        {
            var dataPackage = dataPackageFactory.CreateFromCurrentClipboardData();

            if (dataPackage == null)
            {
                return(null);
            }

            ClipboardDataControlPackage package = null;

            mainThreadInvoker.Invoke(
                () => {
                var control = CreateControlFromDataPackage(dataPackage);
                if (control == null)
                {
                    return;
                }

                package = new ClipboardDataControlPackage(dataPackage, control);
            });

            return(package);
        }
示例#6
0
 public void UpdateHoverText(string text)
 {
     mainThreadInvoker.Invoke(() => trayIcon.Text = text);
 }