Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 3
0
 private IEnumerable <string> GetFiles()
 {
     return(ProjectHelpers.GetSelectedItemPaths().Where(file => Constants.SupporedExtensions.Contains(Path.GetExtension(file))));
 }
Ejemplo n.º 4
0
 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());
 }