void _activator_Emphasise(object sender, 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(); } }
public void RequestItemEmphasis(object sender, EmphasiseRequest request) { //ensure a relevant Toolbox is available var descendancy = CoreChildProvider.GetDescendancyListIfAnyFor(request.ObjectToEmphasise); object root = null; if (descendancy != null) { root = descendancy.Parents.FirstOrDefault(); } else { root = request.ObjectToEmphasise; //assume maybe o is a root object itself? } if (root != null) { _windowManager.ShowCollectionWhichSupportsRootObjectType(root); } //really should be a listener now btw since we just launched the relevant Toolbox if it wasn't there before var h = Emphasise; if (h != null) { var args = new EmphasiseEventArgs(request); h(this, args); var content = args.FormRequestingActivation as DockContent; if (content != null) { content.Activate(); } } }
void _activator_Emphasise(object sender, 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) { catalogueCollectionFilterUI1.EnsureVisible(c); ApplyFilters(); } }
public override void RequestItemEmphasis(object sender, EmphasiseRequest request) { //ensure a relevant Toolbox is available var descendancy = CoreChildProvider.GetDescendancyListIfAnyFor(request.ObjectToEmphasise); object root = null; if (descendancy != null) { root = descendancy.Parents.FirstOrDefault(); } else { root = request.ObjectToEmphasise; //assume maybe o is a root object itself? } if (root is CohortIdentificationConfiguration cic) { Activate <CohortIdentificationConfigurationUI, CohortIdentificationConfiguration>(cic); } else if (root != null) { _windowManager.ShowCollectionWhichSupportsRootObjectType(root); } //really should be a listener now btw since we just launched the relevant Toolbox if it wasn't there before //Look at assignments to Sender, the invocation list can change the Sender! var args = new EmphasiseEventArgs(request); base.OnEmphasise(this, args); //might be different than sender that was passed in if (args.Sender is DockContent content) { content.Activate(); } //user is being shown the given object so track it as a recent (e.g. GoTo etc) HistoryProvider.Add(args.Request.ObjectToEmphasise); }
void _activator_Emphasise(object sender, 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.Sender = Tree.FindForm(); }
private void RecordEmphasis(object sender, EmphasiseEventArgs args) { Navigation.Append(new CollectionNavigation(args.Request.ObjectToEmphasise)); }