Beispiel #1
0
 private void EndElement(string name)
 {
     //Assembly executingAssembly = Assembly.GetExecutingAssembly();
     //Type type = executingAssembly.GetType("MGFramework." + name, false);
     Type type = Type.GetType("MGFramework." + name, false);
     if (type != _curClass)
     {
         if (CurrentDefinitionObject != null)
         {
             CurrentDefinitionObject.UndefinedElementDidFinish(name);
         }
         return;
     }
     CurrentDefinitionObject.DefinitionObjectDidFinishParsing();
     if (CurrentDefinitionObject.ParentDefinitionObject != null)
     {
         CurrentDefinitionObject.ParentDefinitionObject.ChildDefinitionObjectDidFinishParsing(
             CurrentDefinitionObject);
     }
     CurrentDefinitionObject = CurrentDefinitionObject.ParentDefinitionObject;
     if (CurrentDefinitionObject != null)
     {
         _curClass = CurrentDefinitionObject.GetType();
         _isCurrentElementDefined = true;
         return;
     }
     _curClass = null;
     _isCurrentElementDefined = false;
 }
Beispiel #2
0
 public override void ChildDefinitionObjectDidFinishParsing(DefinitionObject childObject)
 {
     base.ChildDefinitionObjectDidFinishParsing(childObject);
     if (childObject.GetType() == typeof (PartState))
     {
         var item = (PartState) childObject;
         PartStates.Add(item);
     }
 }
Beispiel #3
0
 public virtual DefinitionObject InitWithParentObject(DefinitionObject parentObject)
 {
     ParentDefinitionObject = parentObject;
     return this;
 }
Beispiel #4
0
 public virtual void ChildDefinitionObjectDidInit(DefinitionObject childObject)
 {
 }
Beispiel #5
0
 public virtual void ChildDefinitionObjectDidFinishParsing(DefinitionObject childObject)
 {
 }
Beispiel #6
0
 public virtual void ChildDefinitionObject(DefinitionObject childObject, string str)
 {
 }
Beispiel #7
0
 public DefinitionObject()
 {
     ParentDefinitionObject = null;
 }
Beispiel #8
0
 public DefinitionReader()
 {
     WebConnection = 0;
     CurrentDefinitionObject = null;
     _isCurrentElementDefined = false;
 }
Beispiel #9
0
        private void StartElement(string name)
        {
            //Assembly executingAssembly = Assembly.GetExecutingAssembly();
            //Type type = executingAssembly.GetType("MGFramework." + name, false);
            Type type = Type.GetType("MGFramework." + name, false);

            if (type != null)
            {
                var definitionObject = (DefinitionObject)Activator.CreateInstance(type);
                if (_isCurrentElementDefined)
                {
                    definitionObject.InitWithParentObject(CurrentDefinitionObject);
                }
                definitionObject.DefinitionObjectDidInit();
                if (definitionObject.ParentDefinitionObject != null)
                {
                    definitionObject.ParentDefinitionObject.ChildDefinitionObjectDidInit(definitionObject);
                }
                _curClass = type;
                CurrentDefinitionObject = definitionObject;
                _isCurrentElementDefined = true;
                return;
            }
            _isCurrentElementDefined = false;
            if (CurrentDefinitionObject != null)
            {
                CurrentDefinitionObject.UndefinedElementDidStart(name);
            }
        }