Beispiel #1
0
        public SCN0GroupNode GetFolder(SCN0GroupNode.GroupType type)
        {
            Populate(0);

            int typeID = (int)type;

            if (typeID < 0 || typeID >= 5)
            {
                return(null);
            }

            return(_groups[typeID]);
        }
Beispiel #2
0
        public SCN0GroupNode GetOrCreateFolder(SCN0GroupNode.GroupType type)
        {
            int typeID = (int)type;

            if (typeID < 0 || typeID >= 5)
            {
                return(null);
            }

            if (_groups[typeID] == null)
            {
                AddChild(_groups[typeID] = new SCN0GroupNode(type));
            }

            return(_groups[typeID]);
        }
Beispiel #3
0
        public SCN0EntryNode CreateResource(SCN0GroupNode.GroupType type, string name)
        {
            SCN0GroupNode group = GetOrCreateFolder(type);

            if (group == null)
            {
                return(null);
            }

            Type          t = SCN0GroupNode._types[(int)type];
            SCN0EntryNode n = Activator.CreateInstance(t) as SCN0EntryNode;

            n.Name = group.FindName(name);
            group.AddChild(n);

            return(n);
        }