TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Romain
NA
76
39.9k
Serialization/Deserialization with ISerializable
Oct 28 2020 4:59 AM
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
{
void
logErrorMessage(
string
errorMessage);
void
logInfoMessage(
string
infoMessage);
void
logWarningMessage(
string
warningMessage);
}
[Serializable]
class
MessageLogger: ILogger, ISerializable
{
public
MessageLogger()
{ }
public
void
logErrorMessage(
string
errorMessage)
{
System.Diagnostics.Debug.WriteLine(
"ERROR :"
+ errorMessage);
}
public
void
logInfoMessage(
string
infoMessage)
{
System.Diagnostics.Debug.WriteLine(
"INFO:"
+ infoMessage);
}
public
void
logWarningMessage(
string
warningMessage)
{
System.Diagnostics.Debug.WriteLine(
"WARNING:"
+ warningMessage);
}
public
virtual
void
GetObjectData(SerializationInfo info, StreamingContext context)
{
}
}
My question is what I have to put in GetObjectData ?
Thank you in advance for any help.
Romain.
Reply
Answers (
2
)
Delete data and save using linq query.
Read excel column having all cell values in dropdown