Пример #1
0
        public ProbeScan(MainWindow window)
        {
            var currentSystemOfActiveCharacter = _positionTracker.CurrentSystemOfActiveCharacter;

            if (currentSystemOfActiveCharacter == null)
            {
                MessageBox.Show(
                    this,
                    "This feature allows you to store previous probe scans, so you don't need to scan signatures again, if you already had them scanned.\n\nYou need to have position tracking enabled for this to work.\nYou can activate it in the settings window.",
                    "WARNING");
                throw new CannotOpenWindowException();
            }

            InitializeComponent();

            ScanningStorage.ScannedSignaturesUpdate += ScanningStorageOnScannedSignaturesUpdate;

            ScanningStorageOnScannedSignaturesUpdate(currentSystemOfActiveCharacter, ScanningStorage.GetScannedSignaturesForSystem(currentSystemOfActiveCharacter));

            _positionTracker.ActiveCharacterSystemChanged += PositionTrackerOnActiveCharacterSystemChanged;

            //  this.SanitizeWindowSizeAndPosition();
        }
        private static void InitSignatureComboBox(string systemName, ComboBox cboSignature, string signatureName)
        {
            var scannedSignaturesFirstSystem = ScanningStorage.GetScannedSignaturesForSystem(systemName)
                                               .Where(x => x.IsUnknown() || x.IsWormhole())
                                               .ToArray();

            cboSignature.ItemsSource = scannedSignaturesFirstSystem;

            if (signatureName == null)
            {
                return;
            }

            var signature = scannedSignaturesFirstSystem.FirstOrDefault(x => x.Name == signatureName);

            if (signature == null)
            {
                cboSignature.Text = signatureName;
            }
            else
            {
                cboSignature.SelectedItem = signature;
            }
        }
Пример #3
0
 private void PositionTrackerOnActiveCharacterSystemChanged(string character, string newSystem)
 {
     ScanningStorageOnScannedSignaturesUpdate(newSystem, ScanningStorage.GetScannedSignaturesForSystem(newSystem));
 }