public void OnRequestBitmapSource(IconRequestEventArgs e) { if (RequestBitmapSource != null) { RequestBitmapSource(e); } }
protected override ImageSource GetIcon(string fullNameOfIcon) { IconRequestEventArgs iconRequest; // If there is no path, that means it's just created node. // Use DefaultAssembly to load icon. if (String.IsNullOrEmpty(Path)) { iconRequest = new IconRequestEventArgs(Configurations.DefaultAssembly, fullNameOfIcon); OnRequestBitmapSource(iconRequest); return(iconRequest.Icon); } string customizationPath = System.IO.Path.GetDirectoryName(Path); customizationPath = System.IO.Directory.GetParent(customizationPath).FullName; customizationPath = System.IO.Path.Combine(customizationPath, "bin", "Package.dll"); iconRequest = new IconRequestEventArgs(customizationPath, fullNameOfIcon, false); OnRequestBitmapSource(iconRequest); if (iconRequest.Icon != null) { return(iconRequest.Icon); } // If there is no icon inside of customization assembly, // try to find it in dynamo assembly. iconRequest = new IconRequestEventArgs(Configurations.DefaultAssembly, fullNameOfIcon); OnRequestBitmapSource(iconRequest); return(iconRequest.Icon); }
private ImageSource GetIcon(string fullNameOfIcon) { var iconRequest = new IconRequestEventArgs(Assembly, fullNameOfIcon); OnRequestBitmapSource(iconRequest); return(iconRequest.Icon); }
private ImageSource LoadDefaultIcon() { var iconRequest = new IconRequestEventArgs(Configurations.DefaultAssembly, Configurations.DefaultIcon); OnRequestBitmapSource(iconRequest); return(iconRequest.Icon); }
protected ImageSource GetIcon(string fullNameOfIcon) { if (string.IsNullOrEmpty(Model.Assembly)) { return(null); } var iconRequest = new IconRequestEventArgs(Model.Assembly, fullNameOfIcon); OnRequestBitmapSource(iconRequest); return(iconRequest.Icon); }
protected virtual ImageSource LoadDefaultIcon(ResourceType resourceType) { if (resourceType == ResourceType.LargeIcon) { return(null); } var iconRequest = new IconRequestEventArgs(Configurations.DefaultAssembly, Configurations.DefaultIcon); OnRequestBitmapSource(iconRequest); return(iconRequest.Icon); }
protected override ImageSource GetIcon(string fullNameOfIcon) { string customizationPath = System.IO.Path.GetDirectoryName(Path); customizationPath = System.IO.Directory.GetParent(customizationPath).FullName; customizationPath = System.IO.Path.Combine(customizationPath, "bin", "Package.dll"); var iconRequest = new IconRequestEventArgs(customizationPath, fullNameOfIcon, false); OnRequestBitmapSource(iconRequest); if (iconRequest.Icon != null) { return(iconRequest.Icon); } // If there is no icon inside of customization assembly, // try to find it in dynamo assembly. iconRequest = new IconRequestEventArgs(Configurations.DefaultAssembly, fullNameOfIcon); OnRequestBitmapSource(iconRequest); return(iconRequest.Icon); }