|
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Collections.Specialized;
using System.Windows.Forms;
namespace internet_magic
{
public class ip_mon_status
{
/// <summary>
/// Constuct Class.
/// </summary>
public ip_mon_status() { }
///<summary>Adds an item to the list.</summary>
///<param name="sts">The IP address to add.</param>
///<param name="tmlm">The corresponding time limit to add.</param>
///<exception cref="ArgumentNullException">Either feild is null.</exception>
public void AddItem(string sts)
{
if (sts == null)
throw new ArgumentNullException();
Addst(sts);
}
///<summary>Adds an item to the list.</summary>
///<param name="sts">The IP address to add.</param>
///<param name="tmlm">The corresponding time limit to add.</param>
///<exception cref="ArgumentNullException">Either feild is null.</exception>
public void Addst(string sts)
{
if (Listing.ContainsKey(sts))
{
throw new ArgumentNullException();
}
else
{
Listing.Add(sts, null);
}
}
///<summary>Remove an item from the list.</summary>
///<param name="sts">The IP address to remove.</param>
///<exception cref="ArgumentNullException">sts feild is null.</exception>
public void RemoveItem(string sts)
{
if (sts == null)
throw new ArgumentNullException();
Listing.Remove(sts);
}
///<summary>Checks whether a IP address/Time limit is present in the collection or not.</summary>
///<param name="sts">The Corresponding IP address to search for.</param>
///<returns>True when the IP address is present in the collection, false otherwise.</returns>
public bool IsItemPresent(string sts)
{
return IsstsPresent(sts);
}
///<summary>Checks whether a IP address is present in the collection or not.</summary>
///<param name="sts">The IP address to search for.</param>
///<returns>True when the IP address is present in the collection, false otherwise.</returns>
public bool IsstsPresent(string sts)
{
return Listing.ContainsKey(sts);
}
///<summary>Gets an array with all the keys in the authentication list.</summary>
///<value>An array of strings containing all the keys in the authentication list.</value>
public string[] Keys
{
get
{
ICollection keys = Listing.Keys;
string[] ret = new string[keys.Count];
keys.CopyTo(ret, 0);
return ret;
}
}
///<summary>Gets an array with all the hashes in the authentication list.</summary>
///<value>An array of strings containing all the hashes in the authentication list.</value>
protected StringDictionary Listing
{
get
{
return m_Listing;
}
}
///<summary>Clears the web list.</summary>
public void Clear()
{
Listing.Clear();
}
// private variables
/// <summary>Holds the value of the Listing property.</summary>
private StringDictionary m_Listing = new StringDictionary();
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.