Skip to content

Commit

Permalink
Merge pull request #823 from HicServices/transform-icon
Browse files Browse the repository at this point in the history
Gave IsProperTransform CatalogueItems a custom icon
  • Loading branch information
RoyMudie authored Dec 15, 2021
2 parents 240e909 + 071620a commit 8b6a9cd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added custom icon for [CatalogueItem] that represent transforms on the underlying column (https://github.com/HicServices/RDMP/issues/818)

### Fixed

### Changed
Expand Down
Binary file added Rdmp.Core/Icons/CatalogueItemTransform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion Rdmp.Core/Icons/IconProvision/CatalogueIcons.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@
<data name="CatalogueItem" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\CatalogueItem.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CatalogueItemTransform" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\CatalogueItemTransform.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CatalogueItemIssue" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\CatalogueItemIssue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ namespace Rdmp.Core.Icons.IconProvision.StateBasedIconProviders
public class CatalogueItemStateBasedIconProvider : IObjectStateBasedIconProvider
{
private readonly Bitmap basicImage;
private readonly Bitmap transformImage;
private readonly IconOverlayProvider _overlayProvider;

public CatalogueItemStateBasedIconProvider(IconOverlayProvider overlayProvider)
{
basicImage = CatalogueIcons.CatalogueItem;
transformImage = CatalogueIcons.CatalogueItemTransform;
_overlayProvider = overlayProvider;
}

Expand All @@ -31,9 +33,8 @@ public Bitmap GetImageIfSupportedObject(object o)
if (ci == null)
return null;

Bitmap toReturn = basicImage;

var ei = ci.ExtractionInformation;
Bitmap toReturn = ei?.IsProperTransform() ?? false ? transformImage: basicImage;

//it's extractable
if (ei != null)
Expand Down

0 comments on commit 8b6a9cd

Please sign in to comment.