Exemplo n.º 1
0
        private WebModelNode GetWebContainersModel(WebModelNode model, Collection <ModelNode> childModels)
        {
            foreach (ModelNode modelNode in childModels)
            {
                if (modelNode.Value.GetType() == typeof(WebDefinition))
                {
                    model.AddWeb((WebDefinition)modelNode.Value, currentWeb => {
                        GetWebContainersModel(currentWeb, modelNode.ChildModels);
                    });
                }

                if (modelNode.Value.GetType() == typeof(ListDefinition))
                {
                    model.AddList((ListDefinition)modelNode.Value);
                }
            }
            return(model);
        }
Exemplo n.º 2
0
        private WebModelNode GetContainersModel(WebModelNode model)
        {
            WebModelNode containersModel = SPMeta2Model.NewWebModel();

            foreach (ModelNode modelNode in model.ChildModels)
            {
                if (modelNode.Value.GetType() == typeof(WebDefinition))
                {
                    containersModel.AddWeb((WebDefinition)modelNode.Value, currentWeb => {
                        GetWebContainersModel(currentWeb, modelNode.ChildModels);
                    });
                }

                if (modelNode.Value.GetType() == typeof(ListDefinition))
                {
                    containersModel.AddList((ListDefinition)modelNode.Value);
                }
            }

            return(containersModel);
        }