protected void PersistEntities <T, U>(Connection connection, Guid projectId, CSVFile file, string dtype = "") where T : BaseEntity where U : BaseDto { if (file == null) { return; } List <T> entities = new List <T>(); CSVRow header = file.GetHeader(); foreach (CSVRow row in file.GetValues()) { CSVValue dtypeValue = file.GetValueToColumn(row, "DTYPE"); if (dtypeValue != null && !string.IsNullOrEmpty(dtype)) { if (!dtype.Equals(dtypeValue.GetValue())) { continue; } } entities.Add(CreateEntity <T, U>(file, row, projectId)); } GenericRepository genericRepository = new GenericRepository(connection); genericRepository.PersistAsNews <T>(entities); }
public DarwinData(CSVRow rowofdata) { foreach (PropertyInfo propertyInfo in PropertyMap.Values) { propertyInfo.SetValue(this, rowofdata[PropertyToColumnHeader[propertyInfo.Name]]); } }
private static AzureBenchmarkResult PrepareBenchmarkResult(CSVRow r, AzureExperimentStorage storage, ConcurrentDictionary <string, string> uploadedOutputs, int expId, DateTime submittedTime) { var properties = new Dictionary <string, string>() { { "SAT", r.SAT.ToString() }, { "UNSAT", r.UNSAT.ToString() }, { "UNKNOWN", r.UNKNOWN.ToString() }, { "TargetSAT", r.TargetSAT.ToString() }, { "TargetUNSAT", r.TargetUNSAT.ToString() }, { "TargetUNKNOWN", r.TargetUNKNOWN.ToString() }, }; var b = new AzureBenchmarkResult { AcquireTime = submittedTime, BenchmarkFileName = r.Filename.Replace('\\', '/'), ExitCode = r.ReturnValue, ExperimentID = expId, NormalizedRuntime = r.Runtime, PeakMemorySizeMB = 0, Properties = properties, Status = ResultCodeToStatus(r.ResultCode), StdErr = r.StdErr, StdOut = r.StdOut, StdErrExtStorageIdx = "", StdOutExtStorageIdx = "", TotalProcessorTime = TimeSpan.FromSeconds(r.Runtime), WallClockTime = TimeSpan.FromSeconds(r.Runtime), }; return(b); }
public static CSVRow[] ReadItemData(string employeesListContent) { List <CSVRow> itemListResult = new List <CSVRow>(); var itemList = employeesListContent.Split(Environment.NewLine); for (int itemIndex = 0; itemIndex < itemList.Length; itemIndex++) { var itemVal = itemList[itemIndex]; if (!string.IsNullOrEmpty(itemVal) && !string.IsNullOrWhiteSpace(itemVal)) { var partitionKey = Guid.NewGuid().ToString(); CSVRow item = null; if (itemIndex == 0) { item = new CSVRow { id = partitionKey, pk = partitionKey, Value = itemVal }; } else { item = new CSVRow { id = partitionKey, pk = partitionKey, Value = itemVal }; } itemListResult.Add(item); } } return(itemListResult.ToArray()); }
public static void LoadData(Data obj, Type objectType, CSVRow row) { foreach (var prop in objectType.GetProperties()) { if (prop.PropertyType.IsGenericType) { var listType = typeof(List <>); var genericArgs = prop.PropertyType.GetGenericArguments(); var concreteType = listType.MakeGenericType(genericArgs); var newList = Activator.CreateInstance(concreteType); var add = concreteType.GetMethod("Add"); var indexerName = ((DefaultMemberAttribute) newList.GetType().GetCustomAttributes(typeof(DefaultMemberAttribute), true)[0]).MemberName; var indexerProp = newList.GetType().GetProperty(indexerName); for (var i = row.GetRowOffset(); i < row.GetRowOffset() + row.GetArraySize(prop.Name); i++) { var v = row.GetValue(prop.Name, i - row.GetRowOffset()); if (v == string.Empty && i != row.GetRowOffset()) { v = indexerProp.GetValue(newList, new object[] { i - row.GetRowOffset() - 1 }).ToString(); } if (v == string.Empty) { var o = genericArgs[0].IsValueType ? Activator.CreateInstance(genericArgs[0]) : ""; add.Invoke(newList, new[] { o }); } else { add.Invoke(newList, new[] { Convert.ChangeType(v, genericArgs[0]) }); } } prop.SetValue(obj, newList); } else { if (row.GetValue(prop.Name, 0) == string.Empty) { prop.SetValue(obj, null, null); } else { prop.SetValue(obj, Convert.ChangeType(row.GetValue(prop.Name, 0), prop.PropertyType), null); } } } }
public static void skinUpdate(int pID, Transform pParent) { CSVRow lRow = RoleInfoTable.isUseSkin(pID); if (lRow != null) { //需要换肤 string skinName = RoleInfoTable.GetSkin(lRow); string skinNode = lRow.GetString("skinNode"); changeSkin(pParent.transform, skinNode, skinName); } }
public LogicData(CSVRow row, LogicDataTable table) { this.m_row = row; this.m_table = table; this.m_globalId = GlobalID.CreateGlobalID((int)table.GetTableIndex() + 1, table.GetItemCount()); this.m_tidIndex = -1; this.m_infoTidIndex = -1; this.m_iconSWFIndex = -1; this.m_iconExportNameIndex = -1; }
public static string GetSkin(CSVRow lRow) { string res = ""; string lPath = ""; string lSkinName = ""; // = GetRowFromID(pID); lPath = lRow.GetString("resPath"); lSkinName = lRow.GetString("skinName"); res = lPath + "/" + lSkinName; return(res); }
private bool EvalAsAtom(CSVRow row) { switch (castAs) { default: switch (aRelation) { case '=': return(row.GetEntry(fieldName).Equals(fieldValue)); case '<': return(row.GetEntry(fieldName).CompareTo(fieldValue) < 0); case '>': return(row.GetEntry(fieldName).CompareTo(fieldValue) > 0); case '#': return(row.GetEntry(fieldName).StartsWith(fieldValue)); default: return(false); } case 'd': DateTime d1, d2; if (!DateTime.TryParse(GetFinalDateIfEmpty(row.GetEntry(fieldName)), out d1)) { throw new Exception(string.Format( "Unable to parse {0} as date!", row.GetEntry(fieldName))); } if (!DateTime.TryParse(GetFinalDateIfEmpty(fieldValue), out d2)) { throw new Exception(string.Format( "Unable to parse {0} as date!", fieldValue)); } switch (aRelation) { case '=': return(d1 == d2); case '<': return(d1 < d2); case '>': return(d1 > d2); default: return(false); } } }
//根据id值,返回特定字段的值,需给返回默认值 public T GetValueFromID <T>(int id, string valName, T defVal) { CSVRow tmpRoleID = GetRowFromID(id); T outVal = defVal; if (tmpRoleID != null) { outVal = tmpRoleID.GetVal <T>(valName, defVal); } return(outVal); }
public CSVData Read() { var list = new CSVData(); //declare dictionary listion var lines = Regex.Split(Payload, LINE_SPLIT_RE); // Split data.text into lines using LINE_SPLIT_RE characters if (lines.Length <= 1) { return(list); //Check that there is more than one line } var header = Regex.Split(lines[0], SPLIT_RE); //Split header (element 0) // Loops through lines for (var i = 1; i < lines.Length; i++) { var values = Regex.Split(lines[i], SPLIT_RE); //Split lines according to SPLIT_RE, store in var (usually string array) if (values.Length == 0 || values[0] == "") { continue; // Skip to end of loop (continue) if value is 0 length OR first value is empty } var entry = new CSVRow(); // Creates dictionary object // Loops through every value for (var j = 0; j < header.Length && j < values.Length; j++) { string value = values[j]; // Set local variable value value = value.TrimStart(TRIM_CHARS).TrimEnd(TRIM_CHARS).Replace("\\", ""); // Trim characters object finalvalue = value; //set final value int n; // Create int, to hold value if int float f; // Create float, to hold value if float // If-else to attempt to parse value into int or float if (int.TryParse(value, out n)) { finalvalue = n; } else if (int.TryParse(value, System.Globalization.NumberStyles.HexNumber, new CultureInfo("en-US"), out n)) { finalvalue = n; } else if (float.TryParse(value, out f)) { finalvalue = f; } entry[header[j]] = finalvalue; } list.Add(entry); // Add Dictionary ("entry" variable) to list } return(list); //Return list }
public static CSVRow isUseSkin(int pID) { CSVRow isUse = null; CSVRow lRow = GetRowFromID(pID); string l1 = lRow.GetString("skinNode"); string l2 = lRow.GetString("skinName"); if ((l1 != "") && (l2 != "")) { isUse = lRow; } return(isUse); }
public void Execute(CSVRow row) { Dictionary <string, string> vars = new Dictionary <string, string>(); if (query.Eval(row)) { trueAction.Act(row, vars); } else { falseAction.Act(row, vars); } }
private void WriteRow(CSVRow row) { if (row.Count == 0) { return; } WriteField(row[0]); for (int i = 1; i < row.Count; ++i) { Write(clDelimiter); WriteField(row[i]); } }
public void keyInit(CSVRow pCsvRow) { CSVColumnNameIndexer tmpIndex = pCsvRow.GetCSVColumnNameIndexer(); List <string> nameLst = tmpIndex.getColDicLst(); mKeyNameLst = new List <CsvKeyName>(); int nCount = nameLst.Count; for (int i = 0; i < nCount; i++) { string nameVal = nameLst[i]; CsvKeyName tmpKeyName = new CsvKeyName(); tmpKeyName.keyName = nameVal; // tmpKeyName.keyVal = pCsvRow.GetString(nameVal); } }
public CSVRow ReadRow() { CSVRow row = new CSVRow(); int c; string s = ""; bool inEnclosure = false; while ((c = Read()) != -1) { if (inEnclosure) { if (c == clEnclosure) { inEnclosure = false; } else { s += (char)c; } } else { if (c == clEnclosure) { inEnclosure = true; } else if (c == clDelimiter) { row.Add(s); s = ""; } else if (c == (int)'\n') { break; } } } if (inEnclosure) { throw new Exception("Unerwartetes Datei-Ende"); } row.Add(s); return(row); }
//根据key字段及key字段的值,返回val字段的值,需给val默认值, //key只支持整型,string,浮点型 public T GetKeyValueFromID <K, T>(string keyName, K keyVal, string valName, T defVal) { T res = defVal; for (int i = 0; i < m_elements.Count; ++i) { K keyDefVal = (K)Convert.ChangeType("0", typeof(K)); K tmpKey = m_elements[i].GetVal <K>(keyName, keyDefVal); if (tmpKey.Equals(keyVal)) { CSVRow tmpRow = m_elements[i]; res = tmpRow.GetVal(valName, defVal); break; } } return(res); }
//UI调用 public void UISelID() { int tempID = int.Parse(textID.text.Trim()); CSVRow tmpRow = StoryRelationTab._instance().GetRowFromID(tempID); if (tmpRow != null) { textNextID.text = tmpRow.GetString(StoryRelationTab.csNextID); uiEffect.value = tmpRow.GetInt(StoryRelationTab.csUISort); roleSay.value = tmpRow.GetInt(StoryRelationTab.csIsRoleSay); BgChange.value = tmpRow.GetInt(StoryRelationTab.csNeedChangeBg); isAutoSave.value = tmpRow.GetInt(StoryRelationTab.csIsAutoSave); isKeyOption.value = tmpRow.GetInt(StoryRelationTab.csIsKeySave); textCn.text = tmpRow.GetString(StoryRelationTab.csContentCN); textEn.text = tmpRow.GetString(StoryRelationTab.csContentEn); } }
public void UICheckNextID() { int tempNextID = int.Parse(textNextID.text.Trim()); CSVRow tmpRow = StoryRelationTab._instance().GetRowFromID(tempNextID); if (tmpRow != null) { //nextID检测通过 checkNextIDObj.text = csNextIDExist; checkNextIDObj.color = new Color(0, 0, 0); } else { checkNextIDObj.text = csNextIDNotExist; checkNextIDObj.color = new Color(255, 0, 0); } checkNextIDObj.gameObject.SetActive(true); }
private bool checkKeyNameExists(CSVRow lRow) { bool isPass = true; for (int i = 0; i < m_colomuns.Count; i++) { string tmpKeyName = m_colomuns[i]; bool isExists = lRow.Exist(tmpKeyName); if (isExists == false) { UnityEngine.Debug.LogError("checkKeyNameExists Columns not tmpKeyName"); isPass = false; } } return(isPass); }
public static string GetPrefab(int pID) { string res = ""; string lPath = ""; string lPreName = ""; CSVRow lRow = GetRowFromID(pID); lPath = lRow.GetString("resPath"); lPreName = lRow.GetString("Pre"); res = lPath + "/" + lPreName; /* * bool b1 = GetKeyString("ID",pID.ToString(), "resPath",out lPath); * bool b2 = GetKeyString("ID", pID.ToString(), "Pre", out lPreName); * if (b1 && b2) { * res = lPath + "/" + lPreName; * }*/ return(res); }
public bool Eval(CSVRow row) { switch (type) { case ExpressionType.Atom: return(EvalAsAtom(row)); case ExpressionType.And: return(subExprs[0].Eval(row) && subExprs[1].Eval(row)); case ExpressionType.Or: return(subExprs[0].Eval(row) || subExprs[1].Eval(row)); case ExpressionType.Not: return(!subExprs[0].Eval(row)); default: return(true); } }
private const string csElement6 = "暗"; //purple,darkblue public void showData(int pRoleID, int pCost, Action pEvent) { //roleID用于展现UI callEvent = pEvent; RoleProTable.rolePro tmpPro = RoleProTable.GetFromRoleID(pRoleID); refreshData(tmpPro); //RoleInfoTable.roleElements tmpEle = RoleInfoTable.Get(pRoleID); //monText.text = tmpEle.Name; string tmpEleName = ""; CSVRow lRow = RoleInfoTable.GetRowFromID(pRoleID); tmpEleName = lRow.GetString("Name"); //RoleInfoTable.GetKeyString("ID", pRoleID.ToString(), "Name", out tmpEleName); monText.text = tmpEleName; roleID = pRoleID; cost = pCost; btnBuySet(); }
//显示剧情内容 public void showContentText(int nowStoryid) { storyID = nextStoryID; CSVRow tmpRow = StoryRelationTab._instance().GetRowFromID(nowStoryid); string msg = tmpRow.GetString(StoryRelationTab.csContentCN); ContentText.text = stringReplace(msg); //是否自动保存 int isAutoSave = tmpRow.GetInt(StoryRelationTab.csIsAutoSave); if (isAutoSave == 1) { autoSaveData.instance().saveData(storyID); } nextStoryID = tmpRow.GetInt(StoryRelationTab.csNextID); if (nextStoryID == 0) //出现选项的剧情 { showTalkSel(nowStoryid); } int tmpIsRoleSay = tmpRow.GetInt(StoryRelationTab.csIsRoleSay); if (tmpIsRoleSay == 1) //角色说的话 { //判断角色是否发生改变 } else //背景傍白 //角色头像是否要隐蔽 { } int tmpIsChangeBgScene = tmpRow.GetInt(StoryRelationTab.csNeedChangeBg); if (tmpIsChangeBgScene == 1) //场景需要切换 { showBgScene(nowStoryid); } }
public void Act(CSVRow row, Dictionary <string, string> vars) { switch (type) { case ExpressionType.Print : Console.WriteLine(row); break; case ExpressionType.Set: if (fieldValue.Length > 0 && fieldValue[0] == '$' && vars.ContainsKey(fieldValue.Substring(1))) { row.SetEntry(fieldName, vars[fieldValue.Substring(1)]); } else { row.SetEntry(fieldName, fieldValue); } break; case ExpressionType.Let: if (!vars.ContainsKey(fieldName)) { vars.Add(fieldName, ""); } if (row.Contains(fieldValue)) { vars[fieldName] = row.GetEntry(fieldValue); } else { vars[fieldName] = fieldValue; } break; } if (next != null) { next.Act(row, vars); } }
/// <summary> /// Create a unique resource identifier /// </summary> /// <param name="resourcePath"></param> /// <param name="row"></param> /// <returns></returns> private string GetBaseResourceId(string resourcePath, CSVRow row) { if (resourcePath.Contains("{RowNumber}")) { resourcePath = resourcePath.Replace("{RowNumber}", row.RowNumber.ToString("D4")); } foreach (var col in row) { if (resourcePath.Contains($"{{{col.ColumnName}}}")) { resourcePath = resourcePath.Replace($"{{{col.ColumnName}}}", col.Value); } } if (resourcePath.Contains("{{")) { throw new ResourceIdPathException(); } return(resourcePath); }
public CSVMatrix(string csvText) { string[] lines = csvText.Split(lineSeparator, System.StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < lines.Length; i++) { var entity = lines[i]; string line = entity.Trim(); CSVRow newRow = new CSVRow(line); rows.Add(newRow); if (Constants.Instance.Editor.VerifyData) { if (maxColumn != 0 && maxColumn != newRow.Count) { Debug.LogError(string.Format("Wrong column number {0} on row:{1}", line.Length, i + 1)); } } maxColumn = Mathf.Max(maxColumn, newRow.Count); } Dump(); }
void ProcessHeader() { _headers = _fileHeader.Split(_seperator).AsEnumerable().ToList(); foreach (var line in _lines.ToList()) { if (!string.IsNullOrEmpty(line)) { CSVRow <T> tuple = new CSVRow <T>(line); string[] values = line.Split(_seperator); for (var i = 0; i < _headers.Count; i++) { tuple.Values.Add(new CSVValue() { Name = _headers[i], Value = Convert.ToString(values[i]) }); } _tuples.Add(tuple); } } }
private T CreateEntity <T, U>(CSVFile file, CSVRow row, Guid projectId) where T : BaseEntity where U : BaseDto { T entity = Activator.CreateInstance <T>(); if (typeof(IProjectAwareEntity).IsAssignableFrom(typeof(T))) { ((IProjectAwareEntity)entity).ProjectId = projectId; } if (typeof(IStateAwareEntity).IsAssignableFrom(typeof(T))) { ((IStateAwareEntity)entity).State = State.BUILTIN; } List <PropertyInfo> csvAttributePropertyInfos = typeof(U).GetProperties().Where(x => Attribute.IsDefined(x, typeof(CSVAttributeAttribute))).ToList(); foreach (PropertyInfo csvAttributePropertyInfo in csvAttributePropertyInfos) { CSVAttributeAttribute csvAttribute = csvAttributePropertyInfo.GetCustomAttribute <CSVAttributeAttribute>(); CSVValue currentValue = file.GetValueToColumn(row, csvAttribute.Name); if (currentValue == null) { ValidationResult validationResult = new ValidationResult(); validationResult.Add(new ValidationMessage(ValidationType.ERROR, MessageKeyConstants.ERROR_MESSAGE_WRONG_CSV_FILE_ON_INPUT)); throw new ValidationException(validationResult); } object convertedValue = Converter.ConvertValue(csvAttributePropertyInfo.PropertyType, currentValue.GetValue()); PropertyInfo entityPropertyInfo = entity.GetType().GetProperty(csvAttributePropertyInfo.Name); if (entityPropertyInfo != null) { entityPropertyInfo.SetValue(entity, convertedValue); } } return(entity); }
protected static int csvrow_lt(CSVRow x, CSVRow y) { return x.Filename.CompareTo(y.Filename); }
protected void AddStatisticsY(CSVRow row) { _statistics.y_files++; if (row.ResultCode == ResultCode.OK) { double results = (row.SAT + row.UNSAT + row.UNKNOWN); double y_ratio_sat = (results == 0) ? 0 : row.SAT / results; double y_ratio_unsat = (results == 0) ? 0 : row.UNSAT / results; double y_ratio_unknown = (results == 0) ? 0 : row.UNKNOWN / results; _statistics.y_cumulativeTimeSAT += y_ratio_sat * row.Runtime; _statistics.y_cumulativeTimeUNSAT += y_ratio_unsat * row.Runtime; _statistics.y_cumulativeTimeUNKNOWN += y_ratio_unknown * row.Runtime; _statistics.y_countSAT += row.SAT; _statistics.y_countUNSAT += row.UNSAT; _statistics.y_countUNKNOWN += row.UNKNOWN; string suffix = Suffix(row); string subdir = Subdir(row); if (suffix.Length > 0) { _statistics.postfixes[suffix].y_files++; _statistics.postfixes[suffix].y_cumulativeTimeSAT += y_ratio_sat * row.Runtime; _statistics.postfixes[suffix].y_cumulativeTimeUNSAT += y_ratio_unsat * row.Runtime; _statistics.postfixes[suffix].y_cumulativeTimeUNKNOWN += y_ratio_unknown * row.Runtime; _statistics.postfixes[suffix].y_countSAT += row.SAT; _statistics.postfixes[suffix].y_countUNSAT += row.UNSAT; _statistics.postfixes[suffix].y_countUNKNOWN += row.UNKNOWN; } if (subdir.Length > 0) { _statistics.subdirs[subdir].y_files++; _statistics.subdirs[subdir].y_cumulativeTimeSAT += y_ratio_sat * row.Runtime; _statistics.subdirs[subdir].y_cumulativeTimeUNSAT += y_ratio_unsat * row.Runtime; _statistics.subdirs[subdir].y_cumulativeTimeUNKNOWN += y_ratio_unknown * row.Runtime; _statistics.subdirs[subdir].y_countSAT += row.SAT; _statistics.subdirs[subdir].y_countUNSAT += row.UNSAT; _statistics.subdirs[subdir].y_countUNKNOWN += row.UNKNOWN; } } }
public ConstructionItemData(CSVRow row, DataTable dt) : base(row, dt) { }
protected string Subdir(CSVRow row) { string suffix = Suffix(row); int subdir_inx = suffix.IndexOf("\\"); string subdir = suffix == "" ? "" : (subdir_inx < 0 ? suffix : suffix.Substring(0, subdir_inx)); if (subdir.Length > 0) { if (!_statistics.subdirs.ContainsKey(subdir)) _statistics.subdirs.Add(subdir, new ComparisonStatistics()); } return subdir; }
public GlobalData(CSVRow row, DataTable dt) : base(row, dt) { LoadData(this, GetType(), row); }
protected string Suffix(CSVRow row) { int liobs = row.Filename.LastIndexOf("\\"); if (liobs <= _prefixLength) return ""; string prefix = row.Filename.Substring(0, liobs); string suffix = row.Filename.Substring(_prefixLength, liobs - _prefixLength); if (suffix.Length > 0 && !_statistics.postfixes.ContainsKey(suffix)) _statistics.postfixes.Add(suffix, new ComparisonStatistics()); return suffix; }
public CombatItemData(CSVRow row, DataTable dt) : base(row, dt) { }
public Treasure_Chests(CSVRow row, DataTable dt) : base(row, dt) { this.LoadData(this, this.GetType(), row); }
protected void AddStatisticsXY(CSVRow xr, CSVRow yr) { string suffix = Suffix(xr); string subdir = Subdir(xr); _statistics.Count += 1.0; if (xr.ResultCode == ResultCode.OK || yr.ResultCode == ResultCode.OK) { double delta; if (xr.ResultCode == ResultCode.OK && yr.ResultCode == ResultCode.OK) delta = yr.Runtime - xr.Runtime; else if (xr.ResultCode == ResultCode.OK && yr.ResultCode != ResultCode.OK) delta = -_tmeY; else delta = _tmeX; _statistics.deltas.Add(delta); _statistics.deltas_sorted = false; if (suffix.Length > 0) { _statistics.postfixes[suffix].deltas.Add(delta); _statistics.postfixes[suffix].deltas_sorted = false; } if (subdir.Length > 0) { _statistics.subdirs[subdir].deltas.Add(delta); _statistics.subdirs[subdir].deltas_sorted = false; } } }
public HeroData(CSVRow row, DataTable dt) : base(row, dt) { LoadData(this, GetType(), row); }
protected void AddDataPoint(CSVRow xr, CSVRow yr) { double xrt = (xr.Runtime < _minX) ? _minX : xr.Runtime; double yrt = (yr.Runtime < _minY) ? _minY : yr.Runtime; Comparison.Point p = new Point(); p.tooltip = xr.Filename; switch (xr.ResultCode) { case ResultCode.MEMORY: p.x = _memX; break; case ResultCode.TIME: p.x = _tmeX; break; case ResultCode.OK: p.x = xrt; break; default: p.x = _errX; break; } switch (yr.ResultCode) { case ResultCode.MEMORY: p.y = _memY; break; case ResultCode.TIME: p.y = _tmeY; break; case ResultCode.OK: p.y = yrt; break; default: p.y = _errY; break; } if (xr.SAT > yr.SAT || xr.UNSAT > yr.UNSAT) p.type = PointType.WORSE; else if (xr.SAT < yr.SAT || xr.UNSAT < yr.UNSAT) p.type = PointType.BETTER; _datapoints.Add(p); }