protected override void OnExpand(MMC.AsyncStatus status) { status.ReportProgress(50, 100, Globalization.MultilanguageResource.GetString("Expanding_Msg10")); this.Render(); status.Complete(Globalization.MultilanguageResource.GetString("Done_Msg10"), true); base.OnExpand(status); }
/// <summary> /// Node plus sign clicked to expand the node. Load in children. /// </summary> /// <param name="status">asynchronous status for updating the console</param> protected override void OnExpand(AsyncStatus status) { int foundChildren = 10; // report progress status.ReportProgress(0, foundChildren, "Loading Sample children..."); // find results for (int child = 1; child < foundChildren; child++) { // The Thread.Sleep statement below is for demo purposes only. When doing your // development you should not block your snap-in thread to service an // async request like OnExpand unless you only use the scope tree and // list view and never show any WinForms views or WinForms property pages. // The reason is that your WinForms views and property pages will be blocked, // and in certain cases that can also block MMC. // Sleep for a second. Thread.Sleep(1000); // add the child ScopeNode childNode = new StatusNode(); childNode.DisplayName = "Added " + System.DateTime.Now.ToLongTimeString(); this.Children.Add(childNode); // update the progress status.ReportProgress(child, foundChildren, "Loading Sample children..."); } // update progress status.Complete("Loading Sample complete.", true); }
protected override void OnInitialize(MMC.AsyncStatus status) { base.OnInitialize(status); status.Title = Globalization.MultilanguageResource.GetString("Refreshing_Msg10"); status.ReportProgress(50, 100, Globalization.MultilanguageResource.GetString("Refreshing_Msg10")); /*Application.DoEvents();*/ base.OnInitialize(status); this.Columns.Clear(); this.Columns[0].Title = Globalization.MultilanguageResource.GetString("ColumnHeader_MemberName"); this.Columns[0].SetWidth(200); this.Columns.AddRange( new MMC.MmcListViewColumn[] { new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_Type"), 100), new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_Description"), 300), new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_ItemID"), 100) }); this.Mode = MMC.MmcListViewMode.Report; this.Refresh(); ItemDefinitionScopeNode idSN = this.ScopeNode as ItemDefinitionScopeNode; if (idSN != null) { idSN.ScopeNodeChanged += new ScopeNodeChangedHandler(ItemMembersListView_ScopeNodeChanged); } status.Complete(Globalization.MultilanguageResource.GetString("RefreshComplete_Msg10"), true); /*Application.DoEvents();*/ }
protected override void OnInitialize(MMC.AsyncStatus status) { base.OnInitialize(status); status.Title = Globalization.MultilanguageResource.GetString("Refreshing_Msg10"); status.ReportProgress(50, 100, Globalization.MultilanguageResource.GetString("Refreshing_Msg10")); /*Application.DoEvents();*/ base.OnInitialize(status); this.Columns.Clear(); this.Columns[0].Title = Globalization.MultilanguageResource.GetString("ColumnHeader_Name"); this.Columns[0].SetWidth(250); this.Columns.AddRange( new MMC.MmcListViewColumn[] { new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_AuthorizationType"), 150), new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_WhereDefined"), 100), new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_Owner"), 250), new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_ValidFrom"), 180), new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_ValidTo"), 180), new MMC.MmcListViewColumn("Sid", 300) }); this.Mode = MMC.MmcListViewMode.Report; this.Refresh(); ItemAuthorizationScopeNode itSN = this.ScopeNode as ItemAuthorizationScopeNode; if (itSN != null) { itSN.ScopeNodeChanged += new ScopeNodeChangedHandler(AuthorizationsListView_ScopeNodeChanged); } status.Complete(Globalization.MultilanguageResource.GetString("RefreshComplete_Msg10"), true); /*Application.DoEvents();*/ }
protected override void OnRefresh(MMC.AsyncStatus status) { base.OnRefresh(status); status.ReportProgress(50, 100, Globalization.MultilanguageResource.GetString("Refreshing_Msg10")); //Children this.Refresh(); status.Complete(Globalization.MultilanguageResource.GetString("RefreshComplete_Msg10"), true); /*Application.DoEvents();*/ }
protected override void OnRefresh(MMC.AsyncStatus status) { try { status.ReportProgress(50, 100, ""); this.NotifyChanged(); /*Application.DoEvents();*/ } catch { //ignore ... because viewDescription List can be shutting down. } }
protected override void OnInitialize(MMC.AsyncStatus status) { base.OnInitialize(status); status.Title = Globalization.MultilanguageResource.GetString("Refreshing_Msg10"); status.ReportProgress(50, 100, Globalization.MultilanguageResource.GetString("Refreshing_Msg10")); /*Application.DoEvents();*/ base.OnInitialize(status); this.Columns.Clear(); this.Columns[0].Title = Globalization.MultilanguageResource.GetString("ColumnHeader_ItemName"); this.Columns[0].SetWidth(200); this.Columns.AddRange( new MMC.MmcListViewColumn[] { new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_Description"), 300), new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_ItemID"), 100) }); this.Mode = MMC.MmcListViewMode.Report; status.Complete(Globalization.MultilanguageResource.GetString("RefreshComplete_Msg10"), true); /*Application.DoEvents();*/ }
protected override void OnInitialize(MMC.AsyncStatus status) { base.OnInitialize(status); status.Title = Globalization.MultilanguageResource.GetString("Refreshing_Msg10"); status.ReportProgress(50, 100, Globalization.MultilanguageResource.GetString("Refreshing_Msg10")); /*Application.DoEvents();*/ base.OnInitialize(status); this.Columns.Clear(); if (((ApplicationGroupScopeNode)this.ScopeNode).ApplicationGroup.GroupType == GroupType.Basic) { this.Columns[0].Title = Globalization.MultilanguageResource.GetString("ColumnHeader_Name"); this.Columns[0].SetWidth(200); this.Columns.AddRange( new MMC.MmcListViewColumn[] { new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_WhereDefined"), 100), new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_MemberNonMember"), 150), new MMC.MmcListViewColumn("Sid", 300) }); } else { this.Columns[0].Title = Globalization.MultilanguageResource.GetString("ColumnHeader_Name"); this.Columns[0].SetWidth(200); this.Columns.AddRange( new MMC.MmcListViewColumn[] { new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_Description"), 250), new MMC.MmcListViewColumn(Globalization.MultilanguageResource.GetString("ColumnHeader_LDAPQuery"), 400) }); } this.Mode = MMC.MmcListViewMode.Report; this.Refresh(); ApplicationGroupScopeNode appSN = this.ScopeNode as ApplicationGroupScopeNode; if (appSN != null) { appSN.ScopeNodeChanged += new ScopeNodeChangedHandler(ApplicationNodeListView_ScopeNodeChanged); } status.Complete(Globalization.MultilanguageResource.GetString("RefreshComplete_Msg10"), true); /*Application.DoEvents();*/ }