Skip to content

Commit

Permalink
Merge pull request #32 from ricaun-io/develop
Browse files Browse the repository at this point in the history
Version 0.5.7
  • Loading branch information
ricaun authored Nov 18, 2023
2 parents fc5fa28 + 05e0f6b commit c7055fe
Show file tree
Hide file tree
Showing 19 changed files with 322 additions and 177 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
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.5.7] / 2023-11-17
### Features
- LargeImage changes `TextBox` Image
- Create `RowLargeStackedItems` with large image and two itens
### Updated
- Update Example `Icons` to get random icon using `UIFrameworkRes`
### Tests
- Test `ComboBox` and `TextBox` Image/LargeImage
- Test `RowLargeStackedItems` with large image and two itens

## [0.5.6] / 2023-11-08
### Features
- Update Remove and QuickAccess
Expand Down Expand Up @@ -291,6 +301,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- First Release

[vNext]: ../../compare/1.0.0...HEAD
[0.5.7]: ../../compare/0.5.6...0.5.7
[0.5.6]: ../../compare/0.5.5...0.5.6
[0.5.5]: ../../compare/0.5.4...0.5.5
[0.5.4]: ../../compare/0.5.3...0.5.4
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,6 @@ awRibbonPanel.SetDialogLauncher(ribbonCommandItem);

This Project is [licensed](LICENSE) under the [MIT Licence](https://en.wikipedia.org/wiki/MIT_License).

Credit to [icons8.com](https://icons8.com/) for the icons on the Example.

---

Do you like this package? Please [star this project on GitHub](../../stargazers)!
2 changes: 1 addition & 1 deletion ricaun.Revit.UI.Example/Models/TestModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class TestModel : NotifyPropertyBase
{
public string Text { get; set; } = "Test";
public string Title { get; set; } = "Title";
public object Icon { get; set; } = Proprieties.Icons8.Circled;
public object Icon { get; set; } = Proprieties.Pack.Revit;
public ICommand CommandTest { get; set; }
public ICommand CommandTest2 { get; set; }
}
Expand Down
52 changes: 52 additions & 0 deletions ricaun.Revit.UI.Example/Proprieties/Icons.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using ricaun.Revit.UI;
using System;
using System.Collections;
using System.Linq;
using System.Reflection;
using System.Windows.Media.Imaging;

namespace ricaun.Revit.UI.Example.Proprieties
{
public static class Icons
{
/// <summary>
/// Get Icon
/// </summary>
public static BitmapSource Icon => GetIcon().GetBitmapSource();
public static string[] IconResources { get; } = GetIcons();
private static int IndexResource = 0;
private static string GetIcon()
{
var icon = IconResources[IndexResource];
IndexResource = (IndexResource + 1) % IconResources.Length;
return icon;
}
private static string AssemblyName => "UIFrameworkRes";
private static string[] GetIcons()
{
var assembly = AppDomain.CurrentDomain.GetAssemblies()
.FirstOrDefault(e => e.GetName().Name.Equals(AssemblyName, StringComparison.InvariantCultureIgnoreCase));

return GetResourceNames(assembly)
.Where(e => e.Contains("ribbon"))
.Where(e => e.EndsWith(".ico"))
.Select(e => $"/{AssemblyName};component/{e}")
.ToArray();
}
/// <summary>
/// GetResourceNames
/// </summary>
/// <param name="assembly"></param>
/// <returns></returns>
private static string[] GetResourceNames(Assembly assembly)
{
string resName = assembly.GetName().Name + ".g.resources";
using (var stream = assembly.GetManifestResourceStream(resName))
using (var reader = new System.Resources.ResourceReader(stream))
{
var resources = reader.Cast<DictionaryEntry>().Select(entry => (string)entry.Key).OrderBy(e => e).ToArray();
return resources;
}
}
}
}
42 changes: 0 additions & 42 deletions ricaun.Revit.UI.Example/Proprieties/Icons8.cs

This file was deleted.

2 changes: 1 addition & 1 deletion ricaun.Revit.UI.Example/Proprieties/Pack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public static class Pack
private static string BaseUri => @"pack://application:,,,/{0};component/Ribbon/images/{1}.ico";
#endregion
public static string Icon([CallerMemberName] string name = null) => string.Format(BaseUri, Assembly, name.ToLower());
public static string Revit => Icon();
public static string Power => Icon("system_electrical_circuit_power_create");
public static string Communication => Icon("system_electrical_circuit_communication_create");
public static string Control => Icon("system_electrical_circuit_control_create");
Expand All @@ -19,6 +20,5 @@ public static class Pack
public static string Security => Icon("system_electrical_circuit_security_create");
public static string Telephone => Icon("system_electrical_circuit_telephone_create");
public static string Switch => Icon("system_switch_create");

}
}
Loading

0 comments on commit c7055fe

Please sign in to comment.