Пример #1
0
 public void Reset()
 {
     LibraryService.Dispose();
     LibraryService = null;
     TracksCollection.Clear();
     RecentlyPlayedCollection.Clear();
     GenreFlyout?.Items.Clear();
     PlaylistsItems?.Clear();
     OldItems = null;
     PlaylistCollection.Clear();
     core.OptionItems.Clear();
     GenreCollection.Clear();
     SongCount = -1;
 }
Пример #2
0
        private void UpdateProvider(IExchangeInfoProvider provider)
        {
            _exchanges.Clear();

            if (_exchangeInfoProvider != null)
            {
                _exchangeInfoProvider.ExchangeAdded -= _exchanges.Add;
            }

            _exchangeInfoProvider = provider;

            if (_exchangeInfoProvider != null)
            {
                _exchanges.AddRange(_exchangeInfoProvider.Exchanges);
                _exchangeInfoProvider.ExchangeAdded += _exchanges.Add;
            }
        }
 private void parseNewPosts(RequestCompletedArgs result)
 {
     if (result.Success)
     {
         posts.Clear();
         list = (JArray)result.ResponseObject[0][1][1][0];
         addPosts();
         App.Progress.IsVisible  = false;
         appbar.IsVisible        = true;
         appbarRefresh.IsEnabled = true;
         App.Settings.AddOrUpdateValue("LastUpdate", DateTime.Now);
     }
     else
     {
         MessageBox.Show("Please check your network", "Can't reach Google", MessageBoxButton.OK);
         throw new Exception("ExitAppException");
     }
 }
Пример #4
0
        private void Assets_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var asset = SelectedAsset;

            _model.UnderlyingAsset = asset;

            _model.Clear();
            _options.Clear();

            var options = asset.GetDerivatives(Connector);

            foreach (var security in options)
            {
                _model.Add(security);
                _options.Add(security);
            }

            ProcessPositions();
        }
        private void GetAssetsClick(object sender, RoutedEventArgs e)
        {
            _assetsList.Clear();
            if (!App.FtpOperations.HaveSettings)
            {
                return;
            }
            var bw = new BackgroundWorker();

            bw.DoWork += (o, args) => {
                try {
                    var path = Path.Combine(Path.GetTempPath(), "AuroraAssetEditor.db");
                    if (!App.FtpOperations.DownloadContentDb(path))
                    {
                        return;
                    }
                    foreach (var title in AuroraDbManager.GetDbTitles(path))
                    {
                        _assetsList.Add(title);
                    }
                    args.Result = true;
                }
                catch (Exception ex) {
                    MainWindow.SaveError(ex);
                    args.Result = false;
                }
            };
            bw.RunWorkerCompleted += (o, args) => {
                _main.BusyIndicator.Visibility = Visibility.Collapsed;
                if ((bool)args.Result)
                {
                    Status.Text = "Finished grabbing FTP Assets information successfully...";
                }
                else
                {
                    Status.Text = "There was an error, check error.log for more information...";
                }
            };
            _main.BusyIndicator.Visibility = Visibility.Visible;
            Status.Text = "Grabbing FTP Assets information...";
            bw.RunWorkerAsync();
        }
Пример #6
0
        private void CheckClick(object sender, RoutedEventArgs e)
        {
            var terminal = SelectedTerminal;

            if (terminal.SystemProcess.MainModule == null)
            {
                throw new InvalidOperationException(LocalizedStrings.InvalidProcess);
            }

            OkResult.SetVisibility(false);

            _settingErrors.Clear();

            var isDde = IsDde.IsChecked == true;

            var connector = new QuikTrader(terminal.SystemProcess.MainModule.FileName)
            {
                IsDde = isDde
            };

            var checkDde = isDde && CheckDde.IsChecked == true;

            connector.Connected += () => this.GuiAsync(() =>
            {
                if (checkDde)
                {
                    connector.StartExport();
                }

                OnConnect(connector, null);
            });

            connector.ConnectionError += error => this.GuiSync(() => OnConnect(connector, error));

            if (checkDde)
            {
                connector.ProcessDataError += error => _settingErrors.Add(new SettingsError(LocalizedStrings.Str3030Params.Put(error.Message), true));
            }

            connector.Connect();
        }
Пример #7
0
 public void ClearSmokeScreenTargetsList()
 {
     Logger.ShadowLog("No longer in party. Clearing SmokeScreen Targets.");
     smokeScreenTargetCollection?.Clear();
 }
Пример #8
0
 private void ClearSecurities()
 {
     _itemsSource.Clear();
 }
Пример #9
0
 public void ClearPalisadeTargetsList()
 {
     Logger.KefkaLog("No longer in party. Clearing Palisade Targets.");
     palisadeTargetCollection?.Clear();
 }
Пример #10
0
 public void ClearNaturesMinneTargetsList()
 {
     Logger.EdwardLog("No longer in party. Clearing NaturesMinne Targets.");
     naturesMinneTargetCollection?.Clear();
 }
Пример #11
0
 public void ClearShadewalkerTargetsList()
 {
     Logger.ShadowLog("No longer in party. Clearing Shadewalker Targets.");
     shadewalkerTargetCollection?.Clear();
 }
Пример #12
0
 public void ClearDragonSightTargetsList()
 {
     Logger.FreyaLog("No longer in party. Clearing DragonSight Targets.");
     dragonSightTargetCollection?.Clear();
 }
 /// <summary>
 /// Очистить таблицу.
 /// </summary>
 public void Clear()
 {
     _map.Clear();
     _strategies.Clear();
     ResultsGrid.Columns.Clear();
 }
Пример #14
0
 public void ClearGoadTargetsList()
 {
     Logger.KefkaLog("No longer in party. Clearing Goad Targets.");
     goadTargetCollection?.Clear();
 }
Пример #15
0
        private void Refresh(String guid, ThreadSafeObservableCollection<UsbDeviceViewModel> deviceList, UsbDeviceViewModel selectedDevice, Action<UsbDeviceViewModel> setSelectedDevice, String deviceId = null, String devicePath = null)
        {
            if (String.IsNullOrEmpty(deviceId) && String.IsNullOrEmpty(devicePath))
            {
                if (selectedDevice != null)
                {
                    deviceId = selectedDevice.DeviceId;
                }
                else if (deviceList.Count > 0)
                {
                    deviceId = deviceList[0].DeviceId;
                }
            }

            deviceList.Clear();

            UsbDevice[] usbDevices = UsbDevice.GetDevices(new Guid(guid));

            List<UsbDeviceViewModel> usbDeviceViewModels = new List<UsbDeviceViewModel>();
            foreach (UsbDevice usbDevice in usbDevices)
            {
                usbDeviceViewModels.Add(new UsbDeviceViewModel(usbDevice));
            }

            deviceList.AddRange(usbDeviceViewModels);

            if (!String.IsNullOrEmpty(deviceId))
            {
                foreach (UsbDeviceViewModel usbDeviceViewModel in deviceList)
                {
                    if (usbDeviceViewModel.DeviceId.Equals(deviceId, StringComparison.CurrentCultureIgnoreCase))
                    {
                        setSelectedDevice(usbDeviceViewModel);
                        return;
                    }
                }
            }

            if (!String.IsNullOrEmpty(devicePath))
            {
                foreach (UsbDeviceViewModel usbDeviceViewModel in deviceList)
                {
                    if (usbDeviceViewModel.DevicePath.Equals(devicePath, StringComparison.CurrentCultureIgnoreCase))
                    {
                        setSelectedDevice(usbDeviceViewModel);
                        return;
                    }
                }
            }

            if (deviceList.Count > 0)
            {
                setSelectedDevice(deviceList[0]);
            }
        }
Пример #16
0
 public void ClearCoverTargetsList()
 {
     Logger.BeatrixLog("No longer in party. Clearing Cover Targets.");
     coverTargetCollection?.Clear();
 }
Пример #17
0
 public void ClearCardTargetsList()
 {
     Logger.RemielLog("No longer in party. Clearing Card Targets.");
     cardTargetCollection?.Clear();
 }