private void BeforeQueryStatus(object sender, EventArgs e) { var button = (OleMenuCommand)sender; var files = ProjectHelpers.GetSelectedItemPaths(); var isSprite = files.Count() == 1 && Path.GetExtension(files.First()) == Constants.FileExtension; button.Enabled = button.Visible = isSprite; }
private void BeforeQueryStatus(object sender, EventArgs e) { var button = (OleMenuCommand)sender; System.Collections.Generic.IEnumerable <string> files = ProjectHelpers.GetSelectedItemPaths(); bool isSprite = files.Count() == 1 && Path.GetExtension(files.First()).Equals(Constants.FileExtension, StringComparison.OrdinalIgnoreCase); button.Enabled = button.Visible = isSprite; }
private IEnumerable <string> GetFiles() { return(ProjectHelpers.GetSelectedItemPaths().Where(file => Constants.SupporedExtensions.Contains(Path.GetExtension(file)))); }
private async void Execute(object sender, EventArgs e) { var files = ProjectHelpers.GetSelectedItemPaths(); await SpriteService.GenerateSprite(files.First()); }
private async void Execute(object sender, EventArgs e) { System.Collections.Generic.IEnumerable <string> files = ProjectHelpers.GetSelectedItemPaths(); await SpriteService.GenerateSpriteAsync(files.First()); }