Esempio n. 1
0
        public void Init(params Type[] parts)
        {
            _calculatorExtensionsManager.InitializeContainer(parts);

            foreach (var extension in _calculatorExtensionsManager.GetExtensionInformation())
            {
                var vm = new ExtensionViewModel(extension);
                vm.ActivatedExtensionChanged += OnActivatedExtensionChanged;
                Extensions.Add(vm);
            }
        }
Esempio n. 2
0
        private void OnActivatedExtensionChanged(ExtensionViewModel extension, ActivatedExtensionEventArgs e)
        {
            switch (e.ExtensionChange)
            {
            case ExtensionChange.Added:
                ActivatedExtensions.Add(extension);
                SelectedExtension = extension;
                break;

            case ExtensionChange.Removed:
                ActivatedExtensions.Remove(extension);
                SelectedExtension = ActivatedExtensions.FirstOrDefault();
                break;
            }
        }
Esempio n. 3
0
 private void OnActivateExtension(ExtensionViewModel sender, EventArgs e)
 {
     ActivatedExtensions.Add(sender);
     SelectedExtension = sender;
 }