Example #1
0
        public T CreateResource <T>(string name) where T : SCN0EntryNode
        {
            SCN0GroupNode group = GetOrCreateFolder <T>();

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

            T n = Activator.CreateInstance <T>();

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

            return(n);
        }
Example #2
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);
        }