Exemplo n.º 1
0
        protected static void ViewModel_IsEnabledChanged(ServiceForPlantWithEnablingVM sender, bool newValue)
        {
            var expectedLuggage = sender.Luggage as GlobalMenuPlantBox;

            Assert.IsNotNull(expectedLuggage, "Luggage is null or wrong type");
            expectedLuggage.GlobalNotifyIconChangerEnabled = newValue;
        }
        public static void ViewModel_IsEnabledChanged(ServiceForPlantWithEnablingVM sender, bool newValue)
        {
            var expectedLuggage = sender.Luggage as ClipboardObserverPlantBox;

            Assert.IsNotNull(expectedLuggage, "Luggage is null or wrong type");
            expectedLuggage.IsEnabled = newValue;
        }
        protected override ServiceForPlantVMBase GetServiceVM(ClipboardObserverService serviceInstance, IPlantEx plantEx)
        {
            var vm = new ServiceForPlantWithEnablingVM(this.ServiceName, this.ServiceDescription);

            vm.IsEnabledChanged += ViewModel_IsEnabledChanged;
            var plantBox = serviceInstance.GetPlantLuggage(plantEx);

            vm.Luggage   = plantBox;
            vm.IsEnabled = plantBox.IsEnabled;
            return(vm);
        }
Exemplo n.º 4
0
        protected override ServiceForPlantVMBase GetServiceVM(GlobalMenuService serviceInstance, IPlantEx plantEx)
        {
            var vm       = new ServiceForPlantWithEnablingVM(this.ServiceName, this.ServiceDescription);
            var plantBox = serviceInstance.GetPlantLuggage(plantEx);

            if (plantBox.GlobalNotifyIconChanger == null)
            {
                return(null);
            }
            vm.IsEnabled         = plantBox.GlobalNotifyIconChangerEnabled;
            vm.Luggage           = plantBox;
            vm.IsEnabledChanged += ViewModel_IsEnabledChanged;
            return(vm);
        }