Exemple #1
0
 public ElementBase(NavigatorContext context, Content content, string name, ElementBase parent)
 {
     Name    = name;
     Parent  = parent;
     Context = context;
     Content = content;
 }
Exemple #2
0
        public ContentNavigator(Content content, bool withChildren)
        {
            var context = new NavigatorContext();

            context.MainContent  = content;
            context.WithChildren = withChildren;
            _currentElement      = new RootElement(context, content);
        }
Exemple #3
0
        public ItemContainerElement(NavigatorContext context, Content content, string name, ElementBase parent, Field field)
            : base(context, content, name, parent, field)
        {
            var listField = (IXmlChildList)field;

            ChildItemName        = listField.GetXmlChildName();
            ChildValueEnumerator = listField.GetXmlChildValues().GetEnumerator();
            _isEmpty             = !ChildValueEnumerator.MoveNext();
        }
Exemple #4
0
        public FieldsElement(NavigatorContext context, Content content, ElementBase parent)
            : base(context, content, "Fields", parent)
        {
            //var enumerator = content.Fields.Values.GetEnumerator();
            var enumerator = content.Fields.Values.AsEnumerable <Field>().GetEnumerator();

            FieldEnumerator = new FieldEnumerator(enumerator);
            _isEmpty        = !FieldEnumerator.MoveNext();
        }
Exemple #5
0
 protected FieldElement(NavigatorContext context, Content content, string name, ElementBase parent, Field field)
     : base(context, content, name, parent)
 {
     this.Field          = field;
     _attributeContainer = field as IXmlAttributeOwner;
     _isListField        = field.Name[0] == '#';
     if (_isListField)
     {
         base.RemoveHashSignFromName();
     }
 }
Exemple #6
0
 internal static FieldElement Create(NavigatorContext context, Content content, ElementBase parent, Field field)
 {
     if (field is IXmlChildList)
     {
         return(new ItemContainerElement(context, content, field.Name, parent, field));
     }
     if (field is IRawXmlContainer)
     {
         return(new XmlFieldElement(context, content, field.Name, parent, field));
     }
     return(new SimpleFieldElement(context, content, field.Name, parent, field));
 }
Exemple #7
0
 public XmlFieldElement(NavigatorContext context, Content content, string name, ElementBase parent, Field field) : base(context, content, name, parent, field)
 {
 }
Exemple #8
0
 public XmlNodeWrapper(NavigatorContext context, Content content, string name, ElementBase parent, XmlNode wrappedNode)
     : base(context, content, name, parent)
 {
     _wrappedNode = wrappedNode;
 }
Exemple #9
0
 internal static XmlNodeWrapper Create(NavigatorContext context, Content content, string name, ElementBase parent, XmlNode wrappedNode)
 {
     return(new XmlNodeWrapper(context, content, name, parent, wrappedNode));
 }
Exemple #10
0
 private ActionElement(NavigatorContext context, Content content, string name, ElementBase parent, ActionBase action)
     : base(context, content, name, parent)
 {
     _action = action;
 }
Exemple #11
0
 internal static ActionElement Create(NavigatorContext context, Content content, ElementBase parent, ActionBase action)
 {
     return(new ActionElement(context, content, action.Name, parent, action));
 }
Exemple #12
0
 public ChildItemElement(NavigatorContext context, Content content, ElementBase parent, string name, string value)
     : base(context, content, name, parent)
 {
     _value = value;
 }
Exemple #13
0
 public ActionsElement(NavigatorContext context, Content content, ElementBase parent)
     : base(context, content, "Actions", parent)
 {
     ActionEnumerator = ActionFramework.GetActionsForContentNavigator(content).GetEnumerator();
     _isEmpty         = !ActionEnumerator.MoveNext();
 }
Exemple #14
0
 public ChildrenElement(NavigatorContext context, Content content, ElementBase parent) : base(context, content, "Children", parent)
 {
 }
Exemple #15
0
 public RootElement(NavigatorContext context, Content content) : base(context, content, "#document", null)
 {
     context.SetRoot(this);
 }
Exemple #16
0
 public ContentElement(NavigatorContext context, Content content, ElementBase parent, bool isChildContent, int contentIndex)
     : base(context, content, "Content", parent)
 {
     IsChildContent = isChildContent;
     ContentIndex   = contentIndex;
 }
Exemple #17
0
 public TextElement(NavigatorContext context, Content content, ElementBase parent, string textValue)
     : base(context, content, "#text", parent)
 {
     _textValue = textValue;
 }
Exemple #18
0
 public ContentHeadElement(NavigatorContext context, Content content, string name, ElementBase parent) : base(context, content, name, parent)
 {
 }