private DateTimeFormat(DateTimeFormatTypes dateTimeFormatTypes) { Name = "user defined"; TypeId = -1; Example = ""; _formatTypes = dateTimeFormatTypes; }
internal DateTimeFormat(DateTimeFormatTypes dateTimeFormatTypes, XmlElement xmlElement) { Name = xmlElement.GetAttributeValue("name"); TypeId = int.Parse(xmlElement.GetAttributeValue("type")); Example = xmlElement.GetAttributeValue("example"); _formatTypes = dateTimeFormatTypes; }
private XmlNodeList GetFormatsOfSingleType(DateTimeFormatTypes types) { const string LOAD_TIME_FORMATS = @"<TEMPLATE><ELEMENT action=""load"" ><{0}FORMATS action=""list"" lcid=""{1}""/></ELEMENT></TEMPLATE>"; string formatTypeString = types.ToString().ToUpper(); XmlDocument result = _session.ExecuteRQL(string.Format(LOAD_TIME_FORMATS, formatTypeString, LCID), RQL.IODataFormat.SessionKeyAndLogonGuid); var timeformats = result.GetElementsByTagName(formatTypeString + "FORMATS")[0] as XmlElement; if (timeformats == null) { var e = new Exception("could not load timeformats for lcid '" + LCID + "'"); e.Data.Add("result", result); throw e; } string answerElementsName = types == DateTimeFormatTypes.Time ? "TIMEFORMAT" : "DATEFORMAT"; return(timeformats.GetElementsByTagName(answerElementsName)); }
private XmlNodeList GetFormatsOfSingleType(DateTimeFormatTypes types) { const string LOAD_TIME_FORMATS = @"<TEMPLATE><ELEMENT action=""load"" ><{0}FORMATS action=""list"" lcid=""{1}""/></ELEMENT></TEMPLATE>"; string formatTypeString = types.ToString().ToUpper(); XmlDocument result = _session.ExecuteRQL(string.Format(LOAD_TIME_FORMATS, formatTypeString, LCID), RQL.IODataFormat.SessionKeyAndLogonGuid); var timeformats = result.GetElementsByTagName(formatTypeString + "FORMATS")[0] as XmlElement; if (timeformats == null) { var e = new Exception("could not load timeformats for lcid '" + LCID + "'"); e.Data.Add("result", result); throw e; } string answerElementsName = types == DateTimeFormatTypes.Time ? "TIMEFORMAT" : "DATEFORMAT"; return timeformats.GetElementsByTagName(answerElementsName); }