コード例 #1
0
        internal static IPluginSummary CreateSummary(IPlugin plugin)
        {
            var summary = new PluginSummary
            {
                Id                = plugin.Id,
                IsValid           = plugin.IsValid,
                Version           = plugin.Version,
                IsVisible         = plugin.IsVisible,
                FullNameOfType    = plugin.GetType().FullName,
                Description       = plugin.Description,
                Shortcut          = plugin.Shortcut,
                Image             = plugin.Image,
                PreviousShortcuts = plugin.PreviousShortcuts,
                ValidFrom         = plugin.ValidFrom,
                ValidTo           = plugin.ValidTo,
                ProgramType       = plugin.GetProgramType()
            };

            var permissionScanner = new PermissionAttributeScanner(plugin);

            summary.PermissionId = permissionScanner.GetPermissionId();

            var responsibleScanner = new ResponsibleAttributeScanner(plugin);

            summary.Responsible = responsibleScanner.GetAttribute() != null
                ? responsibleScanner.GetAttribute().ToString()
                : string.Empty;

            return(summary);
        }
コード例 #2
0
        public string GetPermissionId()
        {
            var permissionScanner = new PermissionAttributeScanner(_instance);

            return(permissionScanner.GetPermissionId());
        }