void _activator_Emphasise(object sender, ItemActivation.Emphasis.EmphasiseEventArgs args) { //user wants this object emphasised var c = args.Request.ObjectToEmphasise as Catalogue; if (c == null) { var descendancy = _activator.CoreChildProvider.GetDescendancyListIfAnyFor(args.Request.ObjectToEmphasise); if (descendancy != null) { c = descendancy.Parents.OfType <Catalogue>().SingleOrDefault(); } } if (c != null) { if ((c.IsColdStorageDataset || c.IsDeprecated || c.IsInternalDataset)) { //trouble is our flags might be hiding it so make sure it is visible cbShowColdStorage.Checked = cbShowColdStorage.Checked || c.IsColdStorageDataset; cbShowDeprecated.Checked = cbShowDeprecated.Checked || c.IsDeprecated; cbShowInternal.Checked = cbShowInternal.Checked || c.IsInternalDataset; } var isExtractable = c.GetExtractabilityStatus(null); cbShowNonExtractable.Checked = cbShowNonExtractable.Checked || isExtractable == null || isExtractable.IsExtractable == false; ApplyFilters(); } }
void _activator_Emphasise(object sender, ItemActivation.Emphasis.EmphasiseEventArgs args) { var rootObject = _activator.GetRootObjectOrSelf(args.Request.ObjectToEmphasise); // unpin first if there is somthing pinned, so we find our object! if (_pinFilter != null && _activator.IsRootObjectOfCollection(_collection, rootObject)) { _pinFilter.UnApplyToTree(); } //get the parental hierarchy var decendancyList = CoreChildProvider.GetDescendancyListIfAnyFor(args.Request.ObjectToEmphasise); if (decendancyList != null) { //for each parent in the decendandy list foreach (var parent in decendancyList.Parents) { //parent isn't in our tree if (Tree.IndexOf(parent) == -1) { return; } //parent is in our tree so make sure it's expanded Tree.Expand(parent); } } //tree doesn't contain object even after expanding parents int index = Tree.IndexOf(args.Request.ObjectToEmphasise); if (index == -1) { return; } if (args.Request.ExpansionDepth > 0) { try { Tree.BeginUpdate(); ExpandToDepth(args.Request.ExpansionDepth, args.Request.ObjectToEmphasise); } finally { Tree.EndUpdate(); } } if (args.Request.Pin && Settings.AllowPinning) { Pin(args.Request.ObjectToEmphasise, decendancyList); } //update index now pin filter is applied index = Tree.IndexOf(args.Request.ObjectToEmphasise); //select the object and ensure it's visible Tree.SelectedObject = args.Request.ObjectToEmphasise; Tree.EnsureVisible(index); args.FormRequestingActivation = Tree.FindForm(); }