-
Notifications
You must be signed in to change notification settings - Fork 0
HowTo: Add icon for custom node
Custom nodes, that are the part of package, support icons.
-
Get ID of custom node. Open node with Notepad. Find its ID. It will something like ID="4cdf5500-fe21-402e-acb7-bb9fc1b5a64b"
-
Open Visual Studio. Create in you solution resx file, named
PackageImages.resx
. -
Add to recently created file your image. Change your image name to .Small.png
-
Change icon persistence to Embedded in .resx
- Open .csproj file. Use Notepad.
- Uncomment BeforeBuild part.
- Write next code:
<Target Name="BeforeBuild">
<GetReferenceAssemblyPaths TargetFrameworkMoniker=".NETFramework, Version=v2.0">
<Output TaskParameter="FullFrameworkReferenceAssemblyPaths" PropertyName="FrameworkAssembliesPath" />
</GetReferenceAssemblyPaths>
<GenerateResource UseSourcePath="true" Sources="$(ProjectDir)PackageImages.resx"
OutputResources="$(ProjectDir)PackageImages.resources"
References="$(FrameworkAssembliesPath)System.Drawing.dll" />
<AL TargetType="library" EmbedResources="$(ProjectDir)PackageImages.resources"
OutputAssembly="$(OutDir)Package.customization.dll" />
</Target>
-
Rebuild your project.
Package.customization.dll
will be in project's output folder. -
Add Package.customization.dll to your package.
You can add default icon, if you want to use 1 icon for all custom nodes. You have to make all steps, described above. But name of your icon should be DefaultCustomNode.Small