private int readGroup(string[] lines, List <SAMP> list) { int group_start = find_line(lines, "\"GROUP\",\"SAMP\""); if (group_start == NOT_FOUND) { return(-1); } string[] header = lines[group_start + 1].QuoteSplit(); string[] units = lines[group_start + 2].QuoteSplit(); string[] type = lines[group_start + 3].QuoteSplit(); addUNITS(units); addTYPES(type); for (int i = group_start + 4; i < lines.Count(); i++) { string line = lines[i]; if (line.Length == 0) { return(i); } string[] values = line.QuoteSplit(); SAMP s = new SAMP(); setValues(header, values, s); list.Add(s); } return(0); }
private void metroTileItem1_Click(object sender, EventArgs e) { try { SAMP.StartGame(GigSpace.GTA_HOST, GigSpace.GTA_PORT, GigSpace.Client.MyAccount.Username, GigSpace.GTA_PASSWORD); } catch { } }
private List <SAMP> getFirsts(List <SAMP> list, string[] distinct) { List <SAMP> newList = new List <SAMP>(); foreach (string s in distinct) { SAMP first = list.Where(el => el.SAMP_ID == s).First(); newList.Add(first); } return(newList); }
private int setValues(string[] header, string[] values, SAMP p) { try { for (int i = 0; i < header.Count(); i++) { if (header[i] == "LOCA_ID" && values[i] != "") { p.PointID = values[i]; } if (header[i] == "SAMP_TOP" && values[i] != "") { p.Depth = Convert.ToDouble(values[i]); } if (header[i] == "SAMP_REF" && values[i] != "") { p.SAMP_REF = values[i]; } if (header[i] == "SAMP_TYPE" && values[i] != "") { p.SAMP_TYPE = values[i]; } if (header[i] == "SAMP_ID" && values[i] != "") { p.SAMP_ID = values[i]; } if (header[i] == "SAMP_BASE" && values[i] != "") { p.SAMP_BASE = Convert.ToDouble(values[i]); } if (header[i] == "SAMP_LINK" && values[i] != "") { p.SAMP_LINK = values[i]; } if (header[i] == "SAMP_DTIM" && values[i] != "") { p.SAMP_DTIM = Convert.ToDateTime(values[i]); } if (header[i] == "SAMP_UBLO" && values[i] != "") { p.SAMP_UBLO = Convert.ToInt16(values[i]); } if (header[i] == "SAMP_CONT" && values[i] != "") { p.SAMP_CONT = values[i]; } if (header[i] == "SAMP_PREP" && values[i] != "") { p.SAMP_PREP = values[i]; } if (header[i] == "SAMP_SDIA" && values[i] != "") { p.SAMP_SDIA = values[i]; } if (header[i] == "SAMP_WDEP" && values[i] != "") { p.SAMP_WDEP = Convert.ToDouble(values[i]); } if (header[i] == "SAMP_RECV" && values[i] != "") { p.SAMP_RECV = Convert.ToInt16(values[i]); } if (header[i] == "SAMP_TECH" && values[i] != "") { p.SAMP_TECH = values[i]; } if (header[i] == "SAMP_MATX" && values[i] != "") { p.SAMP_MATX = values[i]; } if (header[i] == "SAMP_TYPC" && values[i] != "") { p.SAMP_TYPC = values[i]; } if (header[i] == "SAMP_WHO" && values[i] != "") { p.SAMP_WHO = values[i]; } if (header[i] == "SAMP_WHY" && values[i] != "") { p.SAMP_WHY = values[i]; } if (header[i] == "SAMP_DESC" && values[i] != "") { p.SAMP_DESC = values[i]; } if (header[i] == "SAMP_DESD" && values[i] != "") { p.SAMP_DESD = Convert.ToDateTime(values[i]); } if (header[i] == "SAMP_LOG" && values[i] != "") { p.SAMP_LOG = values[i]; } if (header[i] == "SAMP_COND" && values[i] != "") { p.SAMP_COND = values[i]; } if (header[i] == "SAMP_CLSS" && values[i] != "") { p.SAMP_CLSS = values[i]; } if (header[i] == "SAMP_BAR" && values[i] != "") { p.SAMP_BAR = Convert.ToDouble(values[i]); } if (header[i] == "SAMP_TEMP" && values[i] != "") { p.SAMP_TEMP = Convert.ToInt16(values[i]); } if (header[i] == "SAMP_PRES" && values[i] != "") { p.SAMP_PRES = Convert.ToDouble(values[i]); } if (header[i] == "SAMP_FLOW" && values[i] != "") { p.SAMP_FLOW = Convert.ToDouble(values[i]); } if (header[i] == "SAMP_ETIM" && values[i] != "") { p.SAMP_ETIM = Convert.ToDateTime(values[i]); } if (header[i] == "SAMP_DURN" && values[i] != "") { p.SAMP_DURN = Convert.ToInt16(values[i]); } if (header[i] == "SAMP_CAPT" && values[i] != "") { p.SAMP_CAPT = values[i]; } if (header[i] == "GEOL_STAT" && values[i] != "") { p.GEOL_STAT = values[i]; } if (header[i] == "SAMP_RECL" && values[i] != "") { p.SAMP_RECL = values[i]; } if (header[i] == "FILE_FSET" && values[i] != "") { p.FILE_FSET = values[i]; } } } catch { return(-1); } return(0); }