public static Create ( string name = "Layer", |
||
name | string | The layer name. |
owner | The layer owner. | |
isVisible | bool | The flag indicating whether layer is visible. |
Résultat |
/// <summary> /// Creates a new <see cref="XContainer"/> page instance. /// </summary> /// <param name="name">The page name.</param> /// <returns>The new instance of the <see cref="XContainer"/>.</returns> public static XContainer CreatePage(string name = "Page") { var page = new XContainer() { Name = name }; var builder = page.Layers.ToBuilder(); builder.Add(XLayer.Create("Layer1", page)); builder.Add(XLayer.Create("Layer2", page)); builder.Add(XLayer.Create("Layer3", page)); page.Layers = builder.ToImmutable(); page.CurrentLayer = page.Layers.FirstOrDefault(); page.WorkingLayer = XLayer.Create("Working", page); page.HelperLayer = XLayer.Create("Helper", page); return(page); }
/// <summary> /// Creates a new <see cref="XContainer"/> template instance. /// </summary> /// <param name="name">The template name.</param> /// <param name="width">The template width.</param> /// <param name="height">The template height.</param> /// <returns>The new instance of the <see cref="XContainer"/>.</returns> public static XContainer CreateTemplate(string name = "Template", double width = 840, double height = 600) { var template = new XContainer() { Name = name }; template.Background = ArgbColor.Create(0x00, 0xFF, 0xFF, 0xFF); template.Width = width; template.Height = height; var builder = template.Layers.ToBuilder(); builder.Add(XLayer.Create("TemplateLayer1", template)); builder.Add(XLayer.Create("TemplateLayer2", template)); builder.Add(XLayer.Create("TemplateLayer3", template)); template.Layers = builder.ToImmutable(); template.CurrentLayer = template.Layers.FirstOrDefault(); template.WorkingLayer = XLayer.Create("TemplateWorking", template); template.HelperLayer = XLayer.Create("TemplateHelper", template); return(template); }