本文整理汇总了C#中AList.Sort方法的典型用法代码示例。如果您正苦于以下问题:C# AList.Sort方法的具体用法?C# AList.Sort怎么用?C# AList.Sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AList
的用法示例。
在下文中一共展示了AList.Sort方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAllRemoteConfigs
/// <summary>
/// Parse all remote blocks in an existing configuration file, looking for
/// remotes configuration.
/// </summary>
/// <remarks>
/// Parse all remote blocks in an existing configuration file, looking for
/// remotes configuration.
/// </remarks>
/// <param name="rc">
/// the existing configuration to get the remote settings from.
/// The configuration must already be loaded into memory.
/// </param>
/// <returns>
/// all remotes configurations existing in provided repository
/// configuration. Returned configurations are ordered
/// lexicographically by names.
/// </returns>
/// <exception cref="Sharpen.URISyntaxException">one of the URIs within the remote's configuration is invalid.
/// </exception>
public static IList<NGit.Transport.RemoteConfig> GetAllRemoteConfigs(Config rc)
{
IList<string> names = new AList<string>(rc.GetSubsections(SECTION));
names.Sort();
IList<NGit.Transport.RemoteConfig> result = new AList<NGit.Transport.RemoteConfig
>(names.Count);
foreach (string name in names)
{
result.AddItem(new NGit.Transport.RemoteConfig(rc, name));
}
return result;
}
示例2: GetAllDatabaseNames
public IList<string> GetAllDatabaseNames()
{
string[] databaseFiles = directoryFile.List(new _FilenameFilter_178());
IList<string> result = new AList<string>();
foreach (string databaseFile in databaseFiles)
{
string trimmed = Sharpen.Runtime.Substring(databaseFile, 0, databaseFile.Length -
Couchbase.Lite.Manager.DatabaseSuffix.Length);
string replaced = trimmed.Replace(':', '/');
result.AddItem(replaced);
}
result.Sort();
return Sharpen.Collections.UnmodifiableList(result);
}
示例3: AssemblyDefFromCCIAssembly
private AssemblyDef AssemblyDefFromCCIAssembly(CCI.AssemblyNode assembly)
{
var references = default(AList<StrongAssemblyName>);
if (assembly.AssemblyReferences != null && assembly.AssemblyReferences.Count > 0)
{
references = new AList<StrongAssemblyName>();
for (var i = 0; i < assembly.AssemblyReferences.Count; i++)
{
var reference = assembly.AssemblyReferences[i];
if (reference.Assembly == null ||
!reference.Assembly.StrongName.Equals
(reference.StrongName, StringComparison.OrdinalIgnoreCase) ||
reference.Assembly.Location.Equals("unknown:location", StringComparison.OrdinalIgnoreCase))
throw new InvalidOperationException("invalid assembly reference");
references.Add(StrongAssemblyNameFromCCIAssembly(reference.Assembly));
}
references.Sort((l, r) => l.CompareTo(r));
}
var nameToTypeDef = new Dictionary<TypeName, TypeDef>();
if (assembly.Types != null)
{
for (var i = 0; i < assembly.Types.Count; i++)
AddCCITypes(nameToTypeDef, assembly, assembly.Types[i]);
}
var sn = StrongAssemblyNameFromCCIAssembly(assembly);
// Extract names and sort them
var names = new List<TypeName>();
foreach (var kv in nameToTypeDef)
names.Add(kv.Key);
names.Sort((l, r) => l.CompareTo(r));
// Place definitions in canonical order
var typeDefs = default(AList<TypeDef>);
if (names.Count > 0)
{
typeDefs = new AList<TypeDef>();
foreach (var nm in names)
typeDefs.Add(nameToTypeDef[nm]);
}
var entryPoint = default(MethodRef);
if (assembly.EntryPoint != null)
entryPoint = MethodRefFromCCIMethod(assembly.EntryPoint);
var customAttributes = default(AList<CustomAttribute>);
if (assembly.Attributes != null && assembly.Attributes.Count > 0)
{
customAttributes = new AList<CustomAttribute>();
for (var i = 0; i < assembly.Attributes.Count; i++)
customAttributes.Add(CustomAttributeFromCCIAttribute(assembly.Attributes[i]));
}
return new AssemblyDef(global, null, customAttributes, sn, references, typeDefs, entryPoint);
}