Exemplo n.º 1
0
        public static XmlValueDto FromValue(IValue value)
        {
            var xvd = new XmlValueDto
            {
                Name = value.Name, 
                Metadata = ((Value)value).Metadata.Raw, 
                Content = value.ContentString
            };

            // very cheap attempt to perform link rewriting
            var vi = (Value)value;
            vi.RawSetMetadata(xvd.Metadata);
            vi.SetContent(xvd.Content.AsLazyStream());

            return xvd;
        }
Exemplo n.º 2
0
        public static XmlValueDto FromValue(IValue value)
        {
            var xvd = new XmlValueDto
            {
                Name     = value.Name,
                Metadata = ((Value)value).Metadata.Raw,
                Content  = value.ContentString
            };

            // very cheap attempt to perform link rewriting
            var vi = (Value)value;

            vi.RawSetMetadata(xvd.Metadata);
            vi.SetContent(xvd.Content.AsLazyStream());

            return(xvd);
        }
Exemplo n.º 3
0
 public static XmlBranchDto FromBranch(IBranch branch)
 {
     return(new XmlBranchDto
     {
         Name = branch.Name,
         Metadata = ((Branch)branch).Metadata.Raw,
         Values = ((Branch)branch).GetValues(ValueKind.RegularAndInternal).Select(v => XmlValueDto.FromValue(v)).ToArray(),
         Branches = branch.GetBranches().Select(b => XmlBranchDto.FromBranch(b)).ToArray(),
     });
 }