コード例 #1
0
        public IEnumerable <ISPNode> LoadUnorderedChildren(ISPNode sourceNode)
        {
            var list = new List <ISPNode>();

            if (sourceNode.SPObject == null)
            {
                return(list);
            }

            ISPNode node = null;

            var propertyDescriptors = TypeDescriptor.GetProperties(sourceNode.SPObjectType);

            try
            {
                foreach (PropertyDescriptor descriptor in propertyDescriptors)
                {
                    node = CreateNodeOrDefault(descriptor.PropertyType.FullName);
                    if (node == null)
                    {
                        continue;
                    }

                    node.Initialize(descriptor, sourceNode, null, list.Count);

                    if (node.SPObject == null)
                    {
                        continue;
                    }

                    node.Setup(sourceNode);

                    // Exclude the node if it do not match the correct view
                    if (!RunIncludeRules(node))
                    {
                        continue;
                    }

                    list.Add(node);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " : " + node.GetType().FullName + " : " + ex.StackTrace);
            }
            return(list);
        }
コード例 #2
0
ファイル: SPTreeNode.cs プロジェクト: keutmann/SPM
 public override void Setup()
 {
     Model.Setup(Model.Parent);
 }