From 071620a496b27e43381518f278b4083117b21e73 Mon Sep 17 00:00:00 2001 From: Thomas Nind Date: Fri, 10 Dec 2021 13:53:53 +0000 Subject: [PATCH] Gave IsProperTransform CatalogueItems a custom icon --- CHANGELOG.md | 2 ++ Rdmp.Core/Icons/CatalogueItemTransform.png | Bin 0 -> 1477 bytes .../IconProvision/CatalogueIcons.Designer.cs | 14 +++++++++++++- .../Icons/IconProvision/CatalogueIcons.resx | 3 +++ .../CatalogueItemStateBasedIconProvider.cs | 5 +++-- 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 Rdmp.Core/Icons/CatalogueItemTransform.png diff --git a/CHANGELOG.md b/CHANGELOG.md index b518b2bf0e..dcc02d43b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Rdmp.Core/Icons/CatalogueItemTransform.png b/Rdmp.Core/Icons/CatalogueItemTransform.png new file mode 100644 index 0000000000000000000000000000000000000000..9b08913e6945a85ec644ce4fecbecab608aecadb GIT binary patch literal 1477 zcmeAS@N?(olHy`uVBq!ia0vp^!XV7S3?yCqj{O5tjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCik{2l#}z?%lih?c2AnUcGwp;>Gjl&!0Yh`sB%zM~@yoc<|u<{rh+C-o10@ z&aGRwo;`cUaAV7j8#lgx|32^Kow?6%&w6@e`lD;pA6}jI@XFNtmnYx7IQ!Ynke+2> zeJetHmk0MO3+`U(*S4^5<>A}6Z_j^qcmB(}bDrOt`S|+O2Uli4y*cyAjTw)xO}cww z!mV>RZ{CcYxF&Mq>WB%e!Y8Z>?OWmBv8ZLwwJG;6&3$ou%DqbuA3hB4Us=B4)XSGI zA3uJ);MKi_ukSB<^B`){n&`=EqbIM6nX+!-oBNC3K3x3n;p^A0C)_^w>({T}zkk1b z_wN1s_dvfMZThqaNcolo`33){B4D_jCD;Hon6tnmvY3H^Zw?4EvQG)V%fP_&JToMs zB*NFnDmgz_FEJ%QDOIl`w*aV`fx*VUq98FjJGDe1DK$Ma&sORE?)^#%nJKnP;ikR@ zz6H*y8JQkcMXAA6ej&+K*~ykEO7?cVTs9R}KofFPOA-|-a&z*EttxDlzy@0Z*&tzk zB?YjOl5ATgN05yQ5xxNm&iO^D3Z{C-y2%EHh6-k8dWI&ZW@d&u3PuKoM*0RoWTtCq zVr6P(Wn``Z1xi5c6clWVQqrt~T->160eQAc86_nJR{Hwo<>h+i#(Mch>H3D2mX;u6 zjEr=FDs+o0^GXscbn}XpA%;MWaY-#sF3Kz@$;{7F02!N@lwVq6s|0j0#4EW4aI^D@ zq2UD#IsJ;n0)0b01AUlbK;wXcVC7ttnpl!w6q28xV+Zl7TV_#ed45rLv4V53nSw@m zW?o8ud9kLAKDu&{&p-fSPO3{{NvfTZfsvuEp`oskafqR*m4TU+u|X7)Zipfj&A$05 znQ4{SG@Dx)SVA=;DS~LW(Fge-DLlYoOG7PM-A_-=OE(X#`CXPZok9BeihaKKEZ= + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap CatalogueItemTransform + { + get + { + object obj = ResourceManager.GetObject("CatalogueItemTransform", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx index 36bb823589..535e8868cd 100644 --- a/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx +++ b/Rdmp.Core/Icons/IconProvision/CatalogueIcons.resx @@ -265,6 +265,9 @@ ..\CatalogueItem.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\CatalogueItemTransform.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\CatalogueItemIssue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/Rdmp.Core/Icons/IconProvision/StateBasedIconProviders/CatalogueItemStateBasedIconProvider.cs b/Rdmp.Core/Icons/IconProvision/StateBasedIconProviders/CatalogueItemStateBasedIconProvider.cs index 4127be6a6b..3cbe16a510 100644 --- a/Rdmp.Core/Icons/IconProvision/StateBasedIconProviders/CatalogueItemStateBasedIconProvider.cs +++ b/Rdmp.Core/Icons/IconProvision/StateBasedIconProviders/CatalogueItemStateBasedIconProvider.cs @@ -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; } @@ -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)