Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/22/10 00:44:01 (14 years ago)
Author:
swagner
Message:

Sorted usings and removed unused usings in entire solution (#1094)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Collections/StackBase.cs

    r2768 r4068  
    22using System.Collections;
    33using System.Collections.Generic;
    4 using System.Diagnostics;
    54
    65
    7 namespace Netron.Diagramming.Core
    8 {
     6namespace Netron.Diagramming.Core {
     7  /// <summary>
     8  /// This is a wrapper around the <see cref="Stack"/> which communicates Push and Pop events
     9  /// </summary>
     10  /// <typeparam name="T"></typeparam>
     11  public class StackBase<T> {
     12    #region Fields
    913    /// <summary>
    10     /// This is a wrapper around the <see cref="Stack"/> which communicates Push and Pop events
     14    /// the internal stack based on the .Net <see cref="Stack"/> implementation
    1115    /// </summary>
    12     /// <typeparam name="T"></typeparam>
    13     public class StackBase<T>
    14     {
    15         #region Fields
    16         /// <summary>
    17         /// the internal stack based on the .Net <see cref="Stack"/> implementation
    18         /// </summary>
    19         private Stack<T> InnerStack;
    20         #endregion
     16    private Stack<T> InnerStack;
     17    #endregion
    2118
    22         #region Events
    23         /// <summary>
    24         /// Occurs when an item is pushed onto the stack
    25         /// </summary>
    26         public event EventHandler<CollectionEventArgs<T>> OnItemPushed;
    27         /// <summary>
    28         /// Occurs when an item is popped from the stack
    29         /// </summary>
    30         public event EventHandler<CollectionEventArgs<T>> OnItemPopped;
    31         #endregion;
     19    #region Events
     20    /// <summary>
     21    /// Occurs when an item is pushed onto the stack
     22    /// </summary>
     23    public event EventHandler<CollectionEventArgs<T>> OnItemPushed;
     24    /// <summary>
     25    /// Occurs when an item is popped from the stack
     26    /// </summary>
     27    public event EventHandler<CollectionEventArgs<T>> OnItemPopped;
     28    #endregion;
    3229
    33         #region Constructor
    34         /// <summary>
    35         /// Initializes a new instance of the <see cref="T:StackBase&lt;T&gt;"/> class.
    36         /// </summary>
    37         public StackBase()
    38         {
    39             InnerStack = new Stack<T>();
    40         }
    41         #endregion
     30    #region Constructor
     31    /// <summary>
     32    /// Initializes a new instance of the <see cref="T:StackBase&lt;T&gt;"/> class.
     33    /// </summary>
     34    public StackBase() {
     35      InnerStack = new Stack<T>();
     36    }
     37    #endregion
    4238
    43         #region Methods
     39    #region Methods
    4440
    45         /// <summary>
    46         /// Gets the number of elements in the stack
    47         /// </summary>
    48         /// <value>The count.</value>
    49         public int Count
    50         {
    51             get { return InnerStack.Count; }
    52         }
     41    /// <summary>
     42    /// Gets the number of elements in the stack
     43    /// </summary>
     44    /// <value>The count.</value>
     45    public int Count {
     46      get { return InnerStack.Count; }
     47    }
    5348
    5449
    55         /// <summary>
    56         /// Pushes the specified item.
    57         /// </summary>
    58         /// <param name="item">A parameter of the generics Type T</param>
    59         public void Push(T item)
    60         {
     50    /// <summary>
     51    /// Pushes the specified item.
     52    /// </summary>
     53    /// <param name="item">A parameter of the generics Type T</param>
     54    public void Push(T item) {
    6155
    62             this.InnerStack.Push(item);
    63             RaiseOnItemPushed(item);
     56      this.InnerStack.Push(item);
     57      RaiseOnItemPushed(item);
    6458
    65         }
     59    }
    6660
    67         /// <summary>
    68         /// Pops the next item from the stack
    69         /// </summary>
    70         /// <returns></returns>
    71         public T Pop()
    72         {
    73             T item =
    74              InnerStack.Pop();
    75             RaiseOnItemPopped(item);
    76             return item;
    77         }
     61    /// <summary>
     62    /// Pops the next item from the stack
     63    /// </summary>
     64    /// <returns></returns>
     65    public T Pop() {
     66      T item =
     67       InnerStack.Pop();
     68      RaiseOnItemPopped(item);
     69      return item;
     70    }
    7871
    79         /// <summary>
    80         /// Peeks the next item in the stack
    81         /// </summary>
    82         /// <returns></returns>
    83         public T Peek()
    84         {
    85             return InnerStack.Peek();
    86         }
     72    /// <summary>
     73    /// Peeks the next item in the stack
     74    /// </summary>
     75    /// <returns></returns>
     76    public T Peek() {
     77      return InnerStack.Peek();
     78    }
    8779
    8880
    89         /// <summary>
    90         /// Converts the stack to an array.
    91         /// </summary>
    92         /// <returns></returns>
    93         public T[] ToArray()
    94         {
    95             return InnerStack.ToArray();
    96         }
     81    /// <summary>
     82    /// Converts the stack to an array.
     83    /// </summary>
     84    /// <returns></returns>
     85    public T[] ToArray() {
     86      return InnerStack.ToArray();
     87    }
    9788
    9889
    99         /// <summary>
    100         /// Raises the <see cref="OnItemPushed"/>.
    101         /// </summary>
    102         /// <param name="item">A parameter of the generics Type T</param>
    103         private void RaiseOnItemPushed(T item)
    104         {
    105             EventHandler<CollectionEventArgs<T>> handler = OnItemPushed;
    106             handler(this, new CollectionEventArgs<T>(item));
    107         }
     90    /// <summary>
     91    /// Raises the <see cref="OnItemPushed"/>.
     92    /// </summary>
     93    /// <param name="item">A parameter of the generics Type T</param>
     94    private void RaiseOnItemPushed(T item) {
     95      EventHandler<CollectionEventArgs<T>> handler = OnItemPushed;
     96      handler(this, new CollectionEventArgs<T>(item));
     97    }
    10898
    109         /// <summary>
    110         /// Raises the on OnItemPopped event.
    111         /// </summary>
    112         /// <param name="item">A parameter of the generics Type T</param>
    113         private void RaiseOnItemPopped(T item)
    114         {
    115             EventHandler<CollectionEventArgs<T>> handler = OnItemPopped;
    116             handler(this, new CollectionEventArgs<T>(item));
    117         }
     99    /// <summary>
     100    /// Raises the on OnItemPopped event.
     101    /// </summary>
     102    /// <param name="item">A parameter of the generics Type T</param>
     103    private void RaiseOnItemPopped(T item) {
     104      EventHandler<CollectionEventArgs<T>> handler = OnItemPopped;
     105      handler(this, new CollectionEventArgs<T>(item));
     106    }
    118107
    119108
    120         #endregion
     109    #endregion
    121110
    122     }
     111  }
    123112}
Note: See TracChangeset for help on using the changeset viewer.