Example #1
0
        /// <summary>
        /// Function to retrieve a plug in list item view model based on the plug in passed in.
        /// </summary>
        /// <param name="plugin">The plug in to retrieve data from.</param>
        /// <returns>The view model.</returns>
        private ISettingsPlugInListItem GetPlugInListItem(IDisabledPlugIn plugin)
        {
            var result = new SettingsPlugInListItem();

            result.Initialize(new SettingsPlugInListItemParameters(plugin, _viewModelInjection));
            return(result);
        }
Example #2
0
        /// <summary>Initializes a new instance of the <see cref="SettingsPlugInListItemParameters"/> class.</summary>
        /// <param name="plugin">The plugin to evaluate.</param>
        /// <param name="commonServices">Common application services.</param>
        /// <exception cref="ArgumentNullException">Thrown when the <paramref name="plugin"/> is parameter <b>null</b>.</exception>
        public SettingsPlugInListItemParameters(IDisabledPlugIn plugin, IViewModelInjection commonServices)
            : base(commonServices)
        {
            if (plugin == null)
            {
                throw new ArgumentNullException(nameof(plugin));
            }

            Name           = plugin.PlugInName;
            Type           = PlugInType.Unknown;
            State          = plugin.ReasonCode.ToString();
            DisabledReason = plugin.Description;
            Path           = plugin.Path;
        }