Inheritance: GoogleCloudExtension.CloudExplorer.SourceRootViewModelBase
Exemple #1
0
        public BucketViewModel(GcsSourceRootViewModel owner, Bucket bucket)
        {
            _owner  = owner;
            _bucket = bucket;
            _item   = new Lazy <BucketItem>(GetItem);

            Caption = _bucket.Name;
            Icon    = s_bucketIcon.Value;

            var menuItems = new List <MenuItem>
            {
                new MenuItem {
                    Header = Resources.UiBrowseMenuHeader, Command = new ProtectedCommand(OnBrowseCommand)
                },
                new MenuItem {
                    Header = Resources.UiOpenOnCloudConsoleMenuHeader, Command = new ProtectedCommand(OnOpenOnCloudConsoleCommand)
                },
                new MenuItem {
                    Header = Resources.UiPropertiesMenuHeader, Command = new ProtectedCommand(OnPropertiesCommand)
                },
            };

            ContextMenu = new ContextMenu {
                ItemsSource = menuItems
            };
        }
        public BucketLocationViewModel(GcsSourceRootViewModel owner, string name, IEnumerable <BucketViewModel> buckets)
        {
            _owner   = owner;
            _buckets = buckets;

            Caption = String.Format(Resources.CloudExplorerGcsBucketLocationCaption, name, buckets.Count());
            Icon    = s_zoneIcon.Value;
            foreach (var bucket in _buckets)
            {
                Children.Add(bucket);
            }
        }
        public BucketLocationViewModel(GcsSourceRootViewModel owner, string name, IEnumerable<BucketViewModel> buckets)
        {
            _owner = owner;
            _buckets = buckets;

            Caption = String.Format(Resources.CloudExplorerGcsBucketLocationCaption, name, buckets.Count());
            Icon = s_zoneIcon.Value;
            foreach (var bucket in _buckets)
            {
                Children.Add(bucket);
            }
        }
        public BucketViewModel(GcsSourceRootViewModel owner, Bucket bucket)
        {
            _owner = owner;
            _bucket = bucket;
            _item = new Lazy<BucketItem>(GetItem);
            _openOnCloudConsoleCommand = new ProtectedCommand(OnOpenConCloudConsoleCommand);

            Caption = _bucket.Name;
            Icon = s_bucketIcon.Value;

            var menuItems = new List<MenuItem>
            {
                new MenuItem { Header = Resources.UiOpenOnCloudConsoleMenuHeader, Command = _openOnCloudConsoleCommand },
                new MenuItem { Header = Resources.UiPropertiesMenuHeader, Command = new ProtectedCommand(OnPropertiesCommand) },
            };
            ContextMenu = new ContextMenu { ItemsSource = menuItems };
        }