public SkinControl(SkinControl source) : base(source) { this.Inherits = source.Inherits; this.DefaultSize = source.DefaultSize; this.MinimumSize = source.MinimumSize; this.OriginMargins = source.OriginMargins; this.ClientMargins = source.ClientMargins; this.ResizerSize = source.ResizerSize; this.Layers = new SkinList <SkinLayer>(source.Layers); this.Attributes = new SkinList <SkinAttribute>(source.Attributes); }
public SkinList(SkinList <T> source) : base() { for (int i = 0; i < source.Count; i++) { Type[] t = new Type[1]; t[0] = typeof(T); object[] p = new object[1]; p[0] = source[i]; this.Add((T)t[0].GetConstructor(t).Invoke(p)); } }
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); string folder = GetAddonsFolder(); if (folder == "") { content.UseArchive = true; folder = "Addons\\"; } else { content.UseArchive = false; } string[] addons = content.GetDirectories(folder); if (addons != null && addons.Length > 0) { for (int i = 0; i < addons.Length; i++) { DirectoryInfo d = new DirectoryInfo(GetAddonsFolder() + addons[i]); if (!((d.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden) || content.UseArchive) { LoadSkin(addons[i].Replace("\\", ""), content.UseArchive); } } } }
public SkinLayer(SkinLayer source) : base(source) { if (source != null) { this.Image = new SkinImage(source.Image); this.Width = source.Width; this.Height = source.Height; this.OffsetX = source.OffsetX; this.OffsetY = source.OffsetY; this.Alignment = source.Alignment; this.SizingMargins = source.SizingMargins; this.ContentMargins = source.ContentMargins; this.States = source.States; this.Overlays = source.Overlays; this.Text = new SkinText(source.Text); this.Attributes = new SkinList <SkinAttribute>(source.Attributes); } else { throw new Exception("Parameter for SkinLayer copy constructor cannot be null."); } }