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


C# Collections.Hashtable类代码示例

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


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

示例1: DVCore

 public DVCore(DoubleVisionForm owner)
 {
     lst_dvf_FileList = new List<DVFile>();
     m_hashtableResults = new System.Collections.Hashtable();
     que_str_Locations = new Queue<String>();
     dvf_Form = owner;
 }
开发者ID:emadhura,项目名称:doublesnap,代码行数:7,代码来源:DVCore.cs

示例2: Flush

		public override void  Flush(System.Collections.IDictionary threadsAndFields, SegmentWriteState state)
		{
			lock (this)
			{
				
				if (tvx != null)
				{
					
					if (state.numDocsInStore > 0)
					// In case there are some final documents that we
					// didn't see (because they hit a non-aborting exception):
						Fill(state.numDocsInStore - docWriter.GetDocStoreOffset());
					
					tvx.Flush();
					tvd.Flush();
					tvf.Flush();
				}

                System.Collections.IEnumerator it = new System.Collections.Hashtable(threadsAndFields).GetEnumerator();
				while (it.MoveNext())
				{
					System.Collections.DictionaryEntry entry = (System.Collections.DictionaryEntry) it.Current;
					System.Collections.IEnumerator it2 = ((System.Collections.ICollection) entry.Value).GetEnumerator();
					while (it2.MoveNext())
					{
						TermVectorsTermsWriterPerField perField = (TermVectorsTermsWriterPerField) ((System.Collections.DictionaryEntry) it2.Current).Key;
						perField.termsHashPerField.Reset();
						perField.ShrinkHash();
					}
					
					TermVectorsTermsWriterPerThread perThread = (TermVectorsTermsWriterPerThread) entry.Key;
					perThread.termsHashPerThread.Reset(true);
				}
			}
		}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:35,代码来源:TermVectorsTermsWriter.cs

示例3: ImageFile

		static ImageFile ()
		{
			name_table = new System.Collections.Hashtable ();
			name_table [".svg"] = typeof (FSpot.Svg.SvgFile);
			name_table [".gif"] = typeof (ImageFile);
			name_table [".bmp"] = typeof (ImageFile);
			name_table [".jpeg"] = typeof (JpegFile);
			name_table [".jpg"] = typeof (JpegFile);
			name_table [".png"] = typeof (FSpot.Png.PngFile);
			name_table [".cr2"] = typeof (FSpot.Tiff.Cr2File);
			name_table [".nef"] = typeof (FSpot.Tiff.NefFile);
			name_table [".pef"] = typeof (FSpot.Tiff.NefFile);
			name_table [".raw"] = typeof (FSpot.Tiff.NefFile);
			name_table [".kdc"] = typeof (FSpot.Tiff.NefFile);
			name_table [".arw"] = typeof (FSpot.Tiff.NefFile);
			name_table [".tiff"] = typeof (FSpot.Tiff.TiffFile);
			name_table [".tif"] = typeof (FSpot.Tiff.TiffFile);
			name_table [".orf"] =  typeof (FSpot.Tiff.NefFile);
			name_table [".srf"] = typeof (FSpot.Tiff.NefFile);
			name_table [".dng"] = typeof (FSpot.Tiff.DngFile);
			name_table [".crw"] = typeof (FSpot.Ciff.CiffFile);
			name_table [".ppm"] = typeof (FSpot.Pnm.PnmFile);
			name_table [".mrw"] = typeof (FSpot.Mrw.MrwFile);
			name_table [".raf"] = typeof (FSpot.Raf.RafFile);
			name_table [".x3f"] = typeof (FSpot.X3f.X3fFile);
		}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:26,代码来源:ImageFile.cs

示例4: FreeTabCtrl

        public FreeTabCtrl()
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            UpdateStyles();

            InitializeComponent();

            if (normalImage == null)
            {
                hoverImage = FreeTab.Properties.Resources.tab_hover;
                normalImage = FreeTab.Properties.Resources.tab_normal;
                focusedImage = FreeTab.Properties.Resources.tab_pushed;
            }

            this.TabPanel.Location = this.Location;

            this.TabContent.Location = new Point(this.Location.X,
                  this.Location.Y + normalImage.Height + top_padding);

            tabArray = new System.Collections.ArrayList();
            tabHash = new System.Collections.Hashtable();
            normal_height = normalImage.Height - click_stretch*2;
            normal_Y = this.TabContent.Location.Y - normal_height;

            this.Resize += new EventHandler(FreeTabCtrl_Resize);

            //setActivate(0);
        }
开发者ID:AntBean,项目名称:FreeNetUI,代码行数:29,代码来源:FreeTabCtrl.cs

示例5: GetMessager

		/// <summary>
		/// Gets an instance of a <see cref="Messager"/> to use to talk to the running instance of the client.
		/// </summary>
		/// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
		/// <param name="p_gmdGameModeInfo">The descriptor of the game mode for which mods are being managed.</param>
		/// <returns>An instance of a <see cref="Messager"/> to use to talk to the running instance of the client,
		/// or <c>null</c> if no valid <see cref="Messager"/> could be created.</returns>
		public static IMessager GetMessager(EnvironmentInfo p_eifEnvironmentInfo, IGameModeDescriptor p_gmdGameModeInfo)
		{
			if (m_cchMessagerChannel == null)
			{
				System.Collections.IDictionary properties = new System.Collections.Hashtable();
				properties["exclusiveAddressUse"] = false;
				m_cchMessagerChannel = new IpcClientChannel();
				ChannelServices.RegisterChannel(m_cchMessagerChannel, true);
			}
			else
				throw new InvalidOperationException("The IPC Channel has already been created as a CLIENT.");

			string strMessagerUri = String.Format("ipc://{0}-{1}IpcServer/{1}Listener", p_eifEnvironmentInfo.Settings.ModManagerName, p_gmdGameModeInfo.ModeId);
			IMessager msgMessager = null;
			try
			{
				Trace.TraceInformation(String.Format("Getting listener on: {0}", strMessagerUri));
				msgMessager = (IMessager)Activator.GetObject(typeof(IMessager), strMessagerUri);

				//Just because a messager has been returned, dosn't mean it exists.
				//All you've really done at this point is create an object wrapper of type "Messager" which has the same methods, properties etc...
				//You wont know if you've got a real object, until you invoke something, hence the post (Power on self test) method.
				msgMessager.Post();
			}
			catch (RemotingException e)
			{
				Trace.TraceError("Could not get Messager: {0}", strMessagerUri);
				TraceUtil.TraceException(e);
				return null;
			}
			return new MessagerClient(msgMessager);
		}
开发者ID:etinquis,项目名称:nexusmodmanager,代码行数:39,代码来源:MessagerClient.cs

示例6: Add

        /// <summary>
        /// 添加CC_Movement对象(即:一条记录)
        /// </summary>
        public int Add(CC_Movement cC_Movement)
        {
            string sql = "INSERT INTO CC_Movement () VALUES ()";

            int Re = 0;
            //SQL日志记录
            var RunMethod = System.Reflection.MethodBase.GetCurrentMethod();
            System.Collections.Hashtable param = new System.Collections.Hashtable();
            string Ex = string.Empty;
            foreach (System.Collections.DictionaryEntry item in idb.GetParameters())
            {
                  param.Add(item.Key, item.Value);
            }

            try
            {
                Re = idb.ExeCmd(sql);
                Ex = Re.ToString();
            }
            catch (Exception ex)
            {
                Ex = ex.Message;
            }
            finally
            {
                SysRunLog.InsertRunSql(sql, param, RunMethod.DeclaringType +"." + RunMethod.Name,Ex);
             }            return Re;
        }
开发者ID:youthjoy,项目名称:cshelper,代码行数:31,代码来源:ADOCC_Movement.cs

示例7: UserControlFolderSelector

        public UserControlFolderSelector()
        {
            InitializeComponent();
            m_VisitedDirsPaths = new System.Collections.Hashtable();
            m_ActivPath = "";

            ///
            /// Load user preferencies
            ///
            try
            {
                if (string.IsNullOrEmpty(  Properties.Settings.Default.LastUsedPath ) == false
                    && new DirectoryInfo(Properties.Settings.Default.LastUsedPath).Exists)
                {
                    ActualPath = Properties.Settings.Default.LastUsedPath;
                }

                if (Properties.Settings.Default.VisitedPaths != null
                    && Properties.Settings.Default.VisitedPaths.Count > 0)
                {
                    int i = 0;
                    string[] paths = new string[Properties.Settings.Default.VisitedPaths.Count];
                    foreach (string path in Properties.Settings.Default.VisitedPaths)
                    {
                        paths[i++] = path;
                    }
                    Paths = paths;
                }
            }
            catch { }
        }
开发者ID:tombobadil,项目名称:mp3tagrenamer,代码行数:31,代码来源:UserControlFolderSelector.cs

示例8: Bits

        public override System.Collections.BitArray Bits(IndexReader reader)
        {
            if (cache == null)
            {
                cache = new System.Collections.Hashtable();
            }

            lock (cache.SyncRoot)
            {
                // check cache
                System.Collections.BitArray cached = (System.Collections.BitArray) cache[reader];
                if (cached != null)
                {
                    return cached;
                }
            }

            System.Collections.BitArray bits = new System.Collections.BitArray((reader.MaxDoc() % 64 == 0?reader.MaxDoc() / 64:reader.MaxDoc() / 64 + 1) * 64);

            new IndexSearcher(reader).Search(query, new AnonymousClassHitCollector(bits, this));

            lock (cache.SyncRoot)
            {
                // update cache
                cache[reader] = bits;
            }

            return bits;
        }
开发者ID:karino2,项目名称:wikipediaconv,代码行数:29,代码来源:QueryFilter.cs

示例9: GetWordSet

		/// <summary> Loads a text file and adds every line as an entry to a HashSet (omitting
		/// leading and trailing whitespace). Every line of the file should contain only 
		/// one word. The words need to be in lowercase if you make use of an
		/// Analyzer which uses LowerCaseFilter (like GermanAnalyzer).
		/// 
		/// </summary>
		/// <param name="wordfile">File containing the wordlist
		/// </param>
		/// <returns> A HashSet with the file's words
		/// </returns>
		public static System.Collections.Hashtable GetWordSet(System.IO.FileInfo wordfile)
		{
			System.Collections.Hashtable result = new System.Collections.Hashtable();
			System.IO.StreamReader freader = null;
			System.IO.StreamReader lnr = null;
			try
			{
				freader = new System.IO.StreamReader(wordfile.FullName, System.Text.Encoding.Default);
				lnr = new System.IO.StreamReader(freader.BaseStream, freader.CurrentEncoding);
				System.String word = null;
				while ((word = lnr.ReadLine()) != null)
				{
                    System.String trimedWord = word.Trim();
					result.Add(trimedWord, trimedWord);
				}
			}
			finally
			{
				if (lnr != null)
					lnr.Close();
				if (freader != null)
					freader.Close();
			}
			return result;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:35,代码来源:WordlistLoader.cs

示例10: RunExample

		public static void RunExample(String[] arg)
		{
			try
			{
				//Create a new JSch instance
				JSch jsch=new JSch();
			
				//Prompt for username and server host
				Console.WriteLine("Please enter the user and host info at the popup window...");
				String host = InputForm.GetUserInput
					("Enter [email protected]",
					Environment.UserName+"@localhost");
				String user=host.Substring(0, host.IndexOf('@'));
				host=host.Substring(host.IndexOf('@')+1);

				//Create a new SSH session
				Session session=jsch.getSession(user, host, 22);

				// username and password will be given via UserInfo interface.
				UserInfo ui=new MyUserInfo();
				session.setUserInfo(ui);

				//Add AES128 as default cipher in the session config store
				System.Collections.Hashtable config=new System.Collections.Hashtable();
				config.Add("cipher.s2c", "aes128-cbc,3des-cbc");
				config.Add("cipher.c2s", "aes128-cbc,3des-cbc");
				session.setConfig(config);

				//Connect to remote SSH server
				session.connect();			

				//Open a new Shell channel on the SSH session
				Channel channel=session.openChannel("shell");

				//Redirect standard I/O to the SSH channel
				channel.setInputStream(Console.OpenStandardInput());
				channel.setOutputStream(Console.OpenStandardOutput());

				//Connect the channel
				channel.connect();

				Console.WriteLine("-- Shell channel is connected using the {0} cipher", 
					session.getCipher());

				//Wait till channel is closed
				while(!channel.isClosed())
				{
					System.Threading.Thread.Sleep(500);
				}

				//Disconnect from remote server
				channel.disconnect();
				session.disconnect();			

			}
			catch(Exception e)
			{
				Console.WriteLine(e.Message);
			}
		}
开发者ID:stux2000,项目名称:dokan,代码行数:60,代码来源:AES.cs

示例11: Initialize

		private static void  Initialize()
		{
			VALUE_TO_ECI = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable(29));
			NAME_TO_ECI = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable(29));
			// TODO figure out if these values are even right!
			addCharacterSet(0, "Cp437");
			addCharacterSet(1, new System.String[]{"ISO8859_1", "ISO-8859-1"});
			addCharacterSet(2, "Cp437");
			addCharacterSet(3, new System.String[]{"ISO8859_1", "ISO-8859-1"});
			addCharacterSet(4, "ISO8859_2");
			addCharacterSet(5, "ISO8859_3");
			addCharacterSet(6, "ISO8859_4");
			addCharacterSet(7, "ISO8859_5");
			addCharacterSet(8, "ISO8859_6");
			addCharacterSet(9, "ISO8859_7");
			addCharacterSet(10, "ISO8859_8");
			addCharacterSet(11, "ISO8859_9");
			addCharacterSet(12, "ISO8859_10");
			addCharacterSet(13, "ISO8859_11");
			addCharacterSet(15, "ISO8859_13");
			addCharacterSet(16, "ISO8859_14");
			addCharacterSet(17, "ISO8859_15");
			addCharacterSet(18, "ISO8859_16");
			addCharacterSet(20, new System.String[]{"SJIS", "Shift_JIS"});
		}
开发者ID:marinehero,项目名称:ThinkAway.net,代码行数:25,代码来源:CharacterSetECI.cs

示例12: TestStopList

		public virtual void  TestStopList()
		{
			System.Collections.Hashtable stopWordsSet = new System.Collections.Hashtable();
			stopWordsSet.Add("good", "good");
			stopWordsSet.Add("test", "test");
			stopWordsSet.Add("analyzer", "analyzer");

            // {{Aroush  how can we copy 'stopWordsSet' to 'System.String[]'?
            System.String[] arrStopWordsSet = new System.String[3];
            arrStopWordsSet[0] = "good";
            arrStopWordsSet[1] = "test";
            arrStopWordsSet[2] = "analyzer";
            // Aroush}}

			StopAnalyzer newStop = new StopAnalyzer(arrStopWordsSet);
			System.IO.StringReader reader = new System.IO.StringReader("This is a good test of the english stop analyzer");
			TokenStream stream = newStop.TokenStream("test", reader);
			Assert.IsTrue(stream != null);
			Token token = null;
			try
			{
				while ((token = stream.Next()) != null)
				{
					System.String text = token.TermText();
					Assert.IsTrue(stopWordsSet.Contains(text) == false);
				}
			}
			catch (System.IO.IOException e)
			{
				Assert.IsTrue(false);
			}
		}
开发者ID:runefs,项目名称:Marvin,代码行数:32,代码来源:TestStopAnalyzer.cs

示例13: VisualEnvironmentCompiler

 public VisualEnvironmentCompiler(InvokeDegegate beginInvoke, 
     SetFlagDelegate setCompilingButtonsEnabled, SetFlagDelegate setCompilingDebugEnabled, SetTextDelegate setStateText, 
     SetTextDelegate addTextToCompilerMessages, ToolStripMenuItem pluginsMenuItem, 
     ToolStrip pluginsToolStrip, ExecuteSourceLocationActionDelegate ExecuteSLAction, 
     ExecuteVisualEnvironmentCompilerActionDelegate ExecuteVECAction,
     PascalABCCompiler.Errors.ErrorsStrategyManager ErrorsManager, RunManager RunnerManager, DebugHelper DebugHelper,UserOptions UserOptions,System.Collections.Hashtable StandartDirectories,
     Dictionary<string, CodeFileDocumentControl> OpenDocuments, IWorkbench workbench)
 {
     this.StandartDirectories = StandartDirectories;
     this.ErrorsManager = ErrorsManager;
     this.ChangeVisualEnvironmentState += new ChangeVisualEnvironmentStateDelegate(onChangeVisualEnvironmentState);
     SetCompilingButtonsEnabled = setCompilingButtonsEnabled;
     SetDebugButtonsEnabled = setCompilingDebugEnabled;
     SetStateText = setStateText;
     AddTextToCompilerMessages = addTextToCompilerMessages;
     this.beginInvoke = beginInvoke;
     this.ExecuteSLAction=ExecuteSLAction;
     this.ExecuteVECAction = ExecuteVECAction;
     PluginsMenuItem = pluginsMenuItem;
     PluginsToolStrip = pluginsToolStrip;
     PluginsController = new VisualPascalABCPlugins.PluginsController(this, PluginsMenuItem, PluginsToolStrip, workbench);
     this.RunnerManager = RunnerManager;
     this.DebugHelper = DebugHelper;
     DebugHelper.Starting += new DebugHelper.DebugHelperActionDelegate(DebugHelper_Starting);
     DebugHelper.Exited += new DebugHelper.DebugHelperActionDelegate(DebugHelper_Exited);
     RunnerManager.Starting += new RunManager.RunnerManagerActionDelegate(RunnerManager_Starting);
     RunnerManager.Exited += new RunManager.RunnerManagerActionDelegate(RunnerManager_Exited);
     this.CodeCompletionParserController = WorkbenchServiceFactory.CodeCompletionParserController;
     this.CodeCompletionParserController.visualEnvironmentCompiler = this;
     this.UserOptions = UserOptions;
     this.OpenDocuments = OpenDocuments;
 }
开发者ID:Slav76,项目名称:pascalabcnet,代码行数:32,代码来源:VisualEnvironmentCompiler.cs

示例14: Init

 public void Init()
 {
     mohidWaterEngineWrapper = new MohidWaterEngineWrapper();
     System.Collections.Hashtable ht = new System.Collections.Hashtable();
     ht.Add("FilePath", @"D:\MohidProjects\Studio\20_OpenMI\Sample Estuary\exe\nomfich.dat");
     mohidWaterEngineWrapper.Initialize(ht);
 }
开发者ID:JauchOnGitHub,项目名称:mohid.codeplex,代码行数:7,代码来源:MohidWaterEngineTests.cs

示例15: Start

        /// <summary>
        /// Sets up the services remoting channel
        /// </summary>
        public void Start()
        {
            try
            {
                System.Collections.Hashtable props = new System.Collections.Hashtable();
                props["typeFilterLevel"] = "Full";

                // Both formatters only use the typeFilterLevel property
                BinaryClientFormatterSinkProvider cliFormatter = new BinaryClientFormatterSinkProvider(props, null);
                BinaryServerFormatterSinkProvider srvFormatter = new BinaryServerFormatterSinkProvider(props, null);

                // The channel requires these to be set that it can found by name by clients
                props["name"] = "SyslogConsole";
                props["portName"] = "SyslogConsole";
                props["authorizedGroup"] = "Everyone";

                // Create the channel
                channel = new IpcChannel(props, cliFormatter, srvFormatter);
                channel.IsSecured = false;

                // Register the channel in the Windows IPC list
                ChannelServices.RegisterChannel(channel, false);

                // Register the channel for remoting use
                RemotingConfiguration.RegisterWellKnownServiceType(typeof(ClientMethods), "Server", WellKnownObjectMode.Singleton);

                // Assign the event to a handler
                Listener.MessageReceived += new Listener.MessageReceivedEventHandler(Listener_MessageReceived);
            }
            catch (Exception ex)
            {
                EventLogger.LogEvent("Could not create a named pipe because: " + ex.Message + Environment.NewLine + "Communication with the GUI console will be disabled.",
                    System.Diagnostics.EventLogEntryType.Warning);
            }
        }
开发者ID:ststeiger,项目名称:SyslogSharp,代码行数:38,代码来源:Server.cs


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