Questions tagged [iserializable]

54 questions
1
vote
1 answer

How often should each object's GetObjectData method be called during custom serialization?

I'm serializing the data in my app using custom serialization i.e. each of the classes I'm storing has the [Serializable] attribute and implements ISerializable. The object graph being serialized is reasonably complex with lots of cross-references…
Mal Ross
  • 4,303
  • 4
  • 31
  • 46
1
vote
2 answers

Socket.Send, server receive many invalid MPacket

[Serializable] public class Packet : ISerializable Packet is my class use for holding data, implemented ISerializable and all needed constructor and functions I read…
1
vote
0 answers

Serializing events with circular references using ISerializable

I have to deal with serializing a bunch of objects. For the sake of simplicity I am using the [Serializable] attribute together with the binary serializer and binary formatter, excluding non-neccessary fields with [NonSerialized] for most of the…
mvo
  • 1,048
  • 10
  • 16
1
vote
1 answer

Linq-to-SQL overriding my OnSerializing attribute

My Code partial class User { [OnSerializing] public void ClearPassword() { Password = null; …
0
votes
0 answers

Refer to an attribute within the serialization in C#

Good morning, I am working on a software which mix C# and C++/CLI between different application domains. I have implemented a solution with cross app domain singleton and ISerialisable interface in order to send information between two different…
Zaraki21
  • 23
  • 1
  • 4
0
votes
1 answer

Serialization/Deserialization with ISerializable

Good morning, I am working on a C# application and I need to serialize an object with ISerializable interface but I do not how to do it. My object has no properties, it just have some methods. See below the code : public interface ILogger { …
Zaraki21
  • 23
  • 1
  • 4
0
votes
0 answers

Is it possible to use DataContractSerialization in class implementing ISerializable interface?

I worked with some classes implementing ISerializable interface. Now I have some task and I need to use DataContractSerialization. I could remove ISerializable parts, but i need to be able to read old files made using ISerializable interface…
0
votes
1 answer

Cross-Process Drag and Drop of custom object type contain sorted list of XmlNodes in WinForms C#

I had a similar problem as the user posting at the following location: Cross-Process Drag and Drop of custom object type in WinForms C# Luckily, I have figured out how to serialize almost all parts of my custom object except for a SortedList object.…
KyleK
  • 190
  • 12
0
votes
1 answer

How to correctly serialize Exceptions in .net 4.7.[x]+, and .net Standard 2.[x]+

I have some Exception derived types, which add additional properties to the Exception. Searching the web for examples and guidelines on how to handle the serialization of such Exception-based types led to descriptions and code samples which were…
HCL
  • 34,231
  • 24
  • 150
  • 202
0
votes
0 answers

WCF Serialization using ISerializable Interface

This should be possible however I have searched extensively and have found no answers to this, using WCF ISerializable interface concept. Hopefully the experts can help. Any documentation I have read only refers to info.AddValue(...) concept similar…
AshHegde
  • 11
  • 2
0
votes
2 answers

Using ISerializable breaks serialization for previously supported types

I'm trying to serialize/deserialize a custom class I have that has a System.Windows.Media.Color property. It wasn't working because Color doesn't have the [Serializable] Attribute. Based on some other articles, I decided to implement ISerializable,…
Olli
  • 183
  • 2
  • 11
0
votes
1 answer

ISerializable for Collection

I am writing the serialization code for a Collection class and would like to know how to set and get the items in the collection. I am using Binary serialization. I have made an attempt in the following code, but am not sure on the correct…
user3736648
  • 6,783
  • 17
  • 67
  • 145
0
votes
0 answers

Custom object XML serialization whithout any xml tags

I would like to create a custom serializable "string" class to handle the default string formatting without implement the logic in all of the modells. I created a serializable class with implicit string operator [Serializable] public class…
Smiley
  • 58
  • 5
0
votes
1 answer

C# custom serialization of a class with list of interfaces

I am trying to find a way to serialize and deserialize the ClassToSerialize below built like: [Serializable] public interface IFoo { } [Serializable] public class BaseFoo : IFoo { } [Serializable] public…
MihaiP.
  • 123
  • 1
  • 10
0
votes
2 answers

How to serialize an ISerializable object into SOAP or Json or Xml

I have a complex object which is ISerializable and i want to serialize it into an XML document (node that i rather to not change the source code and add XML serialization attribute stuff). ISerializable works fine with BinaryFormatter, but there is…
epsi1on
  • 541
  • 5
  • 15