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


C# Collections.ArrayList类代码示例

本文整理汇总了C#中System.Collections.ArrayList的典型用法代码示例。如果您正苦于以下问题:C# ArrayList类的具体用法?C# ArrayList怎么用?C# ArrayList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ArrayList类属于System.Collections命名空间,在下文中一共展示了ArrayList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OverviewFor

		public void OverviewFor(string t, string p, ref bool b, ref SearchSet obj, ArrayList list)
		{
			PartOfSpeech pos = PartOfSpeech.of(p);
			SearchSet ss = WNDB.is_defined(t, pos);
			MorphStr ms = new MorphStr(t, pos);
			bool checkmorphs = false;

			checkmorphs = AddSearchFor(t, pos, list); // do a search

		    if (checkmorphs)
				HasMatch = true;

			if (!HasMatch)
			{
			    // loop through morphs (if there are any)
			    string m;
			    while ((m = ms.next()) != null)
					if (m != t)
					{
						ss = ss + WNDB.is_defined(m, pos);
						AddSearchFor(m, pos, list);
					}
			}
		    b = ss.NonEmpty;
			obj = ss;
		}
开发者ID:ejohn916,项目名称:WordNet.Net-3.1,代码行数:26,代码来源:Class1.cs

示例2: ApplicationPartitionCollection

 internal ApplicationPartitionCollection(ArrayList values)
 {
     if (values != null)
     {
         InnerList.AddRange(values);
     }
 }
开发者ID:chcosta,项目名称:corefx,代码行数:7,代码来源:ApplicationPartitionCollection.cs

示例3: WriteException

        public static void WriteException(System.Exception e)
        {
            ArrayList messages = new ArrayList();
            while (e != null)
            {
                messages.Add(e);
                e = e.InnerException;
            }
            Console.WriteLine(" ");
            Console.WriteLine("------- System.Exception ----------------------------- ");
            messages.Reverse();

            foreach (System.Exception ex in messages)
            {
                Console.WriteLine(ex.Message);
            }

            Console.WriteLine(" ");
            Console.WriteLine("----- Details -----");
            foreach (System.Exception ex in messages)
            {
                Console.WriteLine("Message..........: " + ex.Message);
                Console.WriteLine("Stact trace......: " + ex.StackTrace);
                Console.WriteLine("TargetSite.......: " + ex.TargetSite.Name);
                Console.WriteLine("Source...........: " + ex.Source);
                Console.WriteLine(" ");
            }
        }
开发者ID:KangChaofan,项目名称:OOC,代码行数:28,代码来源:ExceptionHandler.cs

示例4: aListOfPoint

 public IList aListOfPoint()
 {
     IList list = new ArrayList();
     list.Add(new System.Drawing.Point(0,0));
     list.Add(new System.Drawing.Point(5,5));
     return list;
 }
开发者ID:vaibhavsapre,项目名称:fitsharp,代码行数:7,代码来源:SystemUnderTest.cs

示例5: OwlXmlParser

        /// <summary>
        /// Initializes an instance of the RdfParser class
        /// </summary>
        public OwlXmlParser()
        {
            _owlGraph = null;
            _warnings = new ArrayList();
            _errors = new ArrayList();
            _messages = new ArrayList();
            _newID = 10000;
            _dummyID = 10000;

            string[] rdfXmlAttrs = {"rdf:about", "rdf:resource", "rdf:parseType", "rdf:ID", "rdf:nodeID", "rdf:type", "rdf:datatype", "rdf:value", "xml:lang", "xml:base"};
            _rdfXmlProperties = new Hashtable();
            int len = rdfXmlAttrs.Length;
            for(int i=0;i<len;i++)
                _rdfXmlProperties.Add(rdfXmlAttrs[i],rdfXmlAttrs[i]);

            string[] syntacticElements = {"rdf:RDF", "rdf:ID", "rdf:about", "rdf:resource", "rdf:parseType", "rdf:nodeID"};
            _syntacticElements = new Hashtable();
            len = syntacticElements.Length;
            for(int i=0;i<len;i++)
                _syntacticElements.Add(syntacticElements[i], syntacticElements[i]);

            string[] nonSyntacticElements = {"rdf:type", "rdf:value", "rdf:datatype", "rdf:List", "rdf:first", "rdf:rest", "rdf:nil", "rdfs:comment", "rdfs:subPropertyOf", "rdfs:domain", "rdfs:range", "rdfs:subClassOf", "owl:allValuesFrom", "owl:backwardCompatibleWith", "owl:cardinality", "owl:complementOf", "owl:differentFrom", "owl:disjointWith", "owl:distinctMembers", "owl:equivalentClass", "owl:equivalentProperty", "owl:hasValue", "owl:imports", "owl:incompatibleWith", "owl:intersectionOf", "owl:inverseOf", "owl:maxCardinality", "owl:minCardinality", "owl:oneOf", "owl:onProperty", "owl:priorVersion", "owl:sameAs", "owl:someValuesFrom", "owl:unionOf", "owl:versionInfo"};
            _nonSyntacticElements = new Hashtable();
            len = nonSyntacticElements.Length;
            for(int i=0;i<len;i++)
                _nonSyntacticElements.Add(nonSyntacticElements[i],nonSyntacticElements[i]);

            _declID = new Hashtable();

            StopOnErrors = false;
            StopOnWarnings = false;
        }
开发者ID:ryukinkou,项目名称:IdmTranslateProgram,代码行数:35,代码来源:OwlXmlParser.cs

示例6: PRC_PersonasListasDePrecios

        public DataSet PRC_PersonasListasDePrecios()
        {
            ArrayList Parameters=new ArrayList(0);

            SqlParameter MODOParameter=new SqlParameter("@MODO",SqlDbType.Int);
            MODOParameter.Size=0;
            MODOParameter.Value=MODO;
            Parameters.Add(MODOParameter);

            SqlParameter PersonasListasDePrecios_IDParameter=new SqlParameter("@PersonasListasDePrecios_ID",SqlDbType.Int);
            PersonasListasDePrecios_IDParameter.Size=0;
            PersonasListasDePrecios_IDParameter.Value=PersonasListasDePrecios_ID;
            Parameters.Add(PersonasListasDePrecios_IDParameter);

            SqlParameter Personas_IDParameter=new SqlParameter("@Personas_ID",SqlDbType.Int);
            Personas_IDParameter.Size=0;
            Personas_IDParameter.Value=Personas_ID;
            Parameters.Add(Personas_IDParameter);

            SqlParameter ListasDePrecios_IDParameter=new SqlParameter("@ListasDePrecios_ID",SqlDbType.Int);
            ListasDePrecios_IDParameter.Size=0;
            ListasDePrecios_IDParameter.Value=ListasDePrecios_ID;
            Parameters.Add(ListasDePrecios_IDParameter);

            SqlParameter PersonasDirecciones_IDParameter=new SqlParameter("@PersonasDirecciones_ID",SqlDbType.Int);
            PersonasDirecciones_IDParameter.Size=0;
            PersonasDirecciones_IDParameter.Value=PersonasDirecciones_ID;
            Parameters.Add(PersonasDirecciones_IDParameter);

             DataSet dsResult=ExecuteStoredProcedure("[Grifo].[PRC_PersonasListasDePrecios]",ref Parameters);

            return dsResult;
        }
开发者ID:ANGELCUSI,项目名称:MCHTSIT,代码行数:33,代码来源:PersonasListasDePrecios.cs

示例7: Execute

        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            GamePlayer player = living as GamePlayer;
            if (player != null)
            {
                ArrayList targets = new ArrayList();
                if (player.Group == null)
                    targets.Add(player);
                else
                {
                    foreach (GamePlayer grpplayer in player.Group.GetPlayersInTheGroup())
                    {
                        if (player.IsWithinRadius(grpplayer, SpellRadius) && grpplayer.IsAlive)
                            targets.Add(grpplayer);
                    }
                }
                foreach (GamePlayer target in targets)
                {
                    //send spelleffect
                    if (!target.IsAlive) continue;
                    ValhallasBlessingEffect ValhallasBlessing = target.EffectList.GetOfType<ValhallasBlessingEffect>();
                    if (ValhallasBlessing != null)
                        ValhallasBlessing.Cancel(false);
                    new ValhallasBlessingEffect().Start(target);
                }
            }
            DisableSkill(living);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:34,代码来源:ValhallasBlessingAbility.cs

示例8: GetBoxStatistics

 /// <summary>
 /// Inspects the members of the data Table, focusing on the named field.  It calculates
 /// the median of the values in the named field.
 /// </summary>
 /// <param name="self"></param>
 /// <param name="fieldName"></param>
 /// <returns></returns>
 public static BoxStatistics GetBoxStatistics(this DataTable self, string fieldName)
 {
     DataColumn dc = self.Columns[fieldName];
     ArrayList lst = new ArrayList();
     foreach (DataRow row in self.Rows)
     {
         lst.Add(row[fieldName]);
     }
     lst.Sort();
     BoxStatistics result = new BoxStatistics();
     if (lst.Count % 2 == 0)
     {
         if (dc.DataType == typeof(string))
         {
         }
         // For an even number of items, the mean is the average of the middle two values (after sorting)
         double high = Convert.ToDouble(lst.Count / 2);
         double low = Convert.ToDouble(lst.Count / 2 - 1);
         result.Median = (high + low) / 2;
     }
     else
     {
         result.Median = lst[(int)Math.Floor(lst.Count / (double)2)];
     }
     return result;
 }
开发者ID:DIVEROVIEDO,项目名称:DotSpatial,代码行数:33,代码来源:DataTableStatisticsExt.cs

示例9: CollectScintillaNodes

 public virtual void CollectScintillaNodes(ArrayList list)
 {
     if (_parent == this)
     {
         if (list != null) return;
         list = new ArrayList();
         if (ChildScintilla != null) ChildScintilla.CollectScintillaNodes(list);
     }
     else if (list == null) return;
     ConfigFile cf;
     if (includedFiles != null)
     {
         for (int i = 0 ; i<includedFiles.Length; i++)
         {
             cf = includedFiles[i];
             if (cf == null) continue;
             if (cf.ChildScintilla != null) list.Add(cf.ChildScintilla);
             if( cf.ChildScintilla != null ) cf.ChildScintilla.CollectScintillaNodes(list);
             if( cf.includedFiles != null && cf.includedFiles.Length > 0) cf.CollectScintillaNodes(list);
         }
     }
     if (_parent == this)
     {
         ChildScintilla.includedFiles = new ConfigFile[list.Count];
         list.CopyTo(ChildScintilla.includedFiles);
     }
 }
开发者ID:CamWiseOwl,项目名称:flashdevelop,代码行数:27,代码来源:ConfigFile.cs

示例10: load

        public void load()
        {
            IEnumerable lines = File.ReadLines(this.filename, Encoding.Default);

            this.words = new ArrayList();

            foreach (string line in lines)
            {
                if (line == null)
                    continue;
                if (line.Trim().Equals(""))
                    continue;

                this.words.Add(line);
            }

            string genRegex = "^";
            for (int i = 0; i < (this.words.Count - 1); i++)
            {
                genRegex += this.words[i] + "|";
            }
            genRegex += this.words[this.words.Count - 1] + "$";

            this.cueWordsRegex = new Regex(genRegex, RegexOptions.Compiled);
        }
开发者ID:shereefsakr,项目名称:arabictext-summarizer,代码行数:25,代码来源:CueWords.cs

示例11: BaseGame

        public BaseGame(int id, int roomId, Map map, eRoomType roomType, eGameType gameType, int timeType)
            : base(id, roomType, gameType, timeType)
        {
            m_roomId = roomId;
            m_players = new Dictionary<int, Player>();
            m_turnQueue = new List<TurnedLiving>();
            m_livings = new List<Living>();

            m_random = new Random();

            m_map = map;
            m_actions = new ArrayList();
            PhysicalId = 0;
            BossWarField = "";

            m_tempBox = new List<Box>();
            m_tempPoints = new List<Point>();

            if (roomType == eRoomType.Dungeon)
            {
                Cards = new int[21];
            }
            else
            {
                Cards = new int[8];
            }

            m_gameState = eGameState.Inited;
        }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:29,代码来源:BaseGame.cs

示例12: Data

        public Data(Mobile m)
        {
            c_Mobile = m;

            c_Friends = new ArrayList();
            c_Ignores = new ArrayList();
            c_Messages = new ArrayList();
            c_GIgnores = new ArrayList();
            c_GListens = new ArrayList();
            c_IrcIgnores = new ArrayList();
            c_Sounds = new Hashtable();
            c_PerPage = 10;
            c_SystemC = 0x161;
            c_GlobalMC = 0x26;
            c_GlobalCC = 0x47E;
            c_GlobalGC = 0x44;
            c_GlobalFC = 0x17;
            c_GlobalWC = 0x3;
            c_StaffC = 0x3B4;
            c_MsgC = 0x480;
            c_AwayMsg = "";
            c_Signature = "";
            c_BannedUntil = DateTime.Now;

            if (m.AccessLevel >= AccessLevel.Administrator)
                c_GlobalAccess = true;

            s_Datas[m] = this;

            foreach (Channel c in Channel.Channels)
                if (c.NewChars)
                    c.Join(m);
        }
开发者ID:guy489,项目名称:runuot2a,代码行数:33,代码来源:Data.cs

示例13: GetDiskInfo

 public JsonObject GetDiskInfo()
 {
   try
   {
     var diskinfo = new JsonObject();
     var volumes = new ArrayList();
     foreach (var vi in VolumeInfo.GetVolumes())
     {
       var v = new Hashtable();
       v.Add("root", vi.RootDirectory);
       v.Add("size", vi.TotalSize);
       v.Add("free", vi.TotalFreeSpace);
       v.Add("formatted", vi.IsFormatted);
       v.Add("volumeid", vi.VolumeID);
       v.Add("content", GetRootFolderInfo(vi.RootDirectory));
       volumes.Add(v);
     }
     diskinfo.Add("volumes", volumes);
     return diskinfo;
   }
   catch (Exception ex)
   {
     var error = new JsonObject();
     error.Add("error", ex.ToString());
     error.Add("stacktrace", ex.StackTrace);
     return error;
   }
 }
开发者ID:ricflams,项目名称:Goke.ChickenHouse,代码行数:28,代码来源:HardwareInfo.cs

示例14: NDataReader

		/// <summary>
		/// Creates a NDataReader from a <see cref="IDataReader" />
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader" /> to get the records from the Database.</param>
		/// <param name="isMidstream"><see langword="true" /> if we are loading the <see cref="IDataReader" /> in the middle of reading it.</param>
		/// <remarks>
		/// NHibernate attempts to not have to read the contents of an <see cref="IDataReader"/> into memory until it absolutely
		/// has to.  What that means is that it might have processed some records from the <see cref="IDataReader"/> and will
		/// pick up the <see cref="IDataReader"/> midstream so that the underlying <see cref="IDataReader"/> can be closed 
		/// so a new one can be opened.
		/// </remarks>
		public NDataReader(IDataReader reader, bool isMidstream)
		{
			ArrayList resultList = new ArrayList(2);

			try
			{
				// if we are in midstream of processing a DataReader then we are already
				// positioned on the first row (index=0)
				if (isMidstream)
				{
					currentRowIndex = 0;
				}

				// there will be atleast one result 
				resultList.Add(new NResult(reader, isMidstream));

				while (reader.NextResult())
				{
					// the second, third, nth result is not processed midstream
					resultList.Add(new NResult(reader, false));
				}

				results = (NResult[]) resultList.ToArray(typeof(NResult));
			}
			catch (Exception e)
			{
				throw new ADOException("There was a problem converting an IDataReader to NDataReader", e);
			}
			finally
			{
				reader.Close();
			}
		}
开发者ID:tkellogg,项目名称:NHibernate3-withProxyHooks,代码行数:44,代码来源:NDataReader.cs

示例15: Map

 public override void Map(Channel q, object map_arg) {
   IList retval = new ArrayList();
   IDictionary my_entry = new ListDictionary();
   my_entry["node"] = _node.Address.ToString();
   retval.Add(my_entry);
   q.Enqueue(retval);
 }
开发者ID:twchoi,项目名称:tmp-brunet-deetoo,代码行数:7,代码来源:MapReduceTrace.cs


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