internal void Initialize() { Dispatcher.CurrentDispatcher.VerifyAccess(); this.isLoading.Value = true; // Fetch the bounds of the grid from the remote side this.remoteGrid = (IGrid2)this.objectProvider.GetObject(); // Create the grid of tasks which fetch chunks of data from the remote side Point2 bounds = this.remoteGrid.Bounds; int tasksX = (bounds.X % 100 > 0) ? (bounds.X / 100) + 2 : (bounds.X / 100) + 1; int tasksY = (bounds.Y % 100 > 0) ? (bounds.Y / 100) + 2 : (bounds.Y / 100) + 1; this.tasks = new Grid2 <bool>(tasksX, tasksY); // Create the grid of RemoteValue objects for the view to bind to this.grid = new Grid2 <RemoteValue>(bounds); foreach (Point2 p in this.grid.Points) { this.grid[p] = new RemoteValue(this, p); } this.bounds.Value = this.grid.Bounds; this.isLoading.Value = false; }
public StringGrid2(IGrid2 source) { this.boundsX = source.Bounds.X; this.boundsY = source.Bounds.Y; this.data = new string[this.boundsX, this.boundsY]; foreach (Point2 point in source.Points) { data[point.X, point.Y] = source[point].ToString(); } }