示例#1
0
            public GPSlocation(string storedGPS)
            {
                // "<Origin^{X:0 Y:0 Z:0}^OriginType:Stationary$OriginComm:none>"

                System.Text.RegularExpressions.MatchCollection matches = StoreFormat.Matches(storedGPS); //storeGPS.Split('^');
                string[] attr = new string[matches.Count];
                matches.CopyTo(attr, 0);

                // Name
                name = attr[0];

                // GPS
                gps = recoverGPS(attr[1]);

                // Custom Info
                if (attr.Length == 3)
                {
                    string[] customAttr = attr[2].Split('$');
                    foreach (string str in customAttr)
                    {
                        str.Trim(' ');
                        if (str.Length > 3 || str != "")
                        {
                            //string strTest = str.Trim(new Char[]'>');
                            string[] temp = str.Split(':');
                            try
                            {
                                customInfo.Add(temp[0], temp[1]);
                            }
                            catch (Exception e)
                            {
                                eventLog += String.Format("Error Adding: {3}\r\n \tKey: {0}\r\n \tValue: {1}\r\n \r\n Stack Trace:\r\n{2}\r\n", temp[0], "value", e.ToString(), str);
                            }
                        }
                    }
                }
            }
        static int _m_CopyTo(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                System.Text.RegularExpressions.MatchCollection gen_to_be_invoked = (System.Text.RegularExpressions.MatchCollection)translator.FastGetCSObj(L, 1);



                {
                    System.Array _array      = (System.Array)translator.GetObject(L, 2, typeof(System.Array));
                    int          _arrayIndex = LuaAPI.xlua_tointeger(L, 3);

                    gen_to_be_invoked.CopyTo(_array, _arrayIndex);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }