示例#1
0
        internal PackageViewModel(
            IPackage package,
            string source,
            IMruManager mruManager,
            IUIServices uiServices,
            IPackageEditorService editorService,
            ISettingsManager settingsManager,
            CredentialPublishProvider credentialPublishProvider,
            IList <Lazy <IPackageContentViewer, IPackageContentViewerMetadata> > contentViewerMetadata,
            IList <Lazy <IPackageRule> > packageRules)
        {
            _settingsManager           = settingsManager ?? throw new ArgumentNullException(nameof(settingsManager));
            _editorService             = editorService ?? throw new ArgumentNullException(nameof(editorService));
            _uiServices                = uiServices ?? throw new ArgumentNullException(nameof(uiServices));
            _mruManager                = mruManager ?? throw new ArgumentNullException(nameof(mruManager));
            _credentialPublishProvider = credentialPublishProvider ?? throw new ArgumentNullException(nameof(credentialPublishProvider));
            _package = package ?? throw new ArgumentNullException(nameof(package));
            _contentViewerMetadata = contentViewerMetadata;
            _packageRules          = packageRules;

            _packageMetadata = new EditablePackageMetadata(_package, _uiServices);

            PackageSource = source;

            _isSigned = _packageMetadata.IsSigned;

            _packageRoot = PathToTreeConverter.Convert(_package.GetFiles().ToList(), this);
        }
示例#2
0
        public MainWindow(IMruManager mruManager)
        {
            InitializeComponent();

            RecentFilesMenuItem.DataContext = _mruManager = mruManager;
            RecentFilesContainer.Collection = _mruManager.Files;
        }
示例#3
0
#pragma warning disable CS8618 // Non-nullable field is uninitialized.
        internal PackageViewModel(
#pragma warning restore CS8618 // Non-nullable field is uninitialized.
            IPackage package,
            string path,
            string source,
            IMruManager mruManager,
            IUIServices uiServices,
            IPackageEditorService editorService,
            ISettingsManager settingsManager,
            CredentialPublishProvider credentialPublishProvider,
            IList <Lazy <IPackageContentViewer, IPackageContentViewerMetadata> > contentViewerMetadata,
            IList <Lazy <IPackageRule> > packageRules)
        {
            SettingsManager            = settingsManager ?? throw new ArgumentNullException(nameof(settingsManager));
            _editorService             = editorService ?? throw new ArgumentNullException(nameof(editorService));
            UIServices                 = uiServices ?? throw new ArgumentNullException(nameof(uiServices));
            _mruManager                = mruManager ?? throw new ArgumentNullException(nameof(mruManager));
            _credentialPublishProvider = credentialPublishProvider ?? throw new ArgumentNullException(nameof(credentialPublishProvider));
            _package = package ?? throw new ArgumentNullException(nameof(package));
            ContentViewerMetadata = contentViewerMetadata;
            _packageRules         = packageRules;

            _packageMetadata = new EditablePackageMetadata(_package, UIServices);

            PackagePath   = path;
            PackageSource = source;

            _isSigned = _packageMetadata.IsSigned;

            RootFolder = PathToTreeConverter.Convert(_package.GetFiles().ToList(), this);
        }
示例#4
0
        internal PackageViewModel(
            IPackage package,
            string source,
            IMruManager mruManager,
            IUIServices uiServices,
            IPackageEditorService editorService,
            ISettingsManager settingsManager)
        {
            if (package == null) {
                throw new ArgumentNullException("package");
            }
            if (mruManager == null) {
                throw new ArgumentNullException("mruManager");
            }
            if (uiServices == null) {
                throw new ArgumentNullException("uiServices");
            }
            if (editorService == null) {
                throw new ArgumentNullException("editorService");
            }
            if (settingsManager == null) {
                throw new ArgumentNullException("settingsManager");
            }

            _settingsManager = settingsManager;
            _editorService = editorService;
            _uiServices = uiServices;
            _mruManager = mruManager;
            _package = package;
            _packageMetadata = new EditablePackageMetadata(_package);
            PackageSource = source;

            _packageRoot = PathToTreeConverter.Convert(_package.GetFiles().ToList(), this);
        }
示例#5
0
        public MainWindow(IMruManager mruManager, IPackageViewModelFactory packageViewModelFactory)
        {
            InitializeComponent();

            RecentFilesMenuItem.DataContext = _mruManager = mruManager;
            RecentFilesContainer.Collection = _mruManager.Files;

            _packageViewModelFactory = packageViewModelFactory;
        }
示例#6
0
        public MainWindow(IMruManager mruManager, IPackageViewModelFactory packageViewModelFactory)
        {
            InitializeComponent();

            RecentFilesMenuItem.DataContext = _mruManager = mruManager;
            RecentFilesContainer.Collection = _mruManager.Files;

            _packageViewModelFactory = packageViewModelFactory;
        }
示例#7
0
        public MainWindow(IMruManager mruManager)
        {
            InitializeComponent();

            RecentFilesMenuItem.DataContext = _mruManager = mruManager;
            RecentFilesContainer.Collection = _mruManager.Files;

            if (AppCompat.IsWindows10S)
            {
                pluginMenuItem.Visibility = Visibility.Collapsed;
                pluginMenuItem.IsEnabled  = false;
                mnuPluginSep.Visibility   = Visibility.Collapsed;
            }
        }
#pragma warning disable CS8618 // Non-nullable field is uninitialized.
        public MainWindow(IMruManager mruManager)
#pragma warning restore CS8618 // Non-nullable field is uninitialized.
        {
            InitializeComponent();

            RecentFilesMenuItem.DataContext = _mruManager = mruManager;
            RecentFilesContainer.Collection = _mruManager.Files;

            if (AppCompat.IsWindows10S)
            {
                pluginMenuItem.Visibility = Visibility.Collapsed;
                pluginMenuItem.IsEnabled  = false;
                mnuPluginSep.Visibility   = Visibility.Collapsed;
            }
        }
        internal PackageViewModel(
            IPackage package,
            string source,
            IMruManager mruManager,
            IUIServices uiServices,
            IPackageEditorService editorService,
            ISettingsManager settingsManager,
            IList <Lazy <IPackageContentViewer, IPackageContentViewerMetadata> > contentViewerMetadata,
            IList <Lazy <IPackageRule> > packageRules)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }
            if (mruManager == null)
            {
                throw new ArgumentNullException("mruManager");
            }
            if (uiServices == null)
            {
                throw new ArgumentNullException("uiServices");
            }
            if (editorService == null)
            {
                throw new ArgumentNullException("editorService");
            }
            if (settingsManager == null)
            {
                throw new ArgumentNullException("settingsManager");
            }

            _settingsManager       = settingsManager;
            _editorService         = editorService;
            _uiServices            = uiServices;
            _mruManager            = mruManager;
            _package               = package;
            _contentViewerMetadata = contentViewerMetadata;
            _packageRules          = packageRules;

            _packageMetadata = new EditablePackageMetadata(_package);

            PackageSource = source;

            _packageRoot = PathToTreeConverter.Convert(_package.GetFiles().ToList(), this);

            // HACK: this is after the package.GetFiles() since that reads the signature
            _packageMetadata.PublisherCertificate = _package.PublisherCertificate;
        }
        internal PackageViewModel(
            IPackage package,
            string source,
            IMruManager mruManager,
            IUIServices uiServices,
            IPackageEditorService editorService,
            ISettingsManager settingsManager,
            IList <Lazy <IPackageContentViewer, IPackageContentViewerMetadata> > contentViewerMetadata,
            IList <Lazy <IPackageRule> > packageRules)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }
            if (mruManager == null)
            {
                throw new ArgumentNullException("mruManager");
            }
            if (uiServices == null)
            {
                throw new ArgumentNullException("uiServices");
            }
            if (editorService == null)
            {
                throw new ArgumentNullException("editorService");
            }
            if (settingsManager == null)
            {
                throw new ArgumentNullException("settingsManager");
            }

            _settingsManager       = settingsManager;
            _editorService         = editorService;
            _uiServices            = uiServices;
            _mruManager            = mruManager;
            _package               = package;
            _contentViewerMetadata = contentViewerMetadata;
            _packageRules          = packageRules;

            _packageMetadata = new EditablePackageMetadata(_package, _uiServices);

            PackageSource = source;
            _isSigned     = package.IsSigned;

            _packageRoot = PathToTreeConverter.Convert(_package.GetFiles().ToList(), this);
        }
示例#11
0
        public MainWindow(IMruManager mruManager)
        {
            _mruManager = mruManager ?? throw new ArgumentNullException(nameof(mruManager));

            this.InitializeComponent();

            //RecentFilesMenuItem.DataContext = _mruManager = mruManager;
            //RecentFilesContainer.Collection = _mruManager.Files;

            //if (AppCompat.IsWindows10S)
            //{
            //    pluginMenuItem.Visibility = Visibility.Collapsed;
            //    pluginMenuItem.IsEnabled = false;
            //    mnuPluginSep.Visibility = Visibility.Collapsed;
            //}

            DiagnosticsClient.TrackPageView(nameof(MainWindow));
        }
示例#12
0
#pragma warning disable CS8618 // Non-nullable field is uninitialized.
        public MainWindow(IMruManager mruManager)
#pragma warning restore CS8618 // Non-nullable field is uninitialized.
        {
            if (mruManager is null)
            {
                throw new ArgumentNullException(nameof(mruManager));
            }

            InitializeComponent();

            RecentFilesMenuItem.DataContext = _mruManager = mruManager;
            RecentFilesContainer.Collection = _mruManager.Files;

            if (AppCompat.IsWindows10S)
            {
                pluginMenuItem.Visibility = Visibility.Collapsed;
                pluginMenuItem.IsEnabled  = false;
                mnuPluginSep.Visibility   = Visibility.Collapsed;
            }

            DiagnosticsClient.TrackPageView(nameof(MainWindow));
        }
示例#13
0
 public MainPageViewModel(IDeployAgent deployAgent, IMruManager mostRecentlyUsedFilesManager)
 {
     this.DeployAgent = deployAgent;
     this.MostRecentlyUsedFilesManager = mostRecentlyUsedFilesManager;
 }