예제 #1
0
 public SkinControl(SkinControl source) : base(source)
 {
     Inherits      = source.Inherits;
     DefaultSize   = source.DefaultSize;
     MinimumSize   = source.MinimumSize;
     OriginMargins = source.OriginMargins;
     ClientMargins = source.ClientMargins;
     ResizerSize   = source.ResizerSize;
     Layers        = new SkinList <SkinLayer>(source.Layers);
     Attributes    = new SkinList <SkinAttribute>(source.Attributes);
 }
예제 #2
0
        public SkinList(SkinList <T> source)
        {
            for (var i = 0; i < source.Count; i++)
            {
                var t = new Type[1];
                t[0] = typeof(T);

                var p = new object[1];
                p[0] = source[i];

                Add((T)t[0].GetConstructor(t).Invoke(p));
            }
        }
예제 #3
0
        public Skin(Manager manager, string name) : base(manager)
        {
            this.name             = name;
            content               = new ArchiveManager(Manager.Game.Services, GetArchiveLocation(name + Manager.SkinExtension));
            content.RootDirectory = GetFolder();
            doc        = new SkinXmlDocument();
            controls   = new SkinList <SkinControl>();
            fonts      = new SkinList <SkinFont>();
            images     = new SkinList <SkinImage>();
            cursors    = new SkinList <SkinCursor>();
            attributes = new SkinList <SkinAttribute>();

            LoadSkin(null, content.UseArchive);

            var folder = GetAddonsFolder();

            if (folder == "")
            {
                content.UseArchive = true;
                folder             = "Addons\\";
            }
            else
            {
                content.UseArchive = false;
            }

            var addons = content.GetDirectories(folder);

            if (addons != null && addons.Length > 0)
            {
                for (var i = 0; i < addons.Length; i++)
                {
                    var d = new DirectoryInfo(GetAddonsFolder() + addons[i]);
                    if (!((d.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden) || content.UseArchive)
                    {
                        LoadSkin(addons[i].Replace("\\", ""), content.UseArchive);
                    }
                }
            }
        }
예제 #4
0
 public SkinLayer(SkinLayer source) : base(source)
 {
     if (source != null)
     {
         Image          = new SkinImage(source.Image);
         Width          = source.Width;
         Height         = source.Height;
         OffsetX        = source.OffsetX;
         OffsetY        = source.OffsetY;
         Alignment      = source.Alignment;
         SizingMargins  = source.SizingMargins;
         ContentMargins = source.ContentMargins;
         States         = source.States;
         Overlays       = source.Overlays;
         Text           = new SkinText(source.Text);
         Attributes     = new SkinList <SkinAttribute>(source.Attributes);
     }
     else
     {
         throw new Exception("Parameter for SkinLayer copy constructor cannot be null.");
     }
 }