當前位置: 首頁>>代碼示例>>C#>>正文


C# Serialization.DataNode類代碼示例

本文整理匯總了C#中MonoDevelop.Core.Serialization.DataNode的典型用法代碼示例。如果您正苦於以下問題:C# DataNode類的具體用法?C# DataNode怎麽用?C# DataNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DataNode類屬於MonoDevelop.Core.Serialization命名空間,在下文中一共展示了DataNode類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的MonoDevelop.Core.Serialization.DataNode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。