Пример #1
0
 public TextureItem GetFirstSelectedTexture()
 {
     return(RecentTexturesList
            .GetSelectedTextures()
            .Union(SelectedTexturesList.GetSelectedTextures())
            .FirstOrDefault());
 }
Пример #2
0
        private void TextureSelectionChanged(object sender, IEnumerable <TextureItem> selection)
        {
            if (_freeze)
            {
                return;
            }

            _freeze = true;
            var item = selection.FirstOrDefault();

            if (selection.Any())
            {
                if (sender == SelectedTexturesList)
                {
                    RecentTexturesList.SetSelectedTextures(new TextureItem[0]);
                }
                if (sender == RecentTexturesList)
                {
                    SelectedTexturesList.SetSelectedTextures(new TextureItem[0]);
                }
            }
            else
            {
                item = RecentTexturesList
                       .GetSelectedTextures()
                       .Union(SelectedTexturesList.GetSelectedTextures())
                       .FirstOrDefault();
            }
            TextureDetailsLabel.Text = "";
            if (item != null)
            {
                TextureDetailsLabel.Text = string.Format("{0} ({1} x {2})", item.Name, item.Width, item.Height);
            }
            _freeze = false;
        }
Пример #3
0
 public IEnumerable <TextureItem> GetSelectedTextures()
 {
     return(RecentTexturesList
            .GetSelectedTextures()
            .Union(SelectedTexturesList.GetSelectedTextures()));
 }