[JEDI.NET-commits] main/run Jedi.Collections.pas,1.5,1.6
Status: Pre-Alpha
Brought to you by:
jedi_mbe
From: Marcel B. <jed...@us...> - 2004-11-27 19:02:55
|
Update of /cvsroot/jedidotnet/main/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4388/main/run Modified Files: Jedi.Collections.pas Log Message: * Added protected constructor to InlineCollectionBase and InlineDictionaryBase * InlineCollectionBase.GetAllowRemove and InlineDictionaryBase.GetAllowRemove now checks IsReadOnly or IsFixedSize Index: Jedi.Collections.pas =================================================================== RCS file: /cvsroot/jedidotnet/main/run/Jedi.Collections.pas,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Jedi.Collections.pas 26 Aug 2004 09:45:46 -0000 1.5 --- Jedi.Collections.pas 27 Nov 2004 19:02:17 -0000 1.6 *************** *** 107,112 **** strict private FIndexerInfo: PropertyInfo; strict protected - {$REGION 'IInlineCollection methods'} procedure AddItem(value: System.Object; addPropertyId: System.Object); virtual; function GetAllowRemove(key: System.Object): Boolean; virtual; --- 107,112 ---- strict private FIndexerInfo: PropertyInfo; + {$REGION 'IInlineCollection methods'} strict protected procedure AddItem(value: System.Object; addPropertyId: System.Object); virtual; function GetAllowRemove(key: System.Object): Boolean; virtual; *************** *** 115,119 **** function GetNewItemProperties: PropertyDescriptorCollection; virtual; function GetService(serviceType: System.Type): System.Object; virtual; ! {$ENDREGION} function GetItemDescription(index: integer): string; virtual; function GetItemEmptyValue(index: Integer): System.Object; virtual; --- 115,121 ---- function GetNewItemProperties: PropertyDescriptorCollection; virtual; function GetService(serviceType: System.Type): System.Object; virtual; ! {$ENDREGION} ! strict protected ! constructor Create; function GetItemDescription(index: integer): string; virtual; function GetItemEmptyValue(index: Integer): System.Object; virtual; *************** *** 127,132 **** [TypeConverter(TypeOf(InlineCollectionConverter)), Editor(TypeOf(InlineCollectionEditor), TypeOf(UITypeEditor))] InlineDictionaryBase = class abstract (DictionaryBase, IInlineCollection) strict protected - {$REGION 'IInlineCollection methods'} procedure AddItem(value: System.Object; addPropertyId: System.Object); virtual; function GetAllowRemove(key: System.Object): Boolean; virtual; --- 129,134 ---- [TypeConverter(TypeOf(InlineCollectionConverter)), Editor(TypeOf(InlineCollectionEditor), TypeOf(UITypeEditor))] InlineDictionaryBase = class abstract (DictionaryBase, IInlineCollection) + {$REGION 'IInlineCollection methods'} strict protected procedure AddItem(value: System.Object; addPropertyId: System.Object); virtual; function GetAllowRemove(key: System.Object): Boolean; virtual; *************** *** 135,139 **** function GetNewItemProperties: PropertyDescriptorCollection; virtual; function GetService(serviceType: System.Type): System.Object; virtual; ! {$ENDREGION} function GetItemDescription(key: System.Object): string; virtual; function GetItemEmptyValue(key: System.Object): System.Object; virtual; --- 137,143 ---- function GetNewItemProperties: PropertyDescriptorCollection; virtual; function GetService(serviceType: System.Type): System.Object; virtual; ! {$ENDREGION} ! strict protected ! constructor Create; function GetItemDescription(key: System.Object): string; virtual; function GetItemEmptyValue(key: System.Object): System.Object; virtual; *************** *** 1153,1156 **** --- 1157,1165 ---- {$REGION 'InlineCollectionBase'} + constructor InlineCollectionBase.Create; + begin + inherited Create; + end; + procedure InlineCollectionBase.AddItem(value: System.Object; addPropertyId: System.Object); begin *************** *** 1160,1164 **** function InlineCollectionBase.GetAllowRemove(key: System.Object): Boolean; begin ! Result := True; end; --- 1169,1173 ---- function InlineCollectionBase.GetAllowRemove(key: System.Object): Boolean; begin ! Result := not (IList(Self).IsReadOnly and IList(Self).IsFixedSize); end; *************** *** 1229,1232 **** --- 1238,1246 ---- {$REGION 'InlineDictionaryBase'} + constructor InlineDictionaryBase.Create; + begin + inherited Create; + end; + procedure InlineDictionaryBase.AddItem(value: System.Object; addPropertyId: System.Object); begin *************** *** 1236,1240 **** function InlineDictionaryBase.GetAllowRemove(key: System.Object): Boolean; begin ! Result := True; end; --- 1250,1254 ---- function InlineDictionaryBase.GetAllowRemove(key: System.Object): Boolean; begin ! Result := not (IDictionary(Self).IsReadOnly and IDictionary(Self).IsFixedSize); end; |