User: cneuwirt
Date: 2009/11/12 01:58 PM

Added:
 
/Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/Attributes/
  NewGuidAttribute.cs

Modified:
 
/Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter.Tests/
  DictionaryAdapterFactoryTestCase.cs
 /Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/
  Castle.Components.DictionaryAdapter-vs2008.csproj
 
/Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/Attributes/
  OnDemandAttribute.cs

Log:
 Added NewGuidAttribute to generated guids.

File Changes:

Directory: 
/Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/Attributes/
==================================================================================================

File [added]: NewGuidAttribute.cs
Delta lines: +1 -5
===================================================================

--- 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/Attributes/OnDemandAttribute.cs
  2009-11-12 20:41:13 UTC (rev 6318)
+++ 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/Attributes/OnDemandAttribute.cs
  2009-11-12 20:58:14 UTC (rev 6319)
@@ -78,10 +78,6 @@
                                                {
                                                        storedValue = 
Array.CreateInstance(type.GetElementType(), 0);
                                                }
-                                               else if (type == typeof(Guid))
-                                               {
-                                                       storedValue = 
Guid.NewGuid();
-                                               }
                                                else
                                                {
                                                        object[] args = null;
@@ -126,7 +122,7 @@
                                                        
initializer.Initialize(dictionaryAdapter, storedValue);
                                                }
 
-                                               
dictionaryAdapter.SetProperty(property.PropertyName, ref storedValue);  
+                                               
property.SetPropertyValue(dictionaryAdapter, key, ref storedValue, 
dictionaryAdapter.Descriptor);
                     }
                                }

File [modified]: OnDemandAttribute.cs
Delta lines: +1 -0
===================================================================

--- 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/Castle.Components.DictionaryAdapter-vs2008.csproj
        2009-11-12 20:41:13 UTC (rev 6318)
+++ 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/Castle.Components.DictionaryAdapter-vs2008.csproj
        2009-11-12 20:58:14 UTC (rev 6319)
@@ -63,6 +63,7 @@
     <Compile Include="AssemblyInfo.cs" />
     <Compile Include="AbstractDictionaryAdapter.cs" />
     <Compile Include="Attributes\AttributesUtil.cs" />
+    <Compile Include="Attributes\NewGuidAttribute.cs" />
     <Compile Include="Attributes\GroupAttribute.cs" />
     <Compile Include="Attributes\FetchAttribute.cs" />

Directory: 
/Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter/
=======================================================================================

File [modified]: Castle.Components.DictionaryAdapter-vs2008.csproj
Delta lines: +11 -2
===================================================================

--- 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter.Tests/DictionaryAdapterFactoryTestCase.cs
        2009-11-12 20:41:13 UTC (rev 6318)
+++ 
Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter.Tests/DictionaryAdapterFactoryTestCase.cs
        2009-11-12 20:58:14 UTC (rev 6319)
@@ -1275,7 +1275,7 @@
                public void CanGetGuidPropertyOnDemand()
                {
                        var container = 
factory.GetAdapter<IItemContainer<IPerson>>(dictionary);
-                       Assert.True(container.Id != new Guid());
+                       Assert.True(container.Id == new Guid());
                }
 
                [Test]
@@ -1362,6 +1362,15 @@
                }
 
                [Test]
+               public void CanGetNewGuidPropertyOnDemand()
+               {
+                       var conversions = 
factory.GetAdapter<IConversions>(dictionary);
+                       var guid = conversions.Guid;
+                       Assert.True(guid != new Guid());
+                       Assert.AreEqual(conversions.Guid, guid);
+               }
+
+               [Test]
                public void CanDetermineTheAdaptedInterface()
                {
                        var person = factory.GetAdapter<IPerson>(dictionary);
@@ -1668,7 +1677,7 @@
                decimal Decimal { get; set; }
                String String { get; set; }
                DateTime DateTime { get; set; }
-               Guid Guid { get; set; }
+               [NewGuid]Guid Guid { get; set; }
                int? NullInt { get; set; }
                float? NullFloat { get; set; }

Directory: 
/Components/DictionaryAdapter/trunk/src/Castle.Components.DictionaryAdapter.Tests/
=============================================================================================

File [modified]: DictionaryAdapterFactoryTestCase.cs
Delta lines: +0 -0
===================================================================

--

You received this message because you are subscribed to the Google Groups 
"Castle Project Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-commits?hl=.


Reply via email to