コード例 #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;
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        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);
        }
コード例 #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);
        }