Skip to content

Commit 1d50939

Browse files
committed
Prepare V2.16.0
1 parent 4bc3ec6 commit 1d50939

17 files changed

+163
-21
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5+
### Ribbon V2.16.0, RibbonTools V1.8.0
6+
7+
#### Changed (Ribbon)
8+
9+
- New functions for Gallery controls (InvalidateItemsSource() InvalidateCategories()).
10+
- Remove deprecated .NET7 assembly
11+
12+
#### Changed (RibbonTools)
13+
14+
- Unlimited Ribbons for an application via Settings (Wrapper class name like Markup file instead of RibbonItems), solves Issue#18.
15+
516
### Ribbon V2.15.2, RibbonTools V1.7.2
617

718
#### Changed (Ribbon)

HowToUse.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
![Schemas](./Images/Schemas.png)
2525

2626
Insert Application Commands and Application Views as you can see in the samples and the documentation in the wiki.
27-
**Hint**: If you have more than one Ribbon Control for different Forms in the project, then you should name the RibbonMarkup.xml to RibbonMarkup1.xml, RibbonMarkup2.xml, ... ,RibbonMarkup9.xml
27+
28+
**Hint**: If you have more than one Ribbon Control for different Forms in the project, then you should name the RibbonMarkup.xml to RibbonMarkup1.xml, RibbonMarkup2.xml, ... ,RibbonMarkup9.xml
29+
or with a new wrapper option (Version v2.16.0) you can generate wrapper class names like markup xml files (e.g. *First.xml* => *First.Designer.cs* with class name *First* instead RibbonItems.Designer.cs)
2830

2931
7. Because CustomTools, like Bernhard Elbl said, do not work this way in newer Visual Studio versions like VS 2017 you have to
3032
open a Console Window in the folder of RibbonMarkup.xml (maybe we have a solution for a CustomTool later on). Or you can use the RibbonTools.exe to design, build and preview the markup file.
@@ -33,7 +35,7 @@
3335

3436
9. If the build fails with a "No Tools" error, then check the installation of the Windows SDK and the C++ Tools in Visual Studio. If the installations are OK, start the RibbonTools from Windows Startmenu, go to Settings and search for the tools uicc.exe, rc.exe and link.exe and build again.
3537

36-
12. Now you get some generated files, eg. RibbonMarkup.ribbon and RibbonItems.Designer.cs. Add these files to your project.
38+
12. Now you get some generated files, eg. RibbonMarkup.ribbon and RibbonItems.Designer.cs. Add these files to your project. (See hint in 6.)
3739

3840
13. Set the Property Build Action of RibbonMarkup.ribbon to Embedded Resource.
3941
![Embedded Resource](./Images/Embedded.png)
@@ -49,7 +51,7 @@
4951
```
5052

5153
to the Form1.cs. In the Constructor (Ctor) of the Forms1 after InitializeComponents() you have to call RibbonItems ribbonItems = new RibbonItems(ribbon1);
52-
This is a wrapper class for all defined Ribbon Items. You can extend this class because it is a partial class.
54+
This is a wrapper class for all defined Ribbon Items. You can extend this class because it is a partial class. (See hint in 6.)
5355

5456
16. Define the code behind for the Ribbon items in C# or VB language.
5557

Ribbon/Controls/Properties/GalleryPropertiesProvider.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ public interface IGalleryPropertiesProvider
3737
/// </summary>
3838
IUICollection ItemsSource { get; }
3939

40+
/// <summary>
41+
/// Invalidate GalleryCategories or Categories if one change a value
42+
/// </summary>
43+
void InvalidateCategories();
44+
45+
/// <summary>
46+
/// Invalidate GalleryItemItemsSource or ItemsSource if one change a value
47+
/// </summary>
48+
void InvalidateItemsSource();
49+
4050
/// <summary>
4151
/// Selected item property
4252
/// </summary>
@@ -210,6 +220,28 @@ public IUICollection ItemsSource
210220
}
211221
}
212222

223+
/// <summary>
224+
/// Invalidate GalleryCategories or Categories if one change a value
225+
/// </summary>
226+
public void InvalidateCategories()
227+
{
228+
if (_ribbon.Framework != null)
229+
{
230+
_ribbon.Framework.InvalidateUICommand(_commandID, Invalidations.Property, PropertyKeyRef.From(RibbonProperties.Categories));
231+
}
232+
}
233+
234+
/// <summary>
235+
/// Invalidate GalleryItemItemsSource or ItemsSource if one change a value
236+
/// </summary>
237+
public void InvalidateItemsSource()
238+
{
239+
if (_ribbon.Framework != null)
240+
{
241+
_ribbon.Framework.InvalidateUICommand(_commandID, Invalidations.Property, PropertyKeyRef.From(RibbonProperties.ItemsSource));
242+
}
243+
}
244+
213245
/// <summary>
214246
/// Selected item property
215247
/// </summary>

Ribbon/Controls/RibbonComboBox.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,22 @@ public IUICollection ItemsSource
100100
}
101101
}
102102

103+
/// <summary>
104+
/// Invalidate GalleryCategories or Categories if one change a value
105+
/// </summary>
106+
public void InvalidateCategories()
107+
{
108+
_galleryPropertiesProvider.InvalidateCategories();
109+
}
110+
111+
/// <summary>
112+
/// Invalidate GalleryItemItemsSource or ItemsSource if one change a value
113+
/// </summary>
114+
public void InvalidateItemsSource()
115+
{
116+
_galleryPropertiesProvider.InvalidateItemsSource();
117+
}
118+
103119
/// <summary>
104120
/// The index of the selected item in the ComboBox.
105121
/// If nothing is selected returns UI_Collection_InvalidIndex,

Ribbon/Controls/RibbonDropDownGallery.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,22 @@ public IUICollection ItemsSource
102102
}
103103
}
104104

105+
/// <summary>
106+
/// Invalidate GalleryCategories or Categories if one change a value
107+
/// </summary>
108+
public void InvalidateCategories()
109+
{
110+
_galleryPropertiesProvider.InvalidateCategories();
111+
}
112+
113+
/// <summary>
114+
/// Invalidate GalleryItemItemsSource or ItemsSource if one change a value
115+
/// </summary>
116+
public void InvalidateItemsSource()
117+
{
118+
_galleryPropertiesProvider.InvalidateItemsSource();
119+
}
120+
105121
/// <summary>
106122
/// The index of the selected item in the DropDownGallery.
107123
/// If nothing is selected returns UI_Collection_InvalidIndex,

Ribbon/Controls/RibbonInRibbonGallery.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,22 @@ public IUICollection ItemsSource
102102
}
103103
}
104104

105+
/// <summary>
106+
/// Invalidate GalleryCategories or Categories if one change a value
107+
/// </summary>
108+
public void InvalidateCategories()
109+
{
110+
_galleryPropertiesProvider.InvalidateCategories();
111+
}
112+
113+
/// <summary>
114+
/// Invalidate GalleryItemItemsSource or ItemsSource if one change a value
115+
/// </summary>
116+
public void InvalidateItemsSource()
117+
{
118+
_galleryPropertiesProvider.InvalidateItemsSource();
119+
}
120+
105121
/// <summary>
106122
/// The index of the selected item in the InRibbonGallery.
107123
/// If nothing is selected returns UI_Collection_InvalidIndex,

Ribbon/Controls/RibbonSplitButtonGallery.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,22 @@ public IUICollection ItemsSource
124124
}
125125
}
126126

127+
/// <summary>
128+
/// Invalidate GalleryCategories or Categories if one change a value
129+
/// </summary>
130+
public void InvalidateCategories()
131+
{
132+
_galleryPropertiesProvider.InvalidateCategories();
133+
}
134+
135+
/// <summary>
136+
/// Invalidate GalleryItemItemsSource or ItemsSource if one change a value
137+
/// </summary>
138+
public void InvalidateItemsSource()
139+
{
140+
_galleryPropertiesProvider.InvalidateItemsSource();
141+
}
142+
127143
/// <summary>
128144
/// The index of the selected item in the SplitButtonGallery.
129145
/// If nothing is selected returns UI_Collection_InvalidIndex,

Ribbon/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@
3737
#else
3838
[assembly: AssemblyVersion("1.0.0.0")]
3939
#endif
40-
[assembly: AssemblyFileVersion("2.15.2.0")]
40+
[assembly: AssemblyFileVersion("2.16.0.0")]
4141

Ribbon/RibbonCore.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFrameworks>net8.0-windows;net7.0-windows;net6.0-windows;net40</TargetFrameworks>
5+
<TargetFrameworks>net8.0-windows;net6.0-windows;net40</TargetFrameworks>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<UseWindowsForms>true</UseWindowsForms>
88
<ApplicationIcon />
@@ -20,7 +20,7 @@
2020

2121
<PackageId>WindowsRibbon</PackageId>
2222
<Product>Windows Ribbon Control</Product>
23-
<Version>2.15.2</Version>
23+
<Version>2.16.0</Version>
2424
<Authors>Hartmut Borkenhagen</Authors>
2525
<Company>RibbonLib</Company>
2626
<PackageIcon>Ribbon64.png</PackageIcon>

RibbonTools/Build/AbstractCodeBuilder.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,31 @@ protected AbstractCodeBuilder() { }
4141
/// Method builds a C# file RibbonItems.Designer.cs
4242
/// </summary>
4343
/// <param name="path">RibbonMarkup.xml with path</param>
44-
public void Execute(string path, RibbonParser parser)
44+
public void Execute(string path, RibbonParser parser, bool advWrapperClassFile)
4545
{
4646
//string @namespace = System.Reflection.Assembly.GetEntryAssembly().EntryPoint.DeclaringType.Namespace;
4747
if (File.Exists(path))
4848
{
4949
string directory = Path.GetDirectoryName(path);
5050

51-
string xmlFileName = Path.GetFileNameWithoutExtension(path);
52-
char last = xmlFileName[xmlFileName.Length - 1];
53-
if (Char.IsNumber(last))
51+
if (advWrapperClassFile)
5452
{
55-
ribbonItemsClass = RibbonItems + last.ToString();
53+
ribbonItemsClass = Path.GetFileNameWithoutExtension(path);
5654
}
5755
else
5856
{
59-
ribbonItemsClass = RibbonItems;
57+
string xmlFileName = Path.GetFileNameWithoutExtension(path);
58+
char last = xmlFileName[xmlFileName.Length - 1];
59+
if (Char.IsNumber(last))
60+
{
61+
ribbonItemsClass = RibbonItems + last.ToString();
62+
}
63+
else
64+
{
65+
ribbonItemsClass = RibbonItems;
66+
}
6067
}
6168

62-
6369
RibbonParser.ParseResult results = parser.Results;
6470
#if OldCode
6571
pair1List = (results.Pair1List);

0 commit comments

Comments
 (0)