Ejemplo n.º 1
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        public string SuggestClassName(ObjectFactoryBase factory)
        {
            var suggestedName = new StringBuilder();

            if (factory != null)
            {
                suggestedName.Append(factory.Module.SimpleName + ".");
                suggestedName.Append(factory.GetType().Name.TrimSuffix("Factory") + "_");
            }
            else
            {
                suggestedName.Append("ObjectFactory");
            }

            if (m_PrimaryInterface != null)
            {
                suggestedName.Append(m_PrimaryInterface.Name.TrimPrefix("I"));
            }
            else if (m_BaseType != null && m_BaseType != typeof(object))
            {
                suggestedName.Append(m_BaseType.Name);
            }
            else
            {
                suggestedName.Append("EmittedClass");
            }

            return(suggestedName.ToString());
        }
Ejemplo n.º 2
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        public ObjectFactoryContext(ObjectFactoryBase factory, TypeKey typeKey)
        {
            m_Factory       = factory;
            m_TypeKey       = typeKey;
            m_ClassType     = null;
            m_ClassFullName = typeKey.SuggestClassName(factory);
        }