/// <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); }
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); }