LoadInitializer() public static method

public static LoadInitializer ( Type type, XmlElement initializerElement ) : object
type System.Type
initializerElement System.Xml.XmlElement
return object
Exemplo n.º 1
0
        void LoadInitializer(XmlElement element)
        {
            XmlElement initializerElement = element.SelectSingleNode("initializer") as XmlElement;

            if (null != initializerElement)
            {
                _initializer = (IObjectInitializer)InitializerHelper.LoadInitializer(initializerElement);
            }
        }
        public static object LoadInitializer(XmlElement element)
        {
            string typeName = element.GetAttribute("type");

            if (null == typeName || 0 == typeName.Length)
            {
                throw new ApplicationException(string.Format("Expected type attribute for element {0}!", element.LocalName));
            }

            Type type = Type.GetType(typeName);

            if (null == type)
            {
                throw new ApplicationException(string.Format("Type \"{0}\" not found!", typeName));
            }
            return(InitializerHelper.LoadInitializer(type, element));
        }
Exemplo n.º 3
0
 public static IFieldInitializer LoadInitializer(Type type, XmlElement initializerElement)
 {
     return((IFieldInitializer)InitializerHelper.LoadInitializer(type, initializerElement));
 }