From ebd031e3bed6c1cfddce8fc9b98f7f9e95fb9e32 Mon Sep 17 00:00:00 2001
From: tangxu <tangxu76880903>
Date: 星期一, 04 十一月 2024 17:33:38 +0800
Subject: [PATCH] 添加OCC融合

---
 WinFrmUI/DPumpHydr.WinFrmUI.Ribbon/Classes/Collections/RibbonItemCollection.cs |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/WinFrmUI/DPumpHydr.WinFrmUI.Ribbon/Classes/Collections/RibbonItemCollection.cs b/WinFrmUI/DPumpHydr.WinFrmUI.Ribbon/Classes/Collections/RibbonItemCollection.cs
index 0e93b60..1cd7e7a 100644
--- a/WinFrmUI/DPumpHydr.WinFrmUI.Ribbon/Classes/Collections/RibbonItemCollection.cs
+++ b/WinFrmUI/DPumpHydr.WinFrmUI.Ribbon/Classes/Collections/RibbonItemCollection.cs
@@ -435,7 +435,6 @@
             int y = rectangle.Top + (rectangle.Height - GetItemsHeight()) / 2;
 
             MoveTo(items, new Point(x, y));
-
         }
 
         /// <summary>
@@ -475,7 +474,7 @@
                 // A DropDown menu
                 //if (item is RibbonDescriptionMenuItem)
                 //{
-                //    throw new ApplicationException("The only style supported by the RibbonButtonList is Normal");
+                //    throw new ArgumentException("The only style supported by the RibbonButtonList is Normal", nameof(item));
                 //}
             }
             else
@@ -483,7 +482,7 @@
                 // A Panel
                 if (item is RibbonDescriptionMenuItem)
                 {
-                    throw new ApplicationException("The RibbonDescriptionMenuItem item is not supported on a panel");
+                    throw new ArgumentException("The RibbonDescriptionMenuItem item is not supported on a panel", nameof(item));
                 }
             }
         }
@@ -509,8 +508,6 @@
         /// <param name="items">Items to add</param>
         public override void AddRange(IEnumerable<RibbonItem> items)
         {
-
-
             foreach (RibbonItem item in items)
             {
                 CheckRestrictions(item);
@@ -537,6 +534,7 @@
             item.SetOwner(Owner);
             item.SetOwnerPanel(OwnerPanel);
             item.SetOwnerTab(OwnerTab);
+            item.SetOwnerItem(OwnerItem);
 
             base.Insert(index, item);
         }

--
Gitblit v1.9.3