本文整理汇总了C#中System.Resources.ResXDataNode.GetDataNodeInfo方法的典型用法代码示例。如果您正苦于以下问题:C# ResXDataNode.GetDataNodeInfo方法的具体用法?C# ResXDataNode.GetDataNodeInfo怎么用?C# ResXDataNode.GetDataNodeInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Resources.ResXDataNode
的用法示例。
在下文中一共展示了ResXDataNode.GetDataNodeInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddDataRow
/// <devdoc>
/// Adds a resource to the resources. If the resource is a string,
/// it will be saved that way, otherwise it will be serialized
/// and stored as in binary.
/// </devdoc>
private void AddDataRow(string elementName, string name, object value) {
Debug.WriteLineIf(ResValueProviderSwitch.TraceVerbose, " resx: adding resource " + name);
if (value is string) {
AddDataRow(elementName, name, (string)value);
}
else if (value is byte[]) {
AddDataRow(elementName, name, (byte[])value);
}
else if(value is ResXFileRef) {
ResXFileRef fileRef = (ResXFileRef)value;
ResXDataNode node = new ResXDataNode(name, fileRef, this.typeNameConverter);
if (fileRef != null) {
fileRef.MakeFilePathRelative(BasePath);
}
DataNodeInfo info = node.GetDataNodeInfo();
AddDataRow(elementName, info.Name, info.ValueData, info.TypeName, info.MimeType, info.Comment);
} else {
ResXDataNode node = new ResXDataNode(name, value, this.typeNameConverter);
DataNodeInfo info = node.GetDataNodeInfo();
AddDataRow(elementName, info.Name, info.ValueData, info.TypeName, info.MimeType, info.Comment);
}
}
示例2: AddDataRow
private void AddDataRow(string elementName, string name, object value)
{
if (value is string)
{
this.AddDataRow(elementName, name, (string) value);
}
else if (value is byte[])
{
this.AddDataRow(elementName, name, (byte[]) value);
}
else if (value is ResXFileRef)
{
ResXFileRef fileRef = (ResXFileRef) value;
ResXDataNode node = new ResXDataNode(name, fileRef, this.typeNameConverter);
if (fileRef != null)
{
fileRef.MakeFilePathRelative(this.BasePath);
}
DataNodeInfo dataNodeInfo = node.GetDataNodeInfo();
this.AddDataRow(elementName, dataNodeInfo.Name, dataNodeInfo.ValueData, dataNodeInfo.TypeName, dataNodeInfo.MimeType, dataNodeInfo.Comment);
}
else
{
DataNodeInfo info2 = new ResXDataNode(name, value, this.typeNameConverter).GetDataNodeInfo();
this.AddDataRow(elementName, info2.Name, info2.ValueData, info2.TypeName, info2.MimeType, info2.Comment);
}
}