// retrieve cached string value. public bool TryGetCachedValueString(int index, out string value, IDataFormatter formatter) { int cacheIndex; if (TryGetCacheIndex(index, out cacheIndex)) { if (!m_CacheDirty[cacheIndex]) { if (formatter != DefaultDataFormatter.Instance) { // not caching string from other formatter than the default one value = formatter.Format(m_Cache[cacheIndex]); } else { var stringCache = GetDefaultStringCache(); if (stringCache[cacheIndex] == null) { stringCache[cacheIndex] = formatter.Format(m_Cache[cacheIndex]); } value = stringCache[cacheIndex]; } return(true); } } value = null; return(false); }
public string GenerateTelemetry() { var telemetry = File.ReadAllText(Path.Combine(_dataFolder, _files[_index % _files.Length])); _index++; if (_formatter != null) { telemetry = _formatter.Format(telemetry); } return(telemetry); }
public void Scrape(uint numPosts) { if (numPosts == 0) { throw new ArgumentOutOfRangeException("Number of posts must be greater than zero."); } var posts = new List <Post>(); bool requiredPostsAdded = false; int pageNumber = 1; while (!requiredPostsAdded) { string page = _importer.Import(_uri + pageNumber); IEnumerable <Post> pagePosts = _parser.Parse(page); foreach (var post in pagePosts) { posts.Add(post); if (posts.Count == numPosts) { requiredPostsAdded = true; break; } } pageNumber++; } string formattedPosts = _formatter.Format(posts); _exporter.Export(formattedPosts); }
/// <summary> /// /// </summary> private void ExportRows() { // grid row value // this._currentRow++; foreach (DataGridViewRow dgvrow in _dgv.Rows) { foreach (DataGridViewCell cell in dgvrow.Cells) { if (cell.Value != null) { object val = null; IDataFormatter formatter = this.DataFormatterCollection.GetDataFormatter(cell.ValueType); if (formatter != null) { val = formatter.Format(cell.Value); } else { val = cell.FormattedValue; } int col = _dgv.Columns[cell.ColumnIndex].DisplayIndex + 1; XlsFile.SetCellValue(_currentRow, col, val); } } _currentRow++; } }
public override string GetRowValueString(long row, IDataFormatter formatter) { if (row >= GetRowCount()) { return("Out of Range"); } return(formatter.Format(GetRowValue(row))); }
public override string GetRowValueString(long row, IDataFormatter formatter) { if (mbDirty) { ComputeAllValues(); } return(formatter.Format(entries[(int)row])); }
public override string GetRowValueString(long row, IDataFormatter formatter) { if (vc.m_IsDisplayMergedOnly) { return(""); } return(formatter.Format(value)); }
string IObjectDataTypeFormatter.Format(CachedSnapshot snapshot, ObjectData od, IDataFormatter formatter) { if (od.dataIncludeObjectHeader) { od = od.GetBoxedValue(snapshot, true); } return(formatter.Format(od.managedObjectData.ReadString())); }
public override string GetRowValueString(long row, IDataFormatter formatter) { var rc = GetRowValue(row); if (rc < 0) { return("N/A"); } return(formatter.Format(rc)); }
public override string GetRowValueString(long row, IDataFormatter formatter) { var l = GetRowValue(row); if (l == CachedSnapshot.NativeObjectEntriesCache.InstanceID_None) { return(""); } return(formatter.Format(l)); }
public override string GetRowValueString(long row, IDataFormatter formatter) { var i = GetRowValue(row); if (i < 0) { return(""); } return(formatter.Format(i)); }
string IObjectDataTypeFormatter.Format(CachedSnapshot snapshot, ObjectData od, IDataFormatter formatter) { ulong ptr; if (od.managedObjectData.TryReadPointer(out ptr) != BytesAndOffset.PtrReadError.Success) { return(k_InvalidIntPtr); } return(formatter.Format(ptr)); }
private string GetGroupValueString(long groupIndex, long row, IDataFormatter formatter) { if (m_IsGroupKey || m_GroupTable.IsGroupDegenerate(groupIndex)) { //pick first value of the group return(m_Column.GetRowValueString(m_GroupTable.m_Groups[groupIndex].m_GroupIndice[0], formatter)); } else if (algorithm != null) { return(formatter.Format(GetGroupValue(groupIndex, row))); } else { return(""); } }
string IObjectDataTypeFormatter.Format(CachedSnapshot snapshot, ObjectData od, IDataFormatter formatter) { return(formatter.Format(od.managedObjectData.ReadUInt32())); }
public override string GetRowValueString(long row, IDataFormatter formatter) { return(formatter.Format(row)); }
public override string GetRowValueString(long row, IDataFormatter formatter) { return(formatter.Format(Enum.GetName(typeof(DiffTable.DiffResult), m_Table.m_Entries[row].diffResult))); }
public override string GetRowValueString(long row, IDataFormatter formatter) { return(formatter.Format(getter(list[(int)row]))); }
public override string GetRowValueString(long row, IDataFormatter formatter) { return(formatter.Format(m_Transformer(m_Cache[row]))); }