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
65
mcs/class/referencesource/System.Web/Util/DoubleLink.cs
Normal file
65
mcs/class/referencesource/System.Web/Util/DoubleLink.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="DoubleLink.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* DoubleLink
|
||||
*
|
||||
* Copyright (c) 1998-1999, Microsoft Corporation
|
||||
*
|
||||
*/
|
||||
|
||||
namespace System.Web.Util {
|
||||
using System.Runtime.Serialization.Formatters;
|
||||
|
||||
internal class DoubleLink {
|
||||
internal DoubleLink _next, _prev;
|
||||
internal Object Item;
|
||||
|
||||
internal DoubleLink() {
|
||||
_next = _prev = this;
|
||||
}
|
||||
internal DoubleLink(Object item) : this() {
|
||||
this.Item = item;
|
||||
}
|
||||
internal DoubleLink Next {get {return _next;}}
|
||||
|
||||
internal void InsertAfter(DoubleLink after) {
|
||||
this._prev = after;
|
||||
this._next = after._next;
|
||||
after._next = this;
|
||||
this._next._prev = this;
|
||||
}
|
||||
|
||||
internal void InsertBefore(DoubleLink before) {
|
||||
this._prev = before._prev;
|
||||
this._next = before;
|
||||
before._prev = this;
|
||||
this._prev._next = this;
|
||||
}
|
||||
|
||||
internal void Remove() {
|
||||
this._prev._next = this._next;
|
||||
this._next._prev = this._prev;
|
||||
_next = _prev = this;
|
||||
}
|
||||
|
||||
#if DBG
|
||||
internal virtual void DebugValidate() {
|
||||
Debug.CheckValid(this._next != this || this._prev == this, "Invalid link");
|
||||
}
|
||||
|
||||
internal virtual string DebugDescription(string indent) {
|
||||
string desc;
|
||||
|
||||
desc = indent + "_next=" + _next + ", _prev=" + _prev + "\nItem=";
|
||||
desc += Debug.GetDescription(Item, indent + " ");
|
||||
|
||||
return desc;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user