It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
The SerializableAttribute class is explained on this link. In the start it is written:
Indicates that a class can be serialized
Can anybody expalin what this means (the bold part). I am not clear about it.
Serializing an object (an instance of a class) means turning it into something that can be written on a file or broadcasted over the network, such as an XML file (Xml serialization) or a Byte array (binary serialization).
This needs to be a two way operation, so you must be able to "Deserialize" the object.
In order to be serializeble an object must contains just serializable fields/property or fields marked as not serialized. For example a Sql connection is not serialized (it would make no sense deserializing it somewhere else...)
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
What is the best way to transfer an object from C# to PHP?
Lets say I have this:
class MyClass {
public string name;
public int id;
}
I then want to send it to a PHP page and receive it as an object (I have more complex datatypes in mind).
How can I do that, from the C# side and from the PHP side?
One way is to serialise to and from a text based format, for example JSON. Both languages should have ready-made serializers. Or XML if you prefer that.
You could use "nusoap" on php side and xml serializers on C# side
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
In our project, we are having xsd schema files, we are auto generating c# classes for xsd and using them. Each time, if we need to do modification, we are asked to do it in xsd file and which later generated into c# code.
My question is, why we need xsd in first place, why can't we directly have the serializable c# classes created.
I'm assuming the changes to the classes are a result of changes to some XML data structure that the app supports. With that assumption, here are a couple of reasons to keep the XSDs in sync:
If you ever re-generated the class files from the XSDs all changes to the classes would be lost
The XSDs could be used to validate any XML document that could be (de)serialized using those classes.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm looking for full C# standard interfaces list. I'm almost sure that such topic was posted somewhere on MSDN, but I can't find it. Does anyone has a reference?
im sorry but such doc does not exist...
See, msdn documentation is organized by "namespaces", so... you can see that such document would not fit anywhere... by the way, why would you want that?!? if you compile the documents of each interface in the basics dll (system, text, system.data, linq, etc...) you would have a quite large document that would cause more confusion than "de-confusion", since in diferent namespaces interfaces may have the same name...
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Hi my workmate just told me that it is possible to achieve polymorphism by hiding a base class method and implementing another method with the same signature in the derive class, Is this true and how could this be needed in real life situations?
I guess your friend was talking about shadowing. It's not true polymorphism and should be avoided Difference between shadowing and overriding in C#?
That is pretty much anti-polymorphism. The 'real' method for the object should be executed whenever called, regardless of the type of the variable, for polymorphism; you expect derived.Method() to be called whether you call it on a variable of type base or type derived, if the object in question is of type derived.
Hiding breaks that expectation.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Look at the sceene here , please:
http://social.microsoft.com/Forums/getfile/3600/
why it's not matching?
EDIT: Okay, now we know it's XmlReader.Value, which does return a string, that's definitely not the problem. I'll leave the previous answer below for future reference.
My guess is that there are some "odd" Unicode characters which don't show up in the debugger... or that the watch window is behaving strangely. Putting a watch on xml.Value.ToCharArray() would help to show that.
(As an aside, giving a Dictionary<,> parameter the name list is very confusing...)
EDIT: Additionally, using bracing and indentation would also make your code easier to follow...
We can't tell for sure at the moment, but my guess is that the Value property is of type object, not string. That means that == and != perform reference comparisons (operators are overloaded, not overridden, remember). You want the polymorphic behaviour of:
if (xml.Value.Equals("\n"))
or if xml.Value can legitimately be null:
if ("\n".Equals(xml.Value))