public void GenerateTypeFactory(string typeName)
 {
     if (this._objectFactoryGenerator == null)
     {
         this._objectFactoryGenerator = new ObjectFactoryCodeDomTreeGenerator(this.OutputAssemblyName);
     }
     this._objectFactoryGenerator.AddFactoryMethod(typeName);
 }
 public object CreateInstance()
 {
     if (!this._triedToGetInstObj)
     {
         this._instObj           = ObjectFactoryCodeDomTreeGenerator.GetFastObjectCreationDelegate(this.ResultType);
         this._triedToGetInstObj = true;
     }
     if (this._instObj == null)
     {
         return(HttpRuntime.CreatePublicInstance(this.ResultType));
     }
     return(this._instObj());
 }
    /// <devdoc>
    ///     Tell the host about a type that is being generated.  This allows the host
    ///     To generate a fast object factory for it.
    /// </devdoc>
    public void GenerateTypeFactory(string typeName) {

        // Create the object factory generator on demand
        if (_objectFactoryGenerator == null) {
            _objectFactoryGenerator = new ObjectFactoryCodeDomTreeGenerator(OutputAssemblyName);
        }

        // Add a method to fast create this type
        _objectFactoryGenerator.AddFactoryMethod(typeName);
    }
 public void GenerateTypeFactory(string typeName)
 {
     if (this._objectFactoryGenerator == null)
     {
         this._objectFactoryGenerator = new ObjectFactoryCodeDomTreeGenerator(this.OutputAssemblyName);
     }
     this._objectFactoryGenerator.AddFactoryMethod(typeName);
 }