Beispiel #1
0
        public object BuildItem(object caller, Codon codon, ArrayList subItems)
        {
            string     id       = codon.Id;
            string     resource = codon.Properties["resource"];
            ImageProxy proxy    = ResourceImageProxy.FromResource(id, resource);

            TextureManager.BuiltinTextures.Add(proxy);
            return(proxy);
        }
Beispiel #2
0
        public object BuildItem(BuildItemArgs args)
        {
            string id       = args.Codon.Id;
            string resource = args.Codon.Properties["resource"];

            if (!string.IsNullOrEmpty(resource))
            {
                ImageProxy proxy = ResourceImageProxy.FromResource(id, resource);
                TextureManager.BuiltinTextures.Add(proxy);
                return(proxy);
            }
            string classname = args.Codon.Properties["class"];

            if (!string.IsNullOrEmpty(classname))
            {
                var proxy = (ImageProxy)System.Activator.CreateInstance("AltaxoBase", classname).Unwrap();
                TextureManager.BuiltinTextures.Add(proxy);
                return(proxy);
            }
            return(null);
        }