public TopicViewModel(IPubsubSourceRootViewModel owner, Topic topic, IEnumerable <Subscription> subscriptions)
     : base(owner, new TopicItem(topic), subscriptions)
 {
     Icon        = s_topicIcon.Value;
     ContextMenu = new ContextMenu
     {
         ItemsSource = new List <MenuItem>
         {
             new MenuItem
             {
                 Header  = Resources.CloudExplorerPubSubNewSubscriptionMenuHeader,
                 Command = new ProtectedCommand(OnNewSubscriptionCommand)
             },
             new MenuItem
             {
                 Header  = Resources.CloudExplorerPubSubDeleteTopicMenuHeader,
                 Command = new ProtectedCommand(OnDeleteTopicCommand)
             },
             new MenuItem
             {
                 Header  = Resources.UiPropertiesMenuHeader,
                 Command = new ProtectedCommand(OnPropertiesWindowCommand)
             }
         }
     };
 }
 protected TopicViewModelBase(
     IPubsubSourceRootViewModel owner,
     ITopicItem item,
     IEnumerable <Subscription> subscriptions)
 {
     Owner   = owner;
     Item    = item;
     Caption = Item.DisplayName;
     AddSubscriptonsOfTopic(subscriptions);
 }
示例#3
0
        public OrphanedSubscriptionsViewModel(IPubsubSourceRootViewModel owner, IEnumerable <Subscription> subscriptions)
            : base(owner, new OrphanedSubscriptionsItem(owner.Context.CurrentProject.ProjectId), subscriptions)
        {
            Icon = s_orphanedSubscriptionIcon.Value;

            // Include an invisible context menu so child context menus continue to show up.
            ContextMenu = new ContextMenu
            {
                ItemsSource = new List <MenuItem>
                {
                    new MenuItem
                    {
                        Header  = Resources.UiOpenOnCloudConsoleMenuHeader,
                        Command = new ProtectedCommand(OnOpenCloudConsoleCommand)
                    }
                }
            };
        }
 public void AssetOwnerEquals(IPubsubSourceRootViewModel ownerMockObject)
 {
     Assert.AreEqual(ownerMockObject, Owner);
 }
 public TestTopicViewModelBase(
     IPubsubSourceRootViewModel owner,
     ITopicItem item,
     IEnumerable <Subscription> subscriptions) : base(owner, item, subscriptions)
 {
 }