本文整理汇总了C#中System.Collections.ArrayList.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayList.Equals方法的具体用法?C# ArrayList.Equals怎么用?C# ArrayList.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.ArrayList
的用法示例。
在下文中一共展示了ArrayList.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: undoDrawing
/// <summary>
/// Undo a previously marked drawing
/// Takes a boolean argument that detemines if the element is to be deleted
/// from concerned arrayList
/// </summary>
/// <param name="deleteItem"></param>
/// <returns></returns>
private Boolean undoDrawing(Boolean deleteItem)
{
//Undo option
//There is a stack called actionState that stores all the actions
//actions here are elements that are identified - capacitors, etc
// and the circle is drawn around them
//When an option is undo-ed the stack pops and the element is examined
//That element has info on coordinates
//erase graphics method is called
ArrayList foo = new ArrayList();
if (actionState.Count > 0)
{
foo = actionState.Pop();
string sfoo = null;
char[] delims = { '_' };
string[] foob = null;
if (foo.Equals(Transistors))
{
sfoo = Transistors[Transistors.Count - 1].ToString();
foob = sfoo.Split(delims, StringSplitOptions.RemoveEmptyEntries);
eraseGraphics(int.Parse(foob[1]), int.Parse(foob[2]));
if(deleteItem) Transistors.RemoveAt(Transistors.Count - 1);
//MessageBox.Show("It was transistors");
}
else if (foo.Equals(Resistors))
{
sfoo = Resistors[Resistors.Count - 1].ToString();
foob = sfoo.Split(delims, StringSplitOptions.RemoveEmptyEntries);
eraseGraphics(int.Parse(foob[1]), int.Parse(foob[2]));
if (deleteItem) Resistors.RemoveAt(Resistors.Count - 1);
}
else if (foo.Equals(Capacitors))
{
sfoo = Capacitors[Capacitors.Count - 1].ToString();
foob = sfoo.Split(delims, StringSplitOptions.RemoveEmptyEntries);
eraseGraphics(int.Parse(foob[1]), int.Parse(foob[2]));
if (deleteItem) Capacitors.RemoveAt(Capacitors.Count - 1);
}
else if (foo.Equals(Inductors))
{
sfoo = Inductors[Inductors.Count - 1].ToString();
foob = sfoo.Split(delims, StringSplitOptions.RemoveEmptyEntries);
eraseGraphics(int.Parse(foob[1]), int.Parse(foob[2]));
if (deleteItem) Inductors.RemoveAt(Inductors.Count - 1);
}
else if (foo.Equals(CS))
{
sfoo = CS[CS.Count - 1].ToString();
foob = sfoo.Split(delims, StringSplitOptions.RemoveEmptyEntries);
eraseGraphics(int.Parse(foob[1]), int.Parse(foob[2]));
if (deleteItem) CS.RemoveAt(CS.Count - 1);
}
else if (foo.Equals(VS))
{
sfoo = VS[VS.Count - 1].ToString();
foob = sfoo.Split(delims, StringSplitOptions.RemoveEmptyEntries);
eraseGraphics(int.Parse(foob[1]), int.Parse(foob[2]));
if (deleteItem) VS.RemoveAt(VS.Count - 1);
}
else if (foo.Equals(Diodes))
{
sfoo = Diodes[Diodes.Count - 1].ToString();
foob = sfoo.Split(delims, StringSplitOptions.RemoveEmptyEntries);
eraseGraphics(int.Parse(foob[1]), int.Parse(foob[2]));
if (deleteItem) Diodes.RemoveAt(Diodes.Count - 1);
}
else if (foo.Equals(Nodes))
{
sfoo = Nodes[Nodes.Count - 1].ToString();
foob = sfoo.Split(delims, StringSplitOptions.RemoveEmptyEntries);
eraseGraphics(int.Parse(foob[1]), int.Parse(foob[2]));
if (deleteItem) Nodes.RemoveAt(Nodes.Count - 1);
}
else if (foo.Equals(Amplifier))
{
sfoo = Amplifier[Amplifier.Count - 1].ToString();
foob = sfoo.Split(delims, StringSplitOptions.RemoveEmptyEntries);
eraseGraphics(int.Parse(foob[1]), int.Parse(foob[2]));
if (deleteItem) Amplifier.RemoveAt(Amplifier.Count - 1);
}
else if (foo.Equals(Attenuator))
{
sfoo = Attenuator[Attenuator.Count - 1].ToString();
foob = sfoo.Split(delims, StringSplitOptions.RemoveEmptyEntries);
eraseGraphics(int.Parse(foob[1]), int.Parse(foob[2]));
if (deleteItem) Attenuator.RemoveAt(Attenuator.Count - 1);
}
else if (foo.Equals(Bias))
{
sfoo = Bias[Bias.Count - 1].ToString();
//.........这里部分代码省略.........