private void DeleteTexture(DynamicInputTexture texture)
 {
     if (texture == EditingTexture)
     {
         EditingTexture = null;
     }
     Textures.Remove(texture);
 }
        /// <summary>
        /// Given a texture will return a mapping between each emulated device name and map of key name to list of regions
        /// </summary>
        /// <param name="texture"></param>
        /// <returns></returns>
        private Dictionary <string, Dictionary <string, List <RectRegion> > > CollectRegionsForDevices(DynamicInputTexture texture)
        {
            Dictionary <string, Dictionary <string, List <RectRegion> > > result = new Dictionary <string, Dictionary <string, List <RectRegion> > >();

            foreach (var region in texture.Regions)
            {
                if (result.ContainsKey(region.Device.Name))
                {
                    var key_to_regions = result[region.Device.Name];
                    if (key_to_regions.ContainsKey(region.Key.Name))
                    {
                        key_to_regions[region.Key.Name].Add(region);
                    }
                    else
                    {
                        key_to_regions.Add(region.Key.Name, new List <RectRegion> {
                            region
                        });
                    }
                }
                else
                {
                    var key_to_regions = new Dictionary <string, List <RectRegion> >();
                    key_to_regions.Add(region.Key.Name, new List <RectRegion> {
                        region
                    });
                    result.Add(region.Device.Name, key_to_regions);
                }
            }

            return(result);
        }
 private void EditTexture(DynamicInputTexture texture)
 {
     EditingTexture = texture;
 }