本文整理汇总了C#中MonoDevelop.Core.Serialization.DataNode类的典型用法代码示例。如果您正苦于以下问题:C# DataNode类的具体用法?C# DataNode怎么用?C# DataNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataNode类属于MonoDevelop.Core.Serialization命名空间,在下文中一共展示了DataNode类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnDeserialize
internal protected override object OnDeserialize (SerializationContext serCtx, object mapData, DataNode data)
{
string file = ((DataValue)data).Value;
if (!string.IsNullOrEmpty (file)) {
if (Path.DirectorySeparatorChar != serCtx.DirectorySeparatorChar)
file = file.Replace (serCtx.DirectorySeparatorChar, Path.DirectorySeparatorChar);
string basePath = Path.GetDirectoryName (serCtx.BaseFile);
file = FileService.RelativeToAbsolutePath (basePath, file);
}
if (ValueType == typeof (string))
return file;
else
return (FilePath) file;
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:14,代码来源:ProjectPathItemPropertyAttribute.cs
示例2: OnDeserialize
internal protected override object OnDeserialize (SerializationContext serCtx, object mapData, DataNode data)
{
string str = ((DataValue)data).Value;
switch (str) {
case "Nothing":
str = BuildAction.None;
break;
case "EmbedAsResource":
str = BuildAction.EmbeddedResource;
break;
case "FileCopy":
case "Exclude":
str = BuildAction.Content;
break;
}
return str;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:17,代码来源:BuildActionDataType.cs
示例3: Deserialize
internal void Deserialize (SerializationContext serCtx, object instance, DataNode data, object valueInstance)
{
serCtx.Serializer.OnDeserializeProperty (this, serCtx, instance, data, valueInstance);
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:4,代码来源:ItemProperty.cs
示例4: OnDeserialize
internal protected override object OnDeserialize (SerializationContext serCtx, object mapData, DataNode data)
{
return String.Equals (((DataValue)data).Value, "true", StringComparison.OrdinalIgnoreCase);
}
开发者ID:drasticactions,项目名称:monodevelop,代码行数:4,代码来源:MSBuildProjectService.cs
示例5: OnDeserialize
internal protected override object OnDeserialize (SerializationContext serCtx, object mapData, DataNode data)
{
return XmlConvert.ToDateTime (((DataValue)data).Value, XmlDateTimeSerializationMode.Local);
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:PrimitiveDataType.cs
示例6: OnDeserialize
internal protected override object OnDeserialize (SerializationContext serCtx, object mapData, DataNode data)
{
var dval = data as DataValue;
if (dval != null) {
return dval.Value;
}
//empty strings are serialised as empty elements, which are parsed as empty DataItems, not DataValues
var ditem = (DataItem) data;
if (ditem.HasItemData) {
throw new InvalidOperationException ("Found complex element, expecting primitive");
}
return "";
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:15,代码来源:PrimitiveDataType.cs
示例7: WriteDataNode
void WriteDataNode (StreamWriter sw, string prefix, DataNode node, ref int id)
{
string name = node.Name;
string newPrefix = prefix.Length > 0 ? prefix + "." + name: name;
if (node is DataValue) {
DataValue val = (DataValue) node;
string value = EncodeString (val.Value);
sw.WriteLine ("\t\t" + newPrefix + " = " + value);
}
else {
DataItem it = (DataItem) node;
sw.WriteLine ("\t\t" + newPrefix + " = $" + id);
newPrefix = "$" + id;
id ++;
foreach (DataNode cn in it.ItemData)
WriteDataNode (sw, newPrefix, cn, ref id);
}
}
开发者ID:riverans,项目名称:monodevelop,代码行数:19,代码来源:SlnFileFormat.cs
示例8: GetChildWriter
protected virtual XmlConfigurationWriter GetChildWriter (DataNode data)
{
return this;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:XmlDataSerializer.cs
示例9: OnDeserializeProperty
internal protected virtual object OnDeserializeProperty (ItemProperty prop, SerializationContext serCtx, object instance, DataNode data)
{
return prop.OnDeserialize (serCtx, data);
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:4,代码来源:DataSerializer.cs
示例10: OnCreateInstance
internal protected virtual object OnCreateInstance (DataType dataType, SerializationContext serCtx, DataNode data)
{
return dataType.OnCreateInstance (serCtx, data);
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:4,代码来源:DataSerializer.cs
示例11: OnDeserialize
internal protected virtual void OnDeserialize (DataType dataType, SerializationContext serCtx, object mapData, DataNode data, object valueInstance)
{
dataType.OnDeserialize (serCtx, mapData, data, valueInstance);
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:4,代码来源:DataSerializer.cs
示例12: CreateConfigurationData
public object CreateConfigurationData (SerializationContext serCtx, Type type, DataNode data)
{
DataType dataType = GetConfigurationDataType (type);
return dataType.CreateInstance (serCtx, data);
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:5,代码来源:DataContext.cs
示例13: LoadConfigurationData
public object LoadConfigurationData (SerializationContext serCtx, Type type, DataNode data)
{
DataType dataType = GetConfigurationDataType (type);
return dataType.Deserialize (serCtx, null, data);
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:5,代码来源:DataContext.cs
示例14: OnDeserialize
internal void OnDeserialize (SerializationContext serCtx, DataNode data, object valueInstance)
{
dataType.Deserialize (serCtx, mapData, data, valueInstance);
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:4,代码来源:ItemProperty.cs
示例15: WriteChild
protected virtual void WriteChild (XmlElement elem, DataNode data)
{
elem.AppendChild (GetChildWriter (data).Write (elem.OwnerDocument, data));
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:4,代码来源:XmlDataSerializer.cs
示例16: Deserialize
public object Deserialize (Type type, DataNode data)
{
return dataContext.LoadConfigurationData (serializationContext, type, data);
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:4,代码来源:DataSerializer.cs
示例17: OnDeserialize
internal protected override object OnDeserialize (SerializationContext serCtx, object mdata, DataNode data)
{
object col = Activator.CreateInstance (ValueType);
Deserialize (serCtx, mdata, data, col);
return col;
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:6,代码来源:DictionaryDataType.cs
示例18: Write
public void Write (XmlWriter writer, DataNode data)
{
if (data is DataValue)
writer.WriteElementString (data.Name, ((DataValue)data).Value);
else if (data is DataItem) {
writer.WriteStartElement (data.Name);
WriteAttributes (writer, (DataItem) data);
WriteChildren (writer, (DataItem) data);
writer.WriteEndElement ();
}
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:11,代码来源:XmlDataSerializer.cs
注:本文中的MonoDevelop.Core.Serialization.DataNode类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论