This project is read-only.

Using with

Topics: Developer Forum, User Forum
Apr 23, 2007 at 9:31 AM
In my new project i added our collection, but i have a problem when use in vb project. My solution throw an exception :
Eccezione first-chance di tipo 'System.Runtime.Serialization.SerializationException' in mscorlib.dll
"System.Runtime.Serialization.SerializationException: Impossibile ottenere il membro 'CollectedItem_PropertyChanged'.
in System.Reflection.MemberInfoSerializationHolder.GetRealObject(StreamingContext context)
in System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder) ......" what is the problem ?, I have not correct set the serialization ?
The 2nd question is, for adding item from my NHibernate dal its correct use this code:

<Serializable()> Public Class AnagraficaCollection
Inherits RafCollection(Of Anagrafica)
Private _Lista As IList(Of Anagrafica)
Public Property InternalList() As IList(Of Anagrafica)
Return _Lista
End Get
Set(ByVal value As IList(Of Anagrafica))
_Lista = value
For h As Integer = 0 To _Lista.Count - 1
End Set
End Property
End Class

Thanks Stefano
May 2, 2007 at 10:30 PM
I cust&paste the same answer I gave you on the newsgroups:

Did you specified to not serialize the entity?
In C# (as in the project example) you have to do tihis way:
field: NonSerialized
public event PropertyChangedEventHandler PropertyChanged;

In there is not a field correspondence. The solution is to expand the event:

<Serializable()> _
Public Class Something
Implements INotifyPropertyChanged

#Region "Sostituto di ==> Event PropertyChanged As
<NonSerialized()> _
Private PropertyChangedHandlers As New Generic.List(Of

Public Custom Event PropertyChanged As PropertyChangedEventHandler
Implements INotifyPropertyChanged.PropertyChanged
AddHandler(ByVal value As PropertyChangedEventHandler)
If PropertyChangedHandlers Is Nothing Then
PropertyChangedHandlers = New Generic.List(Of PropertyChangedEventHandler)()
End AddHandler

RemoveHandler(ByVal value As PropertyChangedEventHandler)
End RemoveHandler

RaiseEvent(ByVal sender As Object, ByVal e As
For Each Element As PropertyChangedEventHandler In
Element.Invoke(sender, e)
End RaiseEvent
End Event
#End Region
End Class

May 7, 2007 at 9:10 AM
Hi Raf,
i modified my code but don't work, throw this exception (complete description string):
System.Runtime.Serialization.SerializationException: Impossibile ottenere il membro 'CollectedItem_PropertyChanged'.
System.Reflection.MemberInfoSerializationHolder.GetRealObject(StreamingCont­ext context)
System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHol­der holder)
in System.Runtime.Serialization.ObjectManager.DoFixups()
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(Hea­derHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(­Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(­Stream serializationStream)
in Vevy.Collections.EntityHelper.SerializeClone(Object o) in D:
\RafCollectionSolution\RafCollection\EntityHelper.cs:riga 40
Eccezione first-chance di tipo
'System.Runtime.Serialization.SerializationException' in

I have uploaded a test project, you can look what are the problem ?
Many thanks
May 21, 2007 at 2:25 PM
To resolve the problem

mark _PropertyChanged in Storage.cs line 242. with NonSerialized

May 21, 2007 at 3:44 PM
Giuseppe, work fine

Thanks a lot