Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / X509CertificateCollection.cs / 1305376 / X509CertificateCollection.cs
// ------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// -----------------------------------------------------------------------------
//
namespace System.Security.Cryptography.X509Certificates {
using System;
using System.Collections;
[Serializable()]
public class X509CertificateCollection : CollectionBase {
public X509CertificateCollection() {
}
public X509CertificateCollection(X509CertificateCollection value) {
this.AddRange(value);
}
public X509CertificateCollection(X509Certificate[] value) {
this.AddRange(value);
}
public X509Certificate this[int index] {
get {
return ((X509Certificate)(List[index]));
}
set {
List[index] = value;
}
}
public int Add(X509Certificate value) {
return List.Add(value);
}
public void AddRange(X509Certificate[] value) {
if (value == null) {
throw new ArgumentNullException("value");
}
for (int i = 0; (i < value.Length); i = (i + 1)) {
this.Add(value[i]);
}
}
public void AddRange(X509CertificateCollection value) {
if (value == null) {
throw new ArgumentNullException("value");
}
for (int i = 0; (i < value.Count); i = (i + 1)) {
this.Add(value[i]);
}
}
public bool Contains(X509Certificate value) {
foreach (X509Certificate cert in List) {
if (cert.Equals(value)) {
return true;
}
}
return false;
}
public void CopyTo(X509Certificate[] array, int index) {
List.CopyTo(array, index);
}
public int IndexOf(X509Certificate value) {
return List.IndexOf(value);
}
public void Insert(int index, X509Certificate value) {
List.Insert(index, value);
}
public new X509CertificateEnumerator GetEnumerator() {
return new X509CertificateEnumerator(this);
}
public void Remove(X509Certificate value) {
List.Remove(value);
}
public override int GetHashCode() {
int hashCode = 0;
foreach (X509Certificate cert in this) {
hashCode += cert.GetHashCode();
}
return hashCode;
}
public class X509CertificateEnumerator : object, IEnumerator {
private IEnumerator baseEnumerator;
private IEnumerable temp;
public X509CertificateEnumerator(X509CertificateCollection mappings) {
this.temp = ((IEnumerable)(mappings));
this.baseEnumerator = temp.GetEnumerator();
}
public X509Certificate Current {
get {
return ((X509Certificate)(baseEnumerator.Current));
}
}
///
object IEnumerator.Current {
get {
return baseEnumerator.Current;
}
}
public bool MoveNext() {
return baseEnumerator.MoveNext();
}
///
bool IEnumerator.MoveNext() {
return baseEnumerator.MoveNext();
}
public void Reset() {
baseEnumerator.Reset();
}
///
void IEnumerator.Reset() {
baseEnumerator.Reset();
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ArglessEventHandlerProxy.cs
- XmlSerializer.cs
- CutCopyPasteHelper.cs
- FieldToken.cs
- MethodBody.cs
- NumericUpDown.cs
- IdnMapping.cs
- DesignSurfaceCollection.cs
- DesignerTextViewAdapter.cs
- TemplateBindingExtension.cs
- Label.cs
- EntityDataSourceDataSelection.cs
- Size.cs
- Empty.cs
- AmbiguousMatchException.cs
- ContractCodeDomInfo.cs
- PreviewPrintController.cs
- XPathParser.cs
- SecurityCriticalDataForSet.cs
- UIElementHelper.cs
- ComponentCommands.cs
- LinqDataView.cs
- EarlyBoundInfo.cs
- LocalIdKeyIdentifierClause.cs
- WindowsGraphicsWrapper.cs
- ProcessingInstructionAction.cs
- OracleLob.cs
- FileNotFoundException.cs
- CommandEventArgs.cs
- AssemblyResourceLoader.cs
- ReceiveDesigner.xaml.cs
- EventManager.cs
- RoleService.cs
- DoubleConverter.cs
- CryptoApi.cs
- SmiEventSink.cs
- ExpressionEvaluator.cs
- WaitingCursor.cs
- TypeBuilderInstantiation.cs
- SecurityContext.cs
- TextTreeText.cs
- HtmlElement.cs
- mediapermission.cs
- PersonalizationAdministration.cs
- SiteMapNodeItemEventArgs.cs
- FacetValues.cs
- CollectionConverter.cs
- Point3DConverter.cs
- ActivityInterfaces.cs
- ParameterBuilder.cs
- DeploymentSectionCache.cs
- XmlSchemaAll.cs
- Blend.cs
- CngAlgorithm.cs
- ResourceProperty.cs
- tibetanshape.cs
- AffineTransform3D.cs
- RuntimeConfig.cs
- CommandHelper.cs
- PasswordBox.cs
- ResourceProperty.cs
- SortedList.cs
- RuntimeConfigurationRecord.cs
- CollectionBase.cs
- BlobPersonalizationState.cs
- DataGridViewColumnEventArgs.cs
- RefreshEventArgs.cs
- InternalResources.cs
- SecureStringHasher.cs
- WebException.cs
- HighlightVisual.cs
- XmlSchemaComplexContent.cs
- SafeFileHandle.cs
- FileClassifier.cs
- BaseCollection.cs
- WeakReadOnlyCollection.cs
- BCLDebug.cs
- DynamicDataRouteHandler.cs
- ProgressBarRenderer.cs
- GridLength.cs
- HtmlInputRadioButton.cs
- OpenFileDialog.cs
- SettingsPropertyValue.cs
- EdmPropertyAttribute.cs
- FileSecurity.cs
- DiffuseMaterial.cs
- PassportPrincipal.cs
- TransactionScope.cs
- ToolStripStatusLabel.cs
- PackUriHelper.cs
- MergeFailedEvent.cs
- Literal.cs
- Crc32Helper.cs
- RegisteredDisposeScript.cs
- MemberJoinTreeNode.cs
- DataRow.cs
- ActivityExecutor.cs
- PromptEventArgs.cs
- BitmapEffectState.cs
- TextStore.cs