コード例 #1
0
        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();
                }
            }
        }
コード例 #2
0
ファイル: ActivateItems.cs プロジェクト: HDRUK/RDMP
        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);
        }
コード例 #3
0
ファイル: TestActivateItems.cs プロジェクト: lulzzz/RDMP
 public void RequestItemEmphasis(object sender, EmphasiseRequest request)
 {
     Emphasise?.Invoke(sender, new EmphasiseEventArgs(request));
 }