コード例 #1
0
        /// <include file='doc\DocumentManager.uex' path='docs/doc[@for="DocumentManager.CreateDesigner2"]/*' />
        /// <devdoc>
        ///     Creates a new instance of a form designer.  This takes a code stream and attempts
        ///     to create a design instance for it.
        /// </devdoc>
        public IDesignerDocument CreateDesigner(DesignerLoader loader, IServiceProvider provider)
        {
            DesignerHost dh = new DesignerHost();

            dh.Init(provider, loader);
            return(dh);
        }
コード例 #2
0
        /// <include file='doc\DocumentManager.uex' path='docs/doc[@for="DocumentManager.CreateDesigner3"]/*' />
        /// <devdoc>
        ///     Creates a new instance of a form designer.  This uses the given component class
        ///     name as the base component for the class.  The designer for the component
        ///     class is responsible for attaching a code stream if it wants to persist
        ///     information.
        /// </devdoc>
        public IDesignerDocument CreateDesigner(string componentClass, IServiceProvider provider)
        {
            DesignerHost            dh = new DesignerHost();
            ComponentDesignerLoader cs = new ComponentDesignerLoader(componentClass);

            dh.Init(provider, cs);
            return(dh);
        }