/// <summary> /// Copy layerages ( form Layerbase to Clipboard). /// </summary> /// <param name="customDevice"> The custom-device. </param> /// <param name="layerages"> The layerages. </param> public static void CopyLayerages(CanvasDevice customDevice, IEnumerable <Layerage> layerages) { foreach (Layerage layerage in layerages) { LayerageCollection.CopyLayerage(customDevice, layerage); } }
/// <summary> /// Sets the mode and notify all properties. /// and copy all selected layerage. /// </summary> /// <param name="customDevice"> The custom-device. </param> /// <param name="layerageCollection"> The layerage-collection. </param> public void SetMode(CanvasDevice customDevice, LayerageCollection layerageCollection) { //Layerages IEnumerable <Layerage> selectedLayerages = LayerageCollection.GetAllSelected(layerageCollection); int count = selectedLayerages.Count(); if (count == 0) { this.SelectionMode = ListViewSelectionMode.None;//None this.Layerage = null; this.Layerages = null; Clipboard.Instances.Clear(); } else if (count == 1) { this.SelectionMode = ListViewSelectionMode.Single;//None Layerage layerage = selectedLayerages.Single(); this.Layerage = layerage.Clone(); this.Layerages = null; Clipboard.Instances.Clear(); LayerageCollection.CopyLayerage(customDevice, this.Layerage); } else if (count >= 2) { this.SelectionMode = ListViewSelectionMode.Multiple;//None this.Layerage = null; this.Layerages = from layerage in selectedLayerages select layerage.Clone(); Clipboard.Instances.Clear(); LayerageCollection.CopyLayerages(customDevice, this.Layerages); } }