You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace Explorer
{
class LogicalDiskInfoCollection : System.Collections.CollectionBase
{
public void Add(LogicalDiskInfo ldi)
{
List.Add(ldi);
}
public void Remove(int index)
{
if (index > 0 || index < Count - 1)
{
List.RemoveAt(index);
}
}
public LogicalDiskInfo Item(int index)
{
if (index > 0 || index < Count - 1)
{
return (LogicalDiskInfo)List[index];
}
else
{
return null;
}
}
public LogicalDiskInfo Item(string name)
{
foreach (LogicalDiskInfo ldi in List)
{
if (ldi.Name == name)
{
return ldi;
}
}
return null;
}
}
}