当前位置: 首页>>代码示例>>C#>>正文


C# AList.Sort方法代码示例

本文整理汇总了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;
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:31,代码来源:RemoteConfig.cs

示例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);
 }
开发者ID:jonlipsky,项目名称:couchbase-lite-net,代码行数:14,代码来源:Manager.cs

示例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);
        }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:57,代码来源:CCILoader.cs


注:本文中的AList.Sort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。