|
//---------------------------------------------------------------------------
// <copyright file="FixedLinkTarget.cs" company="Microsoft">
// Copyright (C) 2004 by Microsoft Corporation. All rights reserved.
// </copyright>
//
// Description:
// Implements the LinkTargetCollection as holder for a collection
// of LinkTarget
//
// History:
// 02/01/2005 - Ming Liu(MingLiu) - Created.
//
//
//---------------------------------------------------------------------------
namespace System.Windows.Documents
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows.Threading;
using System.Windows.Markup;
//=====================================================================
/// <summary>
/// LinkTarget is the class that keep name that a named element exist in document
/// </summary>
public sealed class LinkTarget
{
/// <summary>
/// The element name
/// </summary>
public string Name
{
get
{
return _name;
}
set
{
_name = value;
}
}
private string _name;
}
//=====================================================================
/// <summary>
/// LinkTargetCollection is an ordered collection of LinkTarget
/// It has to implement plain IList because the parser doesn't support
/// generics IList.
/// </summary>
public sealed class LinkTargetCollection : CollectionBase
{
//--------------------------------------------------------------------
//
// Public Methods
//
//---------------------------------------------------------------------
/// <summary>
/// <!-- see cref="System.Collections.Generic.IList<>.this" / -->
/// </summary>
public LinkTarget this[int index]
{
get
{
return (LinkTarget)((IList)this)[index];
}
set
{
((IList)this)[index] = value;
}
}
/// <summary>
/// <!-- see cref="System.Collections.Generic.ICollection<>.Add" / -->
/// </summary>
public int Add(LinkTarget value)
{
return ((IList)this).Add((object)value);
}
/// <summary>
/// <!-- see cref="System.Collections.Generic.ICollection<>.Remove" / -->
/// </summary>
public void Remove(LinkTarget value)
{
((IList)this).Remove((object) value);
}
/// <summary>
/// <!-- see cref="System.Collections.Generic.ICollection<>.Contains" / -->
/// </summary>
public bool Contains(LinkTarget value)
{
return ((IList)this).Contains((object)value);
}
/// <summary>
/// <!-- see cref="System.Collections.Generic.ICollection<>.CopyTo" / -->
/// </summary>
public void CopyTo(LinkTarget[] array, int index)
{
((ICollection)this).CopyTo(array, index);
}
/// <summary>
/// <!-- see cref="System.Collections.Generic.IList<>.IndexOf" / -->
/// </summary>
public int IndexOf(LinkTarget value)
{
return ((IList)this).IndexOf((object)value);
}
/// <summary>
/// <!-- see cref="System.Collections.Generic.IList<>.Insert" / -->
/// </summary>
public void Insert(int index, LinkTarget value)
{
((IList)this).Insert(index, (object)value);
}
}
}
|