Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gave IsProperTransform CatalogueItems a custom icon #823

Merged
merged 1 commit into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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