當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。