You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@ -0,0 +1,78 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="DummyDataSource.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.Web.UI.WebControls {
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
|
||||
/// <devdoc>
|
||||
/// </devdoc>
|
||||
internal sealed class DummyDataSource : ICollection {
|
||||
|
||||
private int dataItemCount;
|
||||
|
||||
internal DummyDataSource(int dataItemCount) {
|
||||
this.dataItemCount = dataItemCount;
|
||||
}
|
||||
|
||||
public int Count {
|
||||
get {
|
||||
return dataItemCount;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSynchronized {
|
||||
get {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public Object SyncRoot {
|
||||
get {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyTo(Array array, int index) {
|
||||
for (IEnumerator e = this.GetEnumerator(); e.MoveNext();)
|
||||
array.SetValue(e.Current, index++);
|
||||
}
|
||||
|
||||
public IEnumerator GetEnumerator() {
|
||||
return new DummyDataSourceEnumerator(dataItemCount);
|
||||
}
|
||||
|
||||
|
||||
private class DummyDataSourceEnumerator : IEnumerator {
|
||||
|
||||
private int count;
|
||||
private int index;
|
||||
|
||||
public DummyDataSourceEnumerator(int count) {
|
||||
this.count = count;
|
||||
this.index = -1;
|
||||
}
|
||||
|
||||
public object Current {
|
||||
get {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public bool MoveNext() {
|
||||
index++;
|
||||
return index < count;
|
||||
}
|
||||
|
||||
public void Reset() {
|
||||
this.index = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user