/// <summary> /// Processing for {data} format. supported Autodata or Culture. /// </summary> /// <param name="szspecialvalue"></param> /// <param name="varnode"></param> /// <returns></returns> static internal string DeriveSpecialValues(string szspecialvalue, XmlNode varnode) { if (IsSpecialValue(szspecialvalue) == false) { return(null); } int index = szspecialvalue.IndexOf('{'); string leftsidevalue = szspecialvalue.Substring(0, index); string rightsidevalue = szspecialvalue.Substring(szspecialvalue.IndexOf('}', index + 1) + 1); szspecialvalue = szspecialvalue.Substring(index + 1, szspecialvalue.IndexOf('}') - (index + 1)); //szspecialvalue = szspecialvalue.Substring(1, szspecialvalue.Length - 2); index = szspecialvalue.IndexOf('['); if (index < 0) { index = szspecialvalue.IndexOf(':'); } string loadtype = null; if (index >= 0) { loadtype = szspecialvalue.Substring(0, index); szspecialvalue = szspecialvalue.Substring(index); } else { loadtype = szspecialvalue; szspecialvalue = null; } switch (loadtype.ToLowerInvariant()) { case "autodata": AutoDataHelper adhautodatainfo = new AutoDataHelper(); loadtype = adhautodatainfo.DeriveAutoDataInformation(szspecialvalue, varnode); FileModified = adhautodatainfo.Isdirty; adhautodatainfo = null; break; case "culture": AutoDataHelper adhautoculture = new AutoDataHelper(); loadtype = adhautoculture.GetCurrentCultureName(szspecialvalue, varnode); FileModified = adhautoculture.Isdirty; adhautoculture = null; break; case "differentculture": AutoDataHelper adhdiffculture = new AutoDataHelper(); loadtype = adhdiffculture.GetDifferentCultureName(); FileModified = adhdiffculture.Isdirty; adhdiffculture = null; break; case "invalidculture": AutoDataHelper adhinvalidculture = new AutoDataHelper(); loadtype = adhinvalidculture.GetInvalidCultureName(); FileModified = adhinvalidculture.Isdirty; adhinvalidculture = null; break; case "generatedfile": GeneratedFilesHelper gfhfilename = new GeneratedFilesHelper(); loadtype = gfhfilename.GetGeneratedFileName(szspecialvalue, varnode); gfhfilename = null; break; case "generatedassembly": GeneratedFilesHelper gfhassembly = new GeneratedFilesHelper(); loadtype = gfhassembly.GetGeneratedAssembly(szspecialvalue, varnode); gfhassembly = null; break; case "version": VersionHelper vh = new VersionHelper(); loadtype = vh.GetVersionInfo(szspecialvalue); vh = null; break; default: return(null); } return(leftsidevalue + loadtype + rightsidevalue); //innertext = AutoData.Extract.GetTestString( Convert.ToInt16(innertext), ScriptTypeEnum.Arabic, 20, false); //return true; }
/// <summary> /// Get Culture name from Language. Example Arabic = ar /// </summary> /// <param name="culturename"></param> /// <param name="varnode"></param> /// <returns></returns> public static string GetCultureName(string culturename, XmlNode varnode) { AutoDataHelper adh = new AutoDataHelper(); return(adh.GetCurrentCultureName(culturename, varnode)); }