Пример #1
0
        public static Skin Load(IGraphicsObjectFactory objectFactory, string fileName)
        {
            var document = Parser.Load(fileName);

            var skinMapper = new SkinMapper(objectFactory);

            return(skinMapper.Instantiate(document));
        }
Пример #2
0
        public static Skin Load(IGraphicsObjectFactory objectFactory, Stream stream, Encoding encoding)
        {
            var document = Parser.Parse(stream, encoding);

            var skinMapper = new SkinMapper(objectFactory);

            return(skinMapper.Instantiate(document));
        }
Пример #3
0
        public UIMapper(IGraphicsObjectFactory factory)
        {
            this.factory = factory;

            RegisterConverters(this);

            this.RegisterConverter <IPicture>(new PictureConverter(factory));

            this.RegisterType <Button>();
            this.RegisterType <Label>();
            this.RegisterType <Image>();
        }
Пример #4
0
        private static Form Create(MarkupDocument document, IGraphicsObjectFactory factory)
        {
            var mapper = new UIMapper(factory);

            lock (customTypes)
            {
                foreach (var ctype in customTypes)
                {
                    mapper.RegisterType(ctype.Value, ctype.Key);
                }
            }
            return(mapper.Instantiate(document));
        }
Пример #5
0
        public SkinMapper(IGraphicsObjectFactory objectFactory)
        {
            this.RegisterType <Skin>();
            this.RegisterType <Style>();
            this.RegisterType <State>();

            this.RegisterConverter <IFont>(new FontConverter(objectFactory));
            this.RegisterConverter <IBrush>(new BrushConverter(objectFactory));
            this.RegisterConverter <IPicture>(new PictureConverter(objectFactory));

            // this.RegisterType<TextureBrushDescriptor>("Texture");
            // this.RegisterType<SolidBrushDescriptor>("Color");
            // this.RegisterType<TextureBoxBrushDescriptor>("TextureBox");

            this.RegisterConverter <Thickness, ThicknessConverter>();
            UIMapper.RegisterConverters(this);
        }
Пример #6
0
 public FontConverter(IGraphicsObjectFactory objectFactory)
 {
     this.objectFactory = objectFactory;
 }
Пример #7
0
 public PictureConverter(IGraphicsObjectFactory objectFactory)
 {
     this.objectFactory = objectFactory;
 }
Пример #8
0
        public static Form Load(Stream stream, System.Text.Encoding encoding, IGraphicsObjectFactory factory)
        {
            var document = Parser.Parse(stream, encoding);

            return(Create(document, factory));
        }
Пример #9
0
        public static Form Load(string fileName, IGraphicsObjectFactory factory)
        {
            var document = Parser.Load(fileName);

            return(Create(document, factory));
        }
Пример #10
0
 public Form(IGraphicsObjectFactory factory) :
     base(new UIMapper(factory))
 {
 }
Пример #11
0
 public BrushConverter(IGraphicsObjectFactory objectFactory)
 {
     this.objectFactory = objectFactory;
 }