本文整理匯總了C#中System.Resources.ResXDataNode.DeepClone方法的典型用法代碼示例。如果您正苦於以下問題:C# ResXDataNode.DeepClone方法的具體用法?C# ResXDataNode.DeepClone怎麽用?C# ResXDataNode.DeepClone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Resources.ResXDataNode
的用法示例。
在下文中一共展示了ResXDataNode.DeepClone方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AddResource
/// <include file='doc\ResXResourceWriter.uex' path='docs/doc[@for="ResXResourceWriter.AddResource3"]/*' />
/// <devdoc>
/// Adds a string resource to the resources.
/// </devdoc>
public void AddResource(ResXDataNode node) {
// we're modifying the node as we're adding it to the resxwriter
// this is BAD, so we clone it. adding it to a writer doesnt change it
// we're messing with a copy
ResXDataNode nodeClone = node.DeepClone();
ResXFileRef fileRef = nodeClone.FileRef;
string modifiedBasePath = BasePath;
if (!String.IsNullOrEmpty(modifiedBasePath)) {
if (!(modifiedBasePath.EndsWith("\\")))
{
modifiedBasePath += "\\";
}
if (fileRef != null) {
fileRef.MakeFilePathRelative(modifiedBasePath);
}
}
DataNodeInfo info = nodeClone.GetDataNodeInfo();
AddDataRow(DataStr, info.Name, info.ValueData, info.TypeName, info.MimeType, info.Comment);
}
示例2: AddResource
public void AddResource(ResXDataNode node)
{
ResXDataNode node2 = node.DeepClone();
ResXFileRef fileRef = node2.FileRef;
string basePath = this.BasePath;
if (!string.IsNullOrEmpty(basePath))
{
if (!basePath.EndsWith(@"\"))
{
basePath = basePath + @"\";
}
if (fileRef != null)
{
fileRef.MakeFilePathRelative(basePath);
}
}
DataNodeInfo dataNodeInfo = node2.GetDataNodeInfo();
this.AddDataRow("data", dataNodeInfo.Name, dataNodeInfo.ValueData, dataNodeInfo.TypeName, dataNodeInfo.MimeType, dataNodeInfo.Comment);
}