Ejemplo n.º 1
0
 public void AddWorkspace(RepositoryWorkspace ws)
 {
     if (ws != null)
     {
         workspaces.Add(ws);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Parses a workspace element in a service document.
        /// </summary>
        private static RepositoryWorkspace ParseWorkspace(XmlReader parser)
        {
            RepositoryWorkspace workspace = new RepositoryWorkspace();

            XmlUtils.Next(parser);

            while (true)
            {
                XmlNodeType nodeType = parser.NodeType;
                if (nodeType == XmlNodeType.Element)
                {
                    AtomElement element = ParseWorkspaceElement(parser);

                    // check if we can extract the workspace id
                    if (element != null && (element.Object is IRepositoryInfo))
                    {
                        workspace.Id = ((IRepositoryInfo)element.Object).Id;
                    }

                    // add to workspace
                    workspace.AddElement(element);
                }
                else if (nodeType == XmlNodeType.EndElement)
                {
                    break;
                }
                else
                {
                    if (!XmlUtils.Next(parser))
                    {
                        break;
                    }
                }
            }

            XmlUtils.Next(parser);

            return(workspace);
        }