예제 #1
0
        /// <summary>
        /// Registers the specified UI element.
        /// </summary>
        /// <param name="uiElement">The UI element.</param>
        public void Register(object uiElement)
        {
            IPrintHandler handler = FactoryCatalog.GetFactory(uiElement).GetAdapter(uiElement);

            handlers.Add(uiElement, handler);
            Register(handler);
        }
예제 #2
0
        public void Register(object dataList)
        {
            IDataListView handler = FactoryCatalog.GetFactory(dataList).GetAdapter(dataList);

            views.Add(dataList, handler);
            Register(handler);
        }
예제 #3
0
        /// <summary>
        /// 注册文档处理组件
        /// </summary>
        /// <param name="uiElement">文档处理UI组件.</param>
        public void Register(object uiElement)
        {
            IDocumentHandler handler = FactoryCatalog.GetFactory(uiElement).GetAdapter(uiElement);

            if (handler != null)
            {
                handlers.Add(uiElement, handler);
                Register(handler);
            }
        }
        /// <summary>
        /// Registers a site for the given UI element by asking the adapter factory to
        /// automatically allocate an adapter based on the element type.
        /// </summary>
        /// <param name="siteName">The site name to register.</param>
        /// <param name="uiElement">The UI element.</param>
        public void RegisterSite(string siteName, object uiElement)
        {
            Guard.ArgumentNotNullOrEmptyString(siteName, "siteName");
            Guard.ArgumentNotNull(uiElement, "uiElement");

            IUIElementAdapterFactory factory = FactoryCatalog.GetFactory(uiElement);
            IUIElementAdapter        adapter = factory.GetAdapter(uiElement);

            createdAdapters.Add(adapter);
            RegisterSite(siteName, adapter);
        }