本文整理汇总了C#中System.Collections.Specialized.StringCollection.RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.Specialized.StringCollection.RemoveAt方法的具体用法?C# System.Collections.Specialized.StringCollection.RemoveAt怎么用?C# System.Collections.Specialized.StringCollection.RemoveAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.Specialized.StringCollection
的用法示例。
在下文中一共展示了System.Collections.Specialized.StringCollection.RemoveAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadModules
/// -----------------------------------------------------------------------------
/// <summary>
/// Will load all modules in given list
/// </summary>
/// <param name="ModFiles"></param>
/// <remarks>
/// Once a module is loaded it will be added the the Module list,
/// and will then have ModLoad called and the filename property set
/// </remarks>
/// <history>
/// [Caleb] 6/18/2005 Created
/// </history>
/// -----------------------------------------------------------------------------
public void LoadModules(string[] ModFiles)
{
System.Collections.Specialized.StringCollection ModuleFiles = new System.Collections.Specialized.StringCollection();
Assembly tObject;
//File tFile;
int tIndex;
short tCount = 0;
string tMod;
string tString;
System.Collections.Specialized.StringCollection tFound = new System.Collections.Specialized.StringCollection();
foreach (string xMod in ModFiles)
{
ModuleFiles.Add(xMod);
}
BlackLightModule tModule;
//Cycle through the modules untill they are all loaded or removed
while (ModuleFiles.Count > 0)
{
try
{
//Infinate loop check
if (tCount > 1000)
{
Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "It appears we have gotten into an infinate loop while loading modules, loading halted", "Most likely cause is two or more modules require each other and will never be able to load", "", "");
return;
}
tCount += Convert.ToInt16(1);
//Get the filename
tMod = ModuleFiles[0].ToString();
//Make sure it exists
if (File.Exists("modules/" + tMod))
{
//Use .NET to attempt to load the class inside the dll
tObject = @Assembly.LoadFrom("modules/" + tMod);
//Make sure everything is still hawt or remove the failed module
if (tObject == null)
{
ModuleFiles.RemoveAt(0);
}
//Get a list of the classes the module contains
Type[] tList = tObject.GetTypes();
//Cycle through them all
foreach (Type tType in tList)
{
//Make sure it uses our module base somewhere
if (tType.IsSubclassOf(typeof(BlackLightModule)) == true)
{
//Alrighty it's a valid module now what?
//Well lets check if its a special module, currently only datadrivers
//Ooooo isn't this sexy
tModule = ((BlackLightModule) tType.GetConstructor(new Type[] { typeof(ServicesDaemon) }).Invoke(new object[] {Base}));
//Or not :'(
if (tModule == null)
{
ModuleFiles.RemoveAt(0);
}
if (tType.IsSubclassOf(typeof(DB.DataDriver)) == true)
{
if (DataDriver == "")
{
DataDriver = tModule.Name;
}
else
{
Base.Core.SendLogMessage("ModuleManagement", "LoadModules", BlackLight.Services.Error.Errors.DEBUG | BlackLight.Services.Error.Errors.WARNING, "DataBase driver already loaded!", "File does not exist", "", "");
ModuleFiles.RemoveAt(0);
}
}
//Set the internal filename for the ModuleList Class
tModule.FileName = tMod;
//Clear the list of found modules for requirements
tFound.Clear();
//Malicious module coder?
if (tModule.Requires.Count < 1000)
//.........这里部分代码省略.........