public static StringConversions__ElementType[] ConvertStringToElementTypeArray(string e) { if (string.IsNullOrEmpty(e)) { return(null); } var xml = StringConversions.ConvertStringToXElement(e); //<array c="2"> // <i0>2</i0> // <i1>0</i1> //</array> //Console.WriteLine(new { xml }); var Length = int.Parse(xml.Attribute("c").Value); //Console.WriteLine(new { Length }); var y = new StringConversions__ElementType[Length]; for (int i = 0; i < Length; i++) { //Console.WriteLine(new { i }); y[i] = FromString(xml.Element("i" + i).Value); } return(y); }
public static List <StringConversions__ElementType> ConvertStringToListOfElementType(string e) { // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201405/20140517 // X:\jsc.svn\examples\javascript\UIAutomationEvents\UIAutomationEvents\Application.cs // X:\jsc.svn\examples\javascript\test\TestWebMethodTaskOfIEnumerable\TestWebMethodTaskOfIEnumerable\ApplicationWebService.cs //return ConvertStringToElementTypeArray(e).AsEnumerable(); #region return inline ConvertStringToElementTypeArray var xml = StringConversions.ConvertStringToXElement(e); //<array c="2"> // <i0>2</i0> // <i1>0</i1> //</array> //Console.WriteLine(new { xml }); var Length = int.Parse(xml.Attribute("c").Value); //Console.WriteLine(new { Length }); var y = new StringConversions__ElementType[Length]; for (int i = 0; i < Length; i++) { //Console.WriteLine(new { i }); y[i] = FromString(xml.Element("i" + i).Value); } return(y.ToList()); #endregion }
public static IEnumerable <StringConversions__ElementType> ConvertStringToElementTypeEnumerable(string e) { //Additional information: Attempt by method 'mscorlib.<02000005IEnumerable\+ConvertToString>.ConvertToString(System.Collections.Generic.IEnumerable`1<TestIEnumerableForService.foo>)' to access method '<>f__AnonymousType6`1<System.__Canon>..ctor(System.__Canon)' failed. // X:\jsc.svn\examples\javascript\Test\TestIEnumerableForService\TestIEnumerableForService\ApplicationWebService.cs //Console.WriteLine("enter ConvertStringToElementTypeEnumerable " + new { e }); //Console.WriteLine("enter ConvertStringToElementTypeEnumerable e:" + e); // X:\jsc.svn\examples\javascript\test\TestWebMethodTaskOfIEnumerable\TestWebMethodTaskOfIEnumerable\ApplicationWebService.cs //return ConvertStringToElementTypeArray(e).AsEnumerable(); #region return inline ConvertStringToElementTypeArray var xml = StringConversions.ConvertStringToXElement(e); // X:\jsc.svn\examples\javascript\Test\TestIEnumerableForService\TestIEnumerableForService\ApplicationWebService.cs if (xml == null) { return(null); } //<array c="2"> // <i0>2</i0> // <i1>0</i1> //</array> //Console.WriteLine(new { xml }); var Length = int.Parse(xml.Attribute("c").Value); //Console.WriteLine(new { Length }); var y = new StringConversions__ElementType[Length]; for (int i = 0; i < Length; i++) { //Console.WriteLine(new { i }); y[i] = FromString(xml.Element("i" + i).Value); } return(y.AsEnumerable()); #endregion }
public static StringConversions__ElementType[] ConvertStringToElementTypeArray(string e) { if (string.IsNullOrEmpty(e)) return null; var xml = StringConversions.ConvertStringToXElement(e); //<array c="2"> // <i0>2</i0> // <i1>0</i1> //</array> //Console.WriteLine(new { xml }); var Length = int.Parse(xml.Attribute("c").Value); //Console.WriteLine(new { Length }); var y = new StringConversions__ElementType[Length]; for (int i = 0; i < Length; i++) { //Console.WriteLine(new { i }); y[i] = FromString(xml.Element("i" + i).Value); } return y; }
public static List<StringConversions__ElementType> ConvertStringToListOfElementType(string e) { // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201405/20140517 // X:\jsc.svn\examples\javascript\UIAutomationEvents\UIAutomationEvents\Application.cs // X:\jsc.svn\examples\javascript\test\TestWebMethodTaskOfIEnumerable\TestWebMethodTaskOfIEnumerable\ApplicationWebService.cs //return ConvertStringToElementTypeArray(e).AsEnumerable(); #region return inline ConvertStringToElementTypeArray var xml = StringConversions.ConvertStringToXElement(e); //<array c="2"> // <i0>2</i0> // <i1>0</i1> //</array> //Console.WriteLine(new { xml }); var Length = int.Parse(xml.Attribute("c").Value); //Console.WriteLine(new { Length }); var y = new StringConversions__ElementType[Length]; for (int i = 0; i < Length; i++) { //Console.WriteLine(new { i }); y[i] = FromString(xml.Element("i" + i).Value); } return y.ToList(); #endregion }
public static string ToString(StringConversions__ElementType e) { throw new NotSupportedException(); }
public static IEnumerable<StringConversions__ElementType> ConvertStringToElementTypeEnumerable(string e) { //Additional information: Attempt by method 'mscorlib.<02000005IEnumerable\+ConvertToString>.ConvertToString(System.Collections.Generic.IEnumerable`1<TestIEnumerableForService.foo>)' to access method '<>f__AnonymousType6`1<System.__Canon>..ctor(System.__Canon)' failed. // X:\jsc.svn\examples\javascript\Test\TestIEnumerableForService\TestIEnumerableForService\ApplicationWebService.cs //Console.WriteLine("enter ConvertStringToElementTypeEnumerable " + new { e }); //Console.WriteLine("enter ConvertStringToElementTypeEnumerable e:" + e); // X:\jsc.svn\examples\javascript\test\TestWebMethodTaskOfIEnumerable\TestWebMethodTaskOfIEnumerable\ApplicationWebService.cs //return ConvertStringToElementTypeArray(e).AsEnumerable(); #region return inline ConvertStringToElementTypeArray var xml = StringConversions.ConvertStringToXElement(e); // X:\jsc.svn\examples\javascript\Test\TestIEnumerableForService\TestIEnumerableForService\ApplicationWebService.cs if (xml == null) return null; //<array c="2"> // <i0>2</i0> // <i1>0</i1> //</array> //Console.WriteLine(new { xml }); var Length = int.Parse(xml.Attribute("c").Value); //Console.WriteLine(new { Length }); var y = new StringConversions__ElementType[Length]; for (int i = 0; i < Length; i++) { //Console.WriteLine(new { i }); y[i] = FromString(xml.Element("i" + i).Value); } return y.AsEnumerable(); #endregion }
public static string ConvertElementTypeArrayToString(StringConversions__ElementType[] e) { //Unable to cast object of type 'System.Int32[]' to type 'System.Object[]'. //Console.WriteLine("enter ConvertElementTypeArrayToString"); if (e == null) return null; //var o = (object[])e; var xml = new XElement("array"); var Length = e.Length; xml.Add(new XAttribute("c", "" + Length)); for (int i = 0; i < Length; i++) { // ldelem.ref ? var item = e[i]; // [MethodAccessException: Attempt by method 'mscorlib.<020000f3Array\+ConvertToString>.ConvertToString(Int32[])' to access method '<>f__AnonymousType4d`2<System.Int32,System.__Canon>..ctor(Int32, System.__Canon)' failed.] //mscorlib.<020000f3Array\+ConvertToString>.ConvertToString(Int32[] ) +305 //Console.WriteLine("i: " + i + ", item: " + item); xml.Add(new XElement("i" + i, ToString((StringConversions__ElementType)item))); } var value = StringConversions.ConvertXElementToString(xml); //Console.WriteLine("value: " + value); return value; }
public static string ToString(StringConversions__ElementType e) { throw new NotSupportedException(); }