Which list are you using exactly? A generic List? As it also implements IEnumerable you should be able to use the extension methods on them equally. Dust Signs
The number you dialed is imaginary. Please turn your phone by 90 degrees and try again
Which list are you using exactly? A generic List? As it also implements IEnumerable you should be able to use the extension methods on them equally. Dust Signs
The number you dialed is imaginary. Please turn your phone by 90 degrees and try again
Enumerable.Except (since .NET 3.5) Dust Signs
The number you dialed is imaginary. Please turn your phone by 90 degrees and try again
I just answered this question myself :). I just had to use OnSerializing and OnSerialized to set the field to null and reset it to its old value respectively. Thank you very much for your help. Regards, Dust Signs
The number you dialed is imaginary. Please turn your phone by 90 degrees and try again
Thanks for the link, this seems quite useful. But this does not solve my problem: the parent class has to save the field whereas the child classes don't have to save it, so how do I declare the field in the child classes? As I said I cannot mark it as NonSerialized in the parent class as it needs to be saved there. Dust Signs
The number you dialed is imaginary. Please turn your phone by 90 degrees and try again
Hi, of course you are right, but I need this as the parent class saves information in this field which the child classes do not need anymore because they compute it dynamically. And of course we are not talking about an int field, but about an array of a more complex data type which would consume up to 20 or 30 KB per instance which would be serialized and "thrown away" after deserialization as it has to be recomputed anyways. I hope this helps to better understand the purpose of what I want to achieve. Dust Signs
The number you dialed is imaginary. Please turn your phone by 90 degrees and try again
Hi, as the title indicates I want to mark a field in a child class with a NonSerialized attribute so that it won't be serialized. Simply put:
[Serializable]
class Parent
{
protected int SomeField;
}
[Serializable]
class Child : Parent
{
[NonSerialized]
protected int SomeField;
}
Of course this does not work, but also the new keyword does not help me because it only hides the field and does not overwrite it. Is there any other way to achieve the desired effect? Regards Dust Signs
The number you dialed is imaginary. Please turn your phone by 90 degrees and try again
If you are using NTFS you could set the parent folder's ACL so that he is only allowed to read the folders, not change it. This should prevent him of renaming any subfolders. Dust Signs
The number you dialed is imaginary. Please turn your phone by 90 degrees and try again
The bottom-most MSDN example for the lock statement actually looks quite similar: http://msdn.microsoft.com/en-us/library/c5kehkcz(VS.80).aspx[^] Regards, Dust Signs