當前位置: 首頁>>代碼示例>>C#>>正文


C# Specialized.StringCollection類代碼示例

本文整理匯總了C#中System.Collections.Specialized.StringCollection的典型用法代碼示例。如果您正苦於以下問題:C# StringCollection類的具體用法?C# StringCollection怎麽用?C# StringCollection使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


StringCollection類屬於System.Collections.Specialized命名空間,在下文中一共展示了StringCollection類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Initialize

 /// <summary>
 /// Receives the old name and the not valid names list
 /// </summary>
 /// <param name="displaySetName"></param>
 /// <param name="notValidNames"></param>
 public void Initialize(string displaySetName, StringCollection notValidNames)
 {
     mName = displaySetName;
     mNotValidNames = notValidNames;
     ApplyMultilanguage();
     LoadValues();
 }
開發者ID:sgon1853,項目名稱:UPM_MDD_Thesis,代碼行數:12,代碼來源:RenameDisplaySetForm.cs

示例2: SplitCamelCase

        /// <summary>
        /// http://weblogs.asp.net/jgalloway/archive/2005/09/27/426087.aspx
        /// </summary>
        public static List<string> SplitCamelCase(this string source)
        {
            if (source == null)
                return new List<string> { }; //Return empty array.

            if (source.Length == 0)
                return new List<string> { "" };

            StringCollection words = new StringCollection();
            int wordStartIndex = 0;

            char[] letters = source.ToCharArray();
            // Skip the first letter. we don't care what case it is.
            for (int i = 1; i < letters.Length; i++)
            {
                if (char.IsUpper(letters[i]))
                {
                    //Grab everything before the current index.
                    words.Add(new String(letters, wordStartIndex, i - wordStartIndex));
                    wordStartIndex = i;
                }
            }

            //We need to have the last word.
            words.Add(new String(letters, wordStartIndex, letters.Length - wordStartIndex));

            //Copy to a string array.
            string[] wordArray = new string[words.Count];
            words.CopyTo(wordArray, 0);

            List<string> stringList = new List<string>();
            stringList.AddRange(wordArray);
            return stringList;
        }
開發者ID:neutmute,項目名稱:TailTool,代碼行數:37,代碼來源:StringExtensions.cs

示例3: CDEntry

 public CDEntry(StringCollection data)
 {
     if (!Parse(data))
     {
         throw new Exception("Unable to Parse CDEntry.");
     }
 }
開發者ID:phlegma,項目名稱:TagMotion,代碼行數:7,代碼來源:CDEntry.cs

示例4: CFileFound

 public CFileFound(string in_Hash, string in_Name, uint in_Size, uint in_Avaibility, string in_codec,string in_length,uint in_bitrate, bool in_complete, uint in_ip, ushort in_port)
 {
     this.Hash=in_Hash;
     this.Name=in_Name;
     this.Size=in_Size;
     this.Avaibility=in_Avaibility;
     Codec=in_codec;
     BitRate=in_bitrate;
     Length=in_length;
     Complete=in_complete;
     this.OtherNames=new StringCollection();
     this.OtherNames.Add(Name);
     CElement element=CKernel.FilesList[CKernel.StringToHash(in_Hash)];
     if (element==null)
         ResultState=Types.Constants.SearchResultState.New;
     else if (element.File.FileStatus==Protocol.FileState.Complete)
         ResultState=Types.Constants.SearchResultState.AlreadyDownloaded;
     else
         ResultState=Types.Constants.SearchResultState.AlreadyDownloading;
     if ((in_ip>Protocol.LowIDLimit)&&(in_port>0)&&(in_port<ushort.MaxValue))
     {
         Sources=new Hashtable();
         Sources.Add(in_ip,in_port);
         //Debug.WriteLine(in_ip.ToString()+":"+in_port.ToString());
         if ((element!=null)&&(element.File.FileStatus==Protocol.FileState.Ready))
             CKernel.ClientsList.AddClientToFile(in_ip,in_port,0,0,element.File.FileHash);
     }
 }
開發者ID:sonicwang1989,項目名稱:lphant,代碼行數:28,代碼來源:Search.cs

示例5: PeekrPop2006

        ///<summary>
        ///</summary>
        public PeekrPop2006()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            // Source Queues
            mqServerName.Items.Clear();
            queueName.Items.Clear();

            // Target Queues
            targetServerCombo.Items.Clear();
            targetQueueCombo.Items.Clear();
            targetQueue2.Items.Clear();

            // Source Machine Names
            StringCollection sc = new StringCollection ();
            sc.Add ("VDC3APP0006");
            sc.Add ("localhost");

            foreach (string s in sc)
            {
                mqServerName.Items.Add (s);
                targetServerCombo.Items.Add (s);
            }
        }
開發者ID:raveller,項目名稱:raveller,代碼行數:29,代碼來源:PeekrPop2006.cs

示例6: SplitUpperCase

        public static string[] SplitUpperCase(this string source)
        {
            if (source == null)
                return new string[] {}; //Return empty array.

            if (source.Length == 0)
                return new[] {""};

            var words = new StringCollection();
            int wordStartIndex = 0;

            char[] letters = source.ToCharArray();
            char previousChar = char.MinValue;
            // Skip the first letter. we don't care what case it is.
            for (int i = 1; i < letters.Length; i++)
            {
                if (char.IsUpper(letters[i]) && !char.IsWhiteSpace(previousChar))
                {
                    //Grab everything before the current index.
                    words.Add(new String(letters, wordStartIndex, i - wordStartIndex));
                    wordStartIndex = i;
                }
                previousChar = letters[i];
            }
            //We need to have the last word.
            words.Add(new String(letters, wordStartIndex, letters.Length - wordStartIndex));

            //Copy to a string array.
            var wordArray = new string[words.Count];
            words.CopyTo(wordArray, 0);
            return wordArray;
        }
開發者ID:CamiCasus,項目名稱:FiguraManager,代碼行數:32,代碼來源:StringExtensions.cs

示例7: generate

        /// <summary>
        /// Generate statistics file
        /// </summary>
        /// <returns></returns>
        public StringCollection generate()
        {                                
            #region delete all older files (of the same type) for this questionnaire to clean temp-Directory
            try
            {
                foreach (string file in Directory.GetFiles(pathtotempdir, "RFG_report_statistic_*"))
                {
                    File.Delete(file);
                }                
            }
            catch (Exception ex)
            {
                string dummy = ex.ToString();
            }
            #endregion
            
            int statistics_records = -1;
            List<string> files_names = new List<string>();
            statistics_records = ReportingFacade.Format(from, until, ordering, row_number, pathtotempdir,Company_Code, ref files_names);                   

            StringCollection retvals = new StringCollection();
            retvals.Add(statistics_records.ToString());
            foreach (String file in files_names)
                retvals.Add(file);
            return retvals;
        }
開發者ID:amalapannuru,項目名稱:RFC,代碼行數:30,代碼來源:process_statistics.cs

示例8: CheckFileNameUsingPaths

 private static bool CheckFileNameUsingPaths(string fileName, StringCollection paths, out string fullFileName)
 {
     fullFileName = null;
     string str = fileName.Trim(new char[] { '"' });
     FileInfo info = new FileInfo(str);
     if (str.Length != info.Name.Length)
     {
         if (info.Exists)
         {
             fullFileName = info.FullName;
         }
         return info.Exists;
     }
     using (StringEnumerator enumerator = paths.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             string str3 = enumerator.Current + Path.DirectorySeparatorChar + str;
             FileInfo info2 = new FileInfo(str3);
             if (info2.Exists)
             {
                 fullFileName = str3;
                 return true;
             }
         }
     }
     return false;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:28,代碼來源:XomlCompilerHelper.cs

示例9: ConvertFrom

        /// <summary>
        ///   Converts the given object to a StringCollection.
        /// </summary>
        /// <param name="context">An ITypeDescriptorContext that provides a format context.</param>
        /// <param name="culture">The CultureInfo to use as the current culture.</param>
        /// <param name="value">The object to convert.</param>
        /// <returns>A StringCollection converted from value.</returns>
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            string valueAsStr = value as string;
            if (valueAsStr != null)
            {
                string str = valueAsStr.Trim();
                if (str.Length == 0)
                {
                    return null;
                }

                char ch = ',';
                if (culture != null)
                {
                    ch = culture.TextInfo.ListSeparator[0];
                }
                string[] strings = str.Split(ch);
                StringCollection stringCollection = new StringCollection();
                foreach (string s in strings)
                {
                    stringCollection.Add(s);
                }

                return stringCollection;
            }

            return base.ConvertFrom(context, culture, value);
        }
開發者ID:kasicass,項目名稱:kasicass,代碼行數:35,代碼來源:StringCollectionConverter.cs

示例10: ParseParameters

        /// <summary>
        /// Parses the parameters portion of the message.
        /// </summary>
        protected override void ParseParameters( StringCollection parameters )
        {
            base.ParseParameters( parameters );
            this.Users.Clear();
            String[] userInfo = parameters[ parameters.Count - 1 ].Split( ' ' );
            foreach ( String info in userInfo )
            {
                String nick = info.Substring( 0, info.IndexOf( "=", StringComparison.Ordinal ) );
                Boolean oper = false;
                if ( nick.EndsWith( "*", StringComparison.Ordinal ) )
                {
                    oper = true;
                    nick = nick.Substring( 0, nick.Length - 1 );
                }
                String away = info.Substring( info.IndexOf( "=", StringComparison.Ordinal ) + 1, 1 );
                String standardHost = info.Substring( info.IndexOf( away, StringComparison.Ordinal ) );

                User user = new User();
                user.Parse( standardHost );
                user.Nick = nick;
                user.IrcOperator = oper;
                user.OnlineStatus = ( away == "+" ) ? UserOnlineStatus.Away : UserOnlineStatus.Online;

                this.Users.Add( user );
            }
        }
開發者ID:WhiteCoreSim,項目名稱:WhiteCore-Optional-Modules,代碼行數:29,代碼來源:UserHostReplyMessage.cs

示例11: readBrainFile

        //read brain file from disc
        protected StringCollection readBrainFile()
        {
            StringCollection sc = new StringCollection();
            if(File.Exists(filePath))
            {
               	FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
               	StreamReader rs = new StreamReader(fs);
               	string line;
               	while ((line = rs.ReadLine()) != null)
                {
               		sc.Add(line);
               	}
               	rs.Close();
               	fs.Close();
            }
            else
            {
                MessageBox.Show("No mind file found, creating new one");
                FileStream cs = File.Create(filePath);
                cs.Close();
                FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
               	StreamReader rs = new StreamReader(fs);
               	string line;
               	while ((line = rs.ReadLine()) != null)
                {
               		sc.Add(line);
               	}
               	rs.Close();
               	fs.Close();

            }
            return sc;
        }
開發者ID:sanyaade-g2g-repos,項目名稱:prelude-csharp,代碼行數:34,代碼來源:Brain.cs

示例12: GetSectionNames

 public static StringCollection GetSectionNames(
     String filename)
 {
     StringCollection sections = new StringCollection();
     byte[] buffer = new byte[32768];
     int bufLen = 0;
     bufLen = GetPrivateProfileSectionNames(buffer,
         buffer.GetUpperBound(0), filename);
     if (bufLen > 0)
     {
         StringBuilder sb = new StringBuilder();
         for (int i = 0; i < bufLen; i++)
         {
             if (buffer[i] != 0)
             {
                 sb.Append((char)buffer[i]);
             }
             else
             {
                 if (sb.Length > 0)
                 {
                     sections.Add(sb.ToString());
                     sb = new StringBuilder();
                 }
             }
         }
     }
     return sections;
 }
開發者ID:RavenB,項目名稱:Earth-and-Beyond-server,代碼行數:29,代碼來源:IniUtility.cs

示例13: AddFile

 internal static void AddFile(StringCollection files)
 {
     SelectedItem selectedItem = VSIHelper.DTE2.SelectedItems.Item(1);
     ProjectItems projectItems = null;
     if (selectedItem.Project != null && selectedItem.ProjectItem == null)
     {
         projectItems = selectedItem.Project.ProjectItems;
     }
     if (selectedItem.Project == null && selectedItem.ProjectItem != null)
     {
         projectItems = selectedItem.ProjectItem.ProjectItems;
     }
     if (projectItems != null)
     {
         ProjectItem lastItem = null;
         foreach (var file in files)
         {
             try
             {
                 lastItem = projectItems.AddFromFileCopy(file);
             }
             catch { }
         }
         if (lastItem != null)
         {
             VSIHelper.DTE2.ItemOperations.OpenFile(lastItem.get_FileNames(1), EnvDTE.Constants.vsViewKindPrimary);
         }
     }
 }
開發者ID:hhahh2011,項目名稱:CH.EasyCode,代碼行數:29,代碼來源:SolutionHelper.cs

示例14: Page_Load

		protected void Page_Load(object sender, EventArgs e)
		{
			// Initialise data table to hold test results
			m_results.Columns.Add("test");
			m_results.Columns.Add("result");
            m_results.Columns.Add("time");
			m_results.Columns.Add("message");
			m_results.Columns.Add("class");

			// Initialise controls
			lblResult.Text = "";
			ltlStats.Text = "";

			// Initialise NUnit
			CoreExtensions.Host.InitializeService();

			// Find tests in current assembly
			TestPackage package = new TestPackage(Assembly.GetExecutingAssembly().Location);
			m_testSuite = new TestSuiteBuilder().Build(package);

			if (!IsPostBack)
			{
				// Display category filters
				StringCollection coll = new StringCollection();
				GetCategories((TestSuite)m_testSuite, coll);
				string[] cats = new string[coll.Count];
				coll.CopyTo(cats, 0);
				Array.Sort(cats);
				cblCategories.DataSource = cats;
				cblCategories.DataBind();
			}
		}
開發者ID:KerwinMa,項目名稱:WeBlog,代碼行數:32,代碼來源:Test.aspx.cs

示例15: AddinRegistry

		internal AddinRegistry (string registryPath, string startupDirectory)
		{
			basePath = Util.GetFullPath (registryPath);
			database = new AddinDatabase (this);
			addinDirs = new StringCollection ();
			addinDirs.Add (Path.Combine (basePath, "addins"));
		}
開發者ID:AminBonyadUni,項目名稱:facedetect-f-spot,代碼行數:7,代碼來源:AddinRegistry.cs


注:本文中的System.Collections.Specialized.StringCollection類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。