I understood that anonymous types are marked private by the compiler and the properties are read-only. Is there a way to serialize them to xml (without deserialize) ? It works with JSON, how can I do it with XML?
...
Hi, I have a simple DataContract class that contains an array of another DataContract class. When it's serialized, the resulting XML contains the array, but every tag first starts with "a:" (example: <a:name>test</a:name>). Is there a way to tell the serializer to ommit those?
Thanks!
...
Hallo.
I am writing a tier2 ordering software for network usage. So we have client and server.
On the client I create Objects of TBest in which the Product ID, the amount and the user who orders it are saved. (So this is a item of an Order).
An order can have multiple items and those are saved in an array to later send the created ord...
I want to serialize a nullable bool simply by converting it to a string
public static string SerializeNullableBoolean(bool? b)
{
if (b == null)
{
return "null or -1 or .."; // What to return here?
}
else
{
return b.ToString();
}
}
What is the most appr...
I have a class with a property in it.I want to know if we can set the attribute such as
XmlAttributeAttribute.AttributeName.
Here the ElementName attribute is set at compile time,i want top know can we set @ run time.
public class MyTestClass
{
[XmlElement(ElementName = "MyAttributeName")]
public int MyAttribute
{
...
Hi,
I got a XML schema for which I used xsd.exe to generate a Class FooClass.
I am receiving xml requests from host which I get them from a directory and use the XmlSerializer.Deserialize() to get a Instance of my FooClass.
Well, this worked till now perfectly and it still does, but suddenly I started to get XML files which are larger...
While using for an object this code to serialize it:
public object Clone()
{
var serializer = new DataContractSerializer(GetType());
using (var ms = new System.IO.MemoryStream())
{
serializer.WriteObject(ms, this);
ms.Position = 0;
return serializer.ReadObject(ms);
...
I wrote several simulation programs in C++ and want to connect their outputs/inputs with pipes (best solution would probably be to use the C++ streams).
For this I would like to serialize some objects (for example the simulations output/input are tensors and matrices). How should I handle this problem? I searched around for some time fo...
Hi,
In xcode you can use po object to see a textual representation of a given object. Is it possible to convert from this textual representation to a real objective c object?
Thanks
...
I'm basically searching for a way to pass instances across programs/processes without serializing the instances, in .NET 4.0.
Yes, I'm missing my good ol' 100% unsafe pointers ;)
I thought the new integration of Memory-mapped files to .NET 4.0 would help me, having read somewhere that you could pass references/pointers "natively" using...
I want to send video files from the Android via network to server. How can I serialize video files in Android?
...
Is there any open source Object to XML serializer in Java that uses writeObject method on the object to serialize similar to NSXMLOutputStream in WebObjects?
...
ETA: I have a similar, smaller, problem here which, I suspect, is related to this problem.
I have a class which has a readonly property that holds a collection of components (* not quite, see below). At design time, it's possible to select from the components on the design surface to add to the collection. (Think imagelist, but instead ...
How to implement cloning of objects (entities) in NHibernate? In the classes of entities has properties such
public virtual IList<Club> Clubs { get; set; }
All classes are inherited from BaseObject.
I tried to implement using xml serialization, but the interfaces are not serialized.
Thank you for your answers!
...
(I've answered the question below with a hack. I'm fairly confident in it unless MS change the way that codedom serializers the designer code.)
ETA2:
I've worked out what is going on. I wondered why sometimes it would work and not others. It boils down to the name that I give to the internal property and the collection.
If I rename th...
Suppose you have the following class:
class Test : ISerializable {
public static Test Instance1 = new Test {
Value1 = "Hello"
,Value2 = 86
};
public static Test Instance2 = new Test {
Value1 = "World"
,Value2 = 26
};
public String Value1 { get; private set; }
public int Value2 { get; private set; }
publi...
I have been trying to implement and undo/redo system in a game I am coding in Java. I am taking the approach of serializing the state of the game after each move. I there a way of saving the serialized objects on a stack and accessing them for undo/redo?
...
I de-normalized my database, since the application was crawling otherwise, and Im storing a list of categories for each item in the DB as a raw html version, and simply echoing it out in my design. Each category is actually a link, which is include a tag. Naturally, this is abit of a pain, especially if I want to change the look of how...
Hi
Is it possible to break the serialization in following scenario?
GetObjectValue(StreamingInfo info, ....)
{
info.AddValue("string1", subobject1);
info.AddValue("string2", Subobject2);
.
.
}
Now my scenario is after serializing subobject1, if the size of the stream exceeds some size limit, can i stop serializing rem...
Hi everyone, I'm having a bit of problem with an example I'm currently testing. For some reason, the execution blocks when writing at oos.writeObject(new SimpleObject());, despite that fact that the pipe should transfer the data across, even (I'd assume) if it had to do it in smaller operations due to a small pipe size. Anyway, the examp...