示例#1
0
        internal CertsNode(CaControl info, CertStatus certStatus)
        {
            caInfo = info;
            status = certStatus;

            this.ImageIndex         = 3;
            this.SelectedImageIndex = 3;

            // Create the CaInfoContext instance for use by the ListView
            CaInfoContext context = new CaInfoContext(info)
            {
                certStatus = status
            };

            // Create a ListView for the node.
            MmcListViewDescription lvd = new MmcListViewDescription();

            lvd.DisplayName = caInfo.CAName;
            lvd.ViewType    = typeof(CertListView);
            lvd.Options     = MmcListViewOptions.ExcludeScopeNodes | MmcListViewOptions.SingleSelect;
            lvd.Tag         = context;

            this.ViewDescriptions.Add(lvd);
            this.ViewDescriptions.DefaultIndex = 0;

            Refresh();
        }
示例#2
0
        /// <summary>
        /// Define the ListView's structure
        /// </summary>
        /// <param name="status">status for updating the console</param>
        protected override void OnInitialize(AsyncStatus status)
        {
            // do default handling
            base.OnInitialize(status);

            // Start listening for scope node events
            ((CertsNode)this.ScopeNode).Changed += new CertsNode.ChangedDelegate(OnScopeNodeChange);

            // get the certStatus
            context = (CaInfoContext)this.ViewDescriptionTag;

            // Create a set of columns for use in the list view
            this.Columns[0].Title = "Subject";
            this.Columns[0].SetWidth(200);

            if ((context.certStatus == CertStatus.Current) || (context.certStatus == CertStatus.Expired))
            {
                // Add detail column
                this.Columns.Add(new MmcListViewColumn("Issue Date", 100));
                this.Columns.Add(new MmcListViewColumn("Expiry Date", 100));
                this.Columns.Add(new MmcListViewColumn("Profile", 75));
                this.Columns.Add(new MmcListViewColumn("Serial Number", 200));
            }
            else
            {
                // Add detail columns
                this.Columns.Add(new MmcListViewColumn("Revocation Date", 100));
                this.Columns.Add(new MmcListViewColumn("Revocation Reason", 100));
                this.Columns.Add(new MmcListViewColumn("Profile", 75));
                this.Columns.Add(new MmcListViewColumn("Serial Number", 200));
            }
            // Set to show all columns
            this.Mode = MmcListViewMode.Report;

            // set to show refresh as an option
            this.SelectionData.EnabledStandardVerbs = StandardVerbs.Refresh;

            // Load the list with values
            Refresh();
        }