Пример #1
0
        public ApplicationTreeViewItemViewModel(Application application, CloudTreeViewItemViewModel parentCloud)
            : base(parentCloud, true)
        {
            Messenger.Default.Send(new NotificationMessageAction <ICloudFoundryProvider>(
                                       Messages.GetCloudFoundryProvider, p => provider = p));
            OpenApplicationCommand    = new RelayCommand <MouseButtonEventArgs>(OpenApplication);
            StartApplicationCommand   = new RelayCommand(StartApplication, CanStart);
            StopApplicationCommand    = new RelayCommand(StopApplication, CanStop);
            RestartApplicationCommand = new RelayCommand(RestartApplication, CanStop);
            DeleteApplicationCommand  = new RelayCommand(DeleteApplication);

            Application = application;
            Application.InstanceCollection.CollectionChanged += InstanceCollection_CollectionChanged;
            dispatcher = Dispatcher.CurrentDispatcher;
        }
        public ApplicationTreeViewItemViewModel(Application application, CloudTreeViewItemViewModel parentCloud)
            : base(parentCloud, true)
        {
            Messenger.Default.Send(new NotificationMessageAction<ICloudFoundryProvider>(
                                       Messages.GetCloudFoundryProvider, p => provider = p));
            OpenApplicationCommand = new RelayCommand<MouseButtonEventArgs>(OpenApplication);
            StartApplicationCommand = new RelayCommand(StartApplication, CanStart);
            StopApplicationCommand = new RelayCommand(StopApplication, CanStop);
            RestartApplicationCommand = new RelayCommand(RestartApplication, CanStop);
            DeleteApplicationCommand = new RelayCommand(DeleteApplication);

            Application = application;
            Application.InstanceCollection.CollectionChanged += InstanceCollection_CollectionChanged;
            dispatcher = Dispatcher.CurrentDispatcher;
        }
        private void provider_CloudRemoved(object sender, CloudEventArgs e)
        {
            CloudTreeViewItemViewModel cloudTreeViewItem = clouds.SingleOrDefault((i) => i.Cloud.Equals(e.Cloud));

            clouds.Remove(cloudTreeViewItem);
        }