本文整理汇总了C#中Constants.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Constants.Equals方法的具体用法?C# Constants.Equals怎么用?C# Constants.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constants
的用法示例。
在下文中一共展示了Constants.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateLanguageXMLFile
/// <summary>
/// Used to Generate XML files
/// </summary>
/// <param name="DtXMlData">datatable containing data for creating xml file</param>
/// <param name="XmlFileType">Type of XML file--srec of destination</param>
private string GenerateLanguageXMLFile(DataTable DtXMlData, Constants.CreateXmlFor XMLFileType)
{
XmlDocument XMLDoc = new XmlDocument();
string FileName = string.Empty;
string XmlFilePath = string.Empty;
XmlElement ChildNode;
string TemplateFilePath = string.Empty;
string RetVal = string.Empty;
bool IsTemplateCreated = false;
if (XMLFileType.Equals(Constants.CreateXmlFor.SrcXmlFile))
{
FileName = DtXMlData.Columns[1].ColumnName;
}
else
{
FileName = DtXMlData.Columns[2].ColumnName;
}
FileName = FileName.Replace("(", "[").Replace(")", "]");
XmlFilePath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath,
Constants.FolderName.MasterKeyVals, FileName) + ".xml";
if (File.Exists(XmlFilePath))
{
CreateBackUpFile(XmlFilePath, FileName);
// Check if template xml file exist
TemplateFilePath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.LanguageTemplate, Constants.FileName.LanguageXMLTemplate);
if (File.Exists(TemplateFilePath))
{
// Create XML file template
IsTemplateCreated = CreateXMLFromTemplate(FileName);
// If XML template created
if (IsTemplateCreated)
{
// Create Doc Type
XMLDoc.Load(XmlFilePath);
for (int Jcount = 1; Jcount < DtXMlData.Rows.Count; Jcount++)
{
//create child noods
ChildNode = XMLDoc.CreateElement("Row");
//Set attribute name and value!
ChildNode.SetAttribute("key", DtXMlData.Rows[Jcount][0].ToString());
if (XMLFileType.Equals(Constants.CreateXmlFor.SrcXmlFile))
{
ChildNode.SetAttribute("value", DtXMlData.Rows[Jcount][1].ToString());
}
else
{
ChildNode.SetAttribute("value", DtXMlData.Rows[Jcount][2].ToString());
}
XMLDoc.DocumentElement.AppendChild(ChildNode);
}
XMLDoc.Save(XmlFilePath);
RetVal = "true";
}
else
{
RetVal = "false" + Constants.Delimiters.ParamDelimiter + Constants.XLSImportMessage.ErrorCreateXMLTemplate.ToString();
}
}
else
{
RetVal = "false" + Constants.Delimiters.ParamDelimiter + Constants.XLSImportMessage.XMLTempNotExist.ToString();
}
}
else
{
RetVal = "false" + Constants.Delimiters.ParamDelimiter + Constants.XLSImportMessage.LanguageNotExist.ToString();
}
return RetVal;
}