diff --git a/CHANGELOG.md b/CHANGELOG.md index 3df7502..6a3dd55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [0.0.6] / 2022-02-02 +- Special Icons8 class - Update Example Version - Add Icon / InstallationFiles - Add More Icons diff --git a/ricaun.Revit.UI.Example/Proprieties/Icons8.cs b/ricaun.Revit.UI.Example/Proprieties/Icons8.cs new file mode 100644 index 0000000..18c91d0 --- /dev/null +++ b/ricaun.Revit.UI.Example/Proprieties/Icons8.cs @@ -0,0 +1,42 @@ +using System; +using System.Runtime.CompilerServices; +using System.Windows.Media.Imaging; +using ricaun.Revit.UI; + +namespace ricaun.Revit.UI.Example.Proprieties +{ + /// <summary> + /// https://icons8.com/ + /// https://img.icons8.com/small/32/000000/circled.png + /// https://img.icons8.com/{0}/{1}/{2}/{3}.png + /// </summary> + public class Icons8 + { + #region Private + private static string Color => "000000"; + private static string Type => "color"; + private static string Size => "32"; + private static string BaseUri => @"https://img.icons8.com/{0}/{1}/{2}/{3}.png"; + #endregion + + #region Icons + public static BitmapSource Icon([CallerMemberName] string name = null) => string.Format(BaseUri, Type, Size, Color, name.ToLower()).GetBitmapSource(); + public static BitmapSource Ok => Icon(); + public static BitmapSource Document => Icon(); + public static BitmapSource File => Icon(); + public static BitmapSource Support => Icon(); + public static BitmapSource Settings => Icon(); + public static BitmapSource About => Icon(); + public static BitmapSource Restart => Icon(); + public static BitmapSource Filter => Icon(); + public static BitmapSource Search => Icon(); + public static BitmapSource Trash => Icon(); + public static BitmapSource Home => Icon(); + public static BitmapSource Menu => Icon(); + public static BitmapSource Info => Icon(); + public static BitmapSource Circled => Icon(); + public static BitmapSource Checked => Icon(); + public static BitmapSource Cancel => Icon(); + #endregion + } +} diff --git a/ricaun.Revit.UI.Example/Revit/App.cs b/ricaun.Revit.UI.Example/Revit/App.cs index a85bc6e..1722675 100644 --- a/ricaun.Revit.UI.Example/Revit/App.cs +++ b/ricaun.Revit.UI.Example/Revit/App.cs @@ -3,6 +3,7 @@ using Autodesk.Revit.ApplicationServices; using System; using System.Linq; +using ricaun.Revit.UI.Example.Proprieties; namespace ricaun.Revit.UI.Example.Revit { @@ -80,7 +81,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) setting.Add<Commands.Command>( new RibbonDescription() { - LargeImage = Proprieties.Resource.LargeImage.GetBitmapSource(), + LargeImage = Resource.LargeImage.GetBitmapSource(), Text = "Hello", ToolTip = "This is a Tool Tip", LongDescription = "This is a Long Description", @@ -97,7 +98,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) new RibbonDescription() { Text = "Ok", - LargeImage = @"https://img.icons8.com/small/32/000000/ok.png".GetBitmapSource() + LargeImage = Icons8.Ok } ); @@ -105,7 +106,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) new RibbonDescription() { Text = "int", - LargeImage = @"https://img.icons8.com/small/32/000000/document.png".GetBitmapSource() + LargeImage = Icons8.Document } ); @@ -113,7 +114,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) new RibbonDescription() { Text = "double", - LargeImage = @"https://img.icons8.com/small/32/000000/file.png".GetBitmapSource() + LargeImage = Icons8.File } ); @@ -121,7 +122,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) new RibbonDescription() { Text = "bool", - LargeImage = @"https://img.icons8.com/small/32/000000/support.png".GetBitmapSource() + LargeImage = Icons8.Support } ); @@ -129,21 +130,21 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) new RibbonDescription() { Text = "text", - LargeImage = @"https://img.icons8.com/small/32/000000/settings.png".GetBitmapSource() + LargeImage = Icons8.Settings } ); setting.Add("PulldownButton", new RibbonDescription() { Text = "Menu", - LargeImage = @"https://img.icons8.com/small/32/000000/about.png".GetBitmapSource() + LargeImage = Icons8.About }); setting.Add<Commands.Command<UIApplication>>(new RibbonDescription() { Text = "UIApplication", - LargeImage = @"https://img.icons8.com/small/32/000000/restart.png".GetBitmapSource(), + LargeImage = Icons8.Restart, Action = (ribbonItem) => { ribbonItem.SetItemSize(); @@ -154,7 +155,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) setting.Add<Commands.Command<UIDocument>>(new RibbonDescription() { Text = "UIDocument", - LargeImage = @"https://img.icons8.com/small/32/000000/filter.png".GetBitmapSource(), + LargeImage = Icons8.Filter, Action = (ribbonItem) => { ribbonItem.SetItemSize(); @@ -165,7 +166,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) setting.Add<Commands.Command<Application>>(new RibbonDescription() { Text = "Application", - LargeImage = @"https://img.icons8.com/small/32/000000/search.png".GetBitmapSource(), + LargeImage = Icons8.Search, Action = (ribbonItem) => { ribbonItem.SetItemSize(); @@ -176,7 +177,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) setting.Add<Commands.Command<Document>>(new RibbonDescription() { Text = "Document", - LargeImage = @"https://img.icons8.com/small/32/000000/trash.png".GetBitmapSource(), + LargeImage = Icons8.Trash, Action = (ribbonItem) => { ribbonItem.SetItemSize(); @@ -187,7 +188,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) setting.Add<Commands.Command<RibbonItem>>(new RibbonDescription() { Text = "RibbonItem", - LargeImage = @"https://img.icons8.com/small/32/000000/home.png".GetBitmapSource(), + LargeImage = Icons8.Home, Action = (ribbonItem) => { ribbonItem.GetRibbonItem().AddQuickAccessToolBar(); @@ -198,7 +199,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) setting.Add<Commands.Command<RibbonButton>>(new RibbonDescription() { Text = "RibbonButton", - LargeImage = @"https://img.icons8.com/small/32/000000/menu.png".GetBitmapSource(), + LargeImage = Icons8.Menu, Action = (ribbonItem) => { ribbonItem.GetRibbonItem().AddQuickAccessToolBar(); @@ -209,7 +210,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) setting.Add<Commands.Command<RibbonPanel>>(new RibbonDescription() { Text = "RibbonPanel", - LargeImage = @"https://img.icons8.com/small/32/000000/info.png".GetBitmapSource(), + LargeImage = Icons8.Info, Action = (ribbonItem) => { ribbonItem.GetRibbonItem().AddQuickAccessToolBar(); @@ -220,7 +221,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) setting.Add<Commands.Command<Element>>(new RibbonDescription() { Text = "Element", - LargeImage = @"https://img.icons8.com/small/32/000000/unchecked-circle.png".GetBitmapSource(), + LargeImage = Icons8.Circled, Action = (ribbonItem) => { ribbonItem.SetShowText(); @@ -230,7 +231,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) setting.Add<Commands.Command<ElementType>>(new RibbonDescription() { Text = "ElementType", - LargeImage = @"https://img.icons8.com/small/32/000000/checked.png".GetBitmapSource(), + LargeImage = Icons8.Checked, Action = (ribbonItem) => { ribbonItem.SetShowText(); @@ -240,7 +241,7 @@ private void UpdateRibbonDescription(RibbonPanel ribbonPanel) setting.Add<Commands.Command<ElementArray>>(new RibbonDescription() { Text = "ElementArray", - LargeImage = @"https://img.icons8.com/small/32/000000/cancel.png".GetBitmapSource(), + LargeImage = Icons8.Cancel, Action = (ribbonItem) => { ribbonItem.SetShowText(); diff --git a/ricaun.Revit.UI.Example/Revit/Commands/Command.cs b/ricaun.Revit.UI.Example/Revit/Commands/Command.cs index 135bcb3..d513085 100644 --- a/ricaun.Revit.UI.Example/Revit/Commands/Command.cs +++ b/ricaun.Revit.UI.Example/Revit/Commands/Command.cs @@ -12,8 +12,6 @@ public Result Execute(ExternalCommandData commandData, ref string message, Eleme { UIApplication uiapp = commandData.Application; - System.Windows.MessageBox.Show(AutodeskExtension.GetAutodeskOwner(), $"Hello Revit\n{DateTime.Now}"); - return Result.Succeeded; } }