internal void AddCell(StructCell cell, bool hidden) { if (hidden || _hideAddedCells) { if (_allCells == null) { _allCells = new List <StructCell>(); _allCells.AddRange(_cells); } _allCells.Add(cell); } else { _cells.Add(cell); if (_allCells != null) { _allCells.Add(cell); } } foreach (CellHandler handler in _addedCellHandlers) { handler(cell); } }
internal void RegisterCellSize(StructCell cell, int size) { if (_cellSizes == null) { _cellSizes = new Dictionary <StructCell, int>(); } _cellSizes[cell] = size; }
public static CellUI GetUI(StructCell cell) { if (cell is BlobCell) { return new BlobCellUI((BlobCell) cell); } return null; }
public static NodeUI GetNodeUI(StructCell cell) { if (cell is ImageCell) { return new ImageNodeUI((ImageCell) cell); } return null; }
public virtual int GetInstanceDataSize(StructCell cell, StructInstance instance) { int?cellSize = instance.GetCellSize(cell); if (cellSize.HasValue) { return(cellSize.Value); } return(GetDataSize()); }
internal int?GetCellSize(StructCell cell) { int result; if (_cellSizes != null && _cellSizes.TryGetValue(cell, out result)) { return(result); } return(null); }
public IConvertible EvaluateSymbol(string symbol) { StructCell cell = FindSymbolCell(symbol); if (cell != null) { return(cell.GetValue()); } return(EvaluateGlobalOrFunction(symbol)); }
internal StructCell FindSymbolCellBefore(string symbol, StructCell anchor) { var cellList = _allCells ?? _cells; int index = cellList.IndexOf(anchor); if (index == 0) { return(null); } index = cellList.FindLastIndex(index - 1, aCell => aCell.GetStructDef().Id == symbol || aCell.Tag == symbol); return(index >= 0 ? cellList[index] : null); }
private void calcChecksum(IConvertible value, StructCell cell) { if (Utils.IsNumeric(value)) { this._checksum += long.Parse(value.ToString()); } else if (value.GetTypeCode() == TypeCode.String && this.Offset < this.Stream.Length - 34) { byte[] buffer = Utils.ToBytes(value); this._checksum += ((StrField)cell.GetStructDef()).GetWide() ? buffer.Length / 2 : buffer.Length; for (int j = 0; j < buffer.Length; j++) { this._checksum += buffer[j]; } } else { var a = 10; } }
private void UpdateDependency(StructCell cell) { var dataSize = cell.GetStructDef().GetInstanceDataSize(cell, _instance); if (_dependencyStartOffset < 0) { _dependencyStartOffset = cell.Offset; _dependencySize = dataSize; } // include only adjacent cells in dependency range calculation else if (cell.Offset + dataSize == _dependencyStartOffset) { _dependencyStartOffset = cell.Offset; _dependencySize += dataSize; } else if (cell.Offset == _dependencyStartOffset + _dependencySize) { _dependencySize += dataSize; } }
public DependencyTrackingContext(StructInstance instance, StructCell cell) : base(instance) { _instance = instance; _cell = cell; }
internal void AddCell(StructCell cell, bool hidden) { if (hidden || _hideAddedCells) { if (_allCells == null) { _allCells = new List<StructCell>(); _allCells.AddRange(_cells); } _allCells.Add(cell); } else { _cells.Add(cell); if (_allCells != null) _allCells.Add(cell); } foreach(CellHandler handler in _addedCellHandlers) { handler(cell); } }
internal int? GetCellSize(StructCell cell) { int result; if (_cellSizes != null && _cellSizes.TryGetValue(cell, out result)) return result; return null; }
internal void RegisterCellSize(StructCell cell, int size) { if (_cellSizes == null) _cellSizes = new Dictionary<StructCell, int>(); _cellSizes[cell] = size; }
public virtual int GetInstanceDataSize(StructCell cell, StructInstance instance) { int? cellSize = instance.GetCellSize(cell); if (cellSize.HasValue) return cellSize.Value; return GetDataSize(); }
public CellSelectedEventArgs(StructCell cell) { _cell = cell; }
internal StructCell FindSymbolCellBefore(string symbol, StructCell anchor) { var cellList = _allCells ?? _cells; int index = cellList.IndexOf(anchor); if (index == 0) return null; index = cellList.FindLastIndex(index - 1, aCell => aCell.GetStructDef().Id == symbol || aCell.Tag == symbol); return index >= 0 ? cellList[index] : null; }