예제 #1
0
        public override object BuildUp(IBuilderContext context, Type typeToBuild, object existing, string idToBuild)
        {
            workItem = StrategyUtility.GetWorkItem(context, existing);
            if (existing is Control)
            {
                RegisterMouseEvent(existing as Control, true);
            }

            return(base.BuildUp(context, typeToBuild, existing, idToBuild));
        }
예제 #2
0
        public override object TearDown(IBuilderContext context, object item)
        {
            WorkItem workItem = StrategyUtility.GetWorkItem(context, item);

            if (workItem != null)
            {
                IDocumentService documentService = workItem.Services.Get <IDocumentService>();
                if (documentService != null && item is Control)
                {
                    RegisterDocumentAdapter(documentService, (Control)item, false);
                }
            }
            return(base.TearDown(context, item));
        }
예제 #3
0
        /// <summary>
        /// See <see cref="IBuilderStrategy.TearDown"/> for more information.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="item"></param>
        /// <returns></returns>
        public override object TearDown(IBuilderContext context, object item)
        {
            WorkItem workItem = StrategyUtility.GetWorkItem(context, item);

            if (workItem != null)
            {
                IEditableService editableService = workItem.Services.Get <IEditableService>();
                if (editableService != null && item is Control)
                {
                    RegisterTextEdit(editableService, (Control)item, false);
                }
            }
            return(base.TearDown(context, item));
        }
        public override object BuildUp(IBuilderContext context, Type typeToBuild, object existing, string idToBuild)
        {
            WorkItem workItem = StrategyUtility.GetWorkItem(context, existing);

            if (workItem != null)
            {
                IPrintableService printableService = workItem.Services.Get <IPrintableService>();
                if (printableService != null && existing is Control)
                {
                    RegisterPrintableAdapter(workItem, printableService, (Control)existing, true);
                }
            }

            return(base.BuildUp(context, typeToBuild, existing, idToBuild));
        }
예제 #5
0
        /// <summary>
        /// See <see cref="IBuilderStrategy.TearDown"/> for more information.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="item"></param>
        /// <returns></returns>
        public override object TearDown(IBuilderContext context, object item)
        {
            WorkItem workItem = StrategyUtility.GetWorkItem(context, item);

            if (workItem != null)
            {
                IDataListViewService dataService = workItem.Services.Get <IDataListViewService>();

                if (dataService != null && item is IDataListView)
                {
                    IDataListView handler = item as IDataListView;
                    dataService.UnRegister(handler);
                }
            }

            return(base.TearDown(context, item));
        }
예제 #6
0
        public override object TearDown(IBuilderContext context, object item)
        {
            WorkItem workItem = StrategyUtility.GetWorkItem(context, item);

            if (workItem != null)
            {
                IAuthorizationService catalog = workItem.Services.Get <IAuthorizationService>();
                if (catalog != null)
                {
                    Type type = item.GetType();
                    foreach (MethodInfo method in type.GetMethods())
                    {
                        RemoveActionImplementation(catalog, method);
                    }
                }
            }
            return(base.TearDown(context, item));
        }
예제 #7
0
        public override object BuildUp(IBuilderContext context, Type typeToBuild, object existing, string idToBuild)
        {
            WorkItem workItem = StrategyUtility.GetWorkItem(context, existing);

            if (workItem != null)
            {
                IAuthorizationService authService = workItem.Services.Get <IAuthorizationService>();
                if (authService != null)
                {
                    Type type = existing.GetType();
                    foreach (MethodInfo method in type.GetMethods())
                    {
                        RegisterActionImplementation(context, existing, idToBuild, authService, method);
                    }
                }
            }
            return(base.BuildUp(context, typeToBuild, existing, idToBuild));
        }
예제 #8
0
        /// <summary>
        /// See <see cref="IBuilderStrategy.BuildUp"/> for more information.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="typeToBuild"></param>
        /// <param name="existing"></param>
        /// <param name="idToBuild"></param>
        /// <returns></returns>
        public override object BuildUp(IBuilderContext context, Type typeToBuild, object existing, string idToBuild)
        {
            WorkItem workItem = StrategyUtility.GetWorkItem(context, existing);

            if (workItem != null)
            {
                IDataListViewService dataService = workItem.Services.Get <IDataListViewService>();

                // 如果视图实现了数据列表服务则在系统中注册它
                if (dataService != null && existing is IDataListView)
                {
                    IDataListView handler = existing as IDataListView;
                    dataService.Register(handler);
                }
            }

            return(base.BuildUp(context, typeToBuild, existing, idToBuild));
        }