robsmyth / nserializer Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/nserializer
Automatically exported from code.google.com/p/nserializer
What steps will reproduce the problem?
1. Add in "SampleTestFixture.cs" in "MyClassUnderTest" the following
autoproperty: public string MyProperty { get; set; }
2. Run test SampleTestFixture CanSerialize() and watch xmlText
What is the expected output? What do you see instead?
Expected:
<f name="MyProperty">
<string value="some test content" />
</f>
Instead of
<f name="<MyProperty>k__BackingField">
<string value="some test content" />
</f>
What version of the product are you using? On what operating system?
r127 or r115 (didn't work either), WinXp VS2010 .NET 4.0
First of all: Good work!
We've a big dom with lot of dependency injection (ninject) and a lot of
interfaces or interfaces of lists of interfaces that should be serialized
and that's why I checked out your nserializer.
There's one big problem: We just want to serialize properties, because only
properties can be defined on interfaces. Private Fields should not be
serialized in our project. Now I reviewed your framework and I could not
solve the naming problem. If you get the properties with the
type.GetProperties(BindingFlags...), they're named correctly and the
MemberType is Property, but their (invisible) backing field is also read by
type.GetFields(BindingsFlags...). If I set the fields to empty array and
only took the Properties, there was no output...
I'm looking forward to use nserializer in our project. For more information
or contact (skype, email) please contact me on kuermX at gmail
Thanks in advance
Martin
Original issue reported on code.google.com by [email protected]
on 12 Mar 2010 at 9:58
Nice tool. Unfortunately i am using .NET 2.0. Possible to get the older version
source codes?
Original issue reported on code.google.com by [email protected]
on 26 Aug 2010 at 5:56
What steps will reproduce the problem?
1. Serialize a value with special characters like "<", "&", """, ...
What is the expected output? What do you see instead?
For "&" I expect "&" etc
Instead of an xml error when loading the string in a xml document
What version of the product are you using? On what operating system?
r115, XP, .NET 4
Please provide any additional information below.
To Fix reading, just rewrite NullFieldDefinition.cs
public object Convert(object value)
{
return value;
}
to
public object Convert(object value)
{
if (value.GetType() == typeof(string))
{
value = HttpUtility.HtmlDecode(value.ToString());
}
return value;
}
In my opinion value should always be a string object. But I didn't wrote
the framework... maybe the if is not needed
To Fix writing, just rewrite NXmlNodeWriter.cs
public void AddAttribute(string attributeName, string value)
{
if (streamWriter != null)
{
streamWriter.Write(string.Format(" {0}=\"{1}\"", attributeName,
value));
}
}
to
public void AddAttribute(string attributeName, string value)
{
if (streamWriter != null)
{
value = HttpUtility.HtmlEncode(value);
streamWriter.Write(string.Format(" {0}=\"{1}\"", attributeName,
value));
}
}
Original issue reported on code.google.com by [email protected]
on 12 Mar 2010 at 3:10
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.