Add() public method

public Add ( string value ) : int
value string
return int
Ejemplo n.º 1
0
 public static StringCollection Explode(string path)
 {
     int num2;
     StringCollection strings = new StringCollection();
     int startIndex = 0;
 Label_0008:
     num2 = path.IndexOf(SeparatorChar, startIndex);
     if (num2 >= 0)
     {
         if (startIndex == num2)
         {
             strings.Add(Separator);
             startIndex = num2 + 1;
         }
         else
         {
             strings.Add(path.Substring(startIndex, num2 - startIndex));
             startIndex = num2;
         }
         goto Label_0008;
     }
     if (startIndex < path.Length)
     {
         strings.Add(path.Substring(startIndex));
     }
     return strings;
 }
        //
        // <



        private static string[] ParseMultiValue(string value) {
            StringCollection tempStringCollection = new StringCollection();

            bool inquote = false;
            int chIndex = 0;
            char[] vp = new char[value.Length];
            string singleValue;

            for (int i = 0; i < value.Length; i++) {
                if (value[i] == '\"') {
                    inquote = !inquote;
                }
                else if ((value[i] == ',') && !inquote) {
                    singleValue = new string(vp, 0, chIndex);
                    tempStringCollection.Add(singleValue.Trim());
                    chIndex = 0;
                    continue;
                }
                vp[chIndex++] = value[i];
            }

            //
            // Now add the last of the header values to the stringtable.
            //

            if (chIndex != 0) {
                singleValue = new string(vp, 0, chIndex);
                tempStringCollection.Add(singleValue.Trim());
            }

            string[] stringArray = new string[tempStringCollection.Count];
            tempStringCollection.CopyTo(stringArray, 0) ;
            return stringArray;
        }
Ejemplo n.º 3
0
        //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;
        }
Ejemplo n.º 4
0
        /// <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;
        }
 static void Main(string[] args)
 {
     System.Collections.Specialized.StringCollection stringCollection = new System.Collections.Specialized.StringCollection();
     String[] Cities = new String[] { "Hyderabad", "Delhi", "Mumbai", "Banglore", "Chennai", "Kolkatta" };
     stringCollection.AddRange(Cities);
     // Display the contents of the collection using foreach.
     Console.WriteLine("Displays the elements using foreach:");
     foreach (String obj in stringCollection)
     {
         Console.WriteLine("   {0}", obj);
     }
     Console.WriteLine();
     stringCollection.Add("Pune");
     stringCollection.Add("Vizag");
     stringCollection.Remove("Chennai");
     Console.WriteLine("After Updating Collection:");
     foreach (String obj in stringCollection)
     {
         Console.WriteLine("   {0}", obj);
     }
     Console.WriteLine();
     // Copy the collection to a new array starting at index 0.
     String[] CitiesArray = new String[stringCollection.Count];
     stringCollection.CopyTo(CitiesArray, 0);
     Console.WriteLine("The new array contains:");
     for (int i = 0; i < CitiesArray.Length; i++)
     {
         Console.WriteLine("   [{0}] {1}", i, CitiesArray[i]);
     }
     Console.WriteLine();
     Console.ReadLine();
 }
Ejemplo n.º 6
0
        private static void AddElementToStringCollection(IElement element, ref StringCollection stringCollection,
            int currentLevel, string prefix, bool isLast)
        {
            if (currentLevel == 0)
                stringCollection.Add(element.ToString());
            else
            {
                stringCollection.Add(prefix + "|_" + element);

                if (isLast && element.ChildrenCount == 0)
                    stringCollection.Add(prefix);

                if (isLast)
                    prefix += "   ";
                else
                    prefix += "|  ";
            }

            for (int childIndex = 0; childIndex < element.ChildrenCount; childIndex++)
            {
                IElement child = element[childIndex];
                AddElementToStringCollection(child, ref stringCollection, currentLevel + 1, prefix,
                    childIndex == element.ChildrenCount - 1);
            }
        }
Ejemplo n.º 7
0
        public void ClipboardFetchFilesItemTest()
        {
            string file1 = Path.GetTempFileName();
            string file2 = Path.GetTempFileName();

            var dummyFiles = new StringCollection();

            dummyFiles.Add(file1);
            dummyFiles.Add(file2);

            Clipboard.Clear();
            Clipboard.SetFileDropList(dummyFiles);

            StringCollection copiedList = Clipboard.GetFileDropList();
            Assert.AreEqual(copiedList.Count, dummyFiles.Count);

            var factory = new ClipboardFileFactory();

            var item = factory.CreateNewClipboardItem(IntPtr.Zero) as ClipboardFileCollection;
            Assert.IsNotNull(item);

            Assert.AreEqual(item.Paths.Count(), 2);

            List<string> localList = item.Paths.ToList();

            for (int i = 0; i < localList.Count; i++)
            {
                Assert.AreEqual(localList[i], dummyFiles[i]);
            }

            File.Delete(file1);
            File.Delete(file2);
        }
Ejemplo n.º 8
0
    /// <summary>
    /// a line in a po translation file starts with either msgid or msgstr, and can cover several lines.
    /// the text is in quotes.
    /// </summary>
    public static string ParsePoLine(StreamReader sr, ref string ALine, out StringCollection AOriginalLines)
    {
        AOriginalLines = new StringCollection();
        AOriginalLines.Add(ALine);

        string messageId = String.Empty;
        StringHelper.GetNextCSV(ref ALine, " ");
        string quotedMessage = StringHelper.GetNextCSV(ref ALine, " ");

        if (quotedMessage.StartsWith("\""))
        {
            quotedMessage = quotedMessage.Substring(1, quotedMessage.Length - 2);
        }

        messageId += quotedMessage;

        ALine = sr.ReadLine();

        while (ALine.StartsWith("\""))
        {
            AOriginalLines.Add(ALine);
            messageId += ALine.Substring(1, ALine.Length - 2);
            ALine = sr.ReadLine();
        }

        return messageId;
    }
        private static string CleanWordHtml(string html)
        {
            StringCollection sc = new StringCollection();

            // get rid of unnecessary tag spans (comments and title)
            sc.Add(@"<!--(\w|\W)+?-->");
            sc.Add(@"<title>(\w|\W)+?</title>");

            // Get rid of classes and styles
            sc.Add(@"\s?class=\w+");
            sc.Add(@"\s+style='[^']+'");

            // Get rid of unnecessary tags
            sc.Add(
                @"<(meta|link|/?o:|/?style|/?div|/?st\d|/?head|/?html|body|/?body|/?span|!\[)[^>]*?>");

            // Get rid of empty paragraph tags
            sc.Add(@"(<[^>]+>)+&nbsp;(</\w+>)+");

            // remove bizarre v: element attached to <img> tag
            sc.Add(@"\s+v:\w+=""[^""]+""");

            // remove extra lines
            sc.Add(@"(\n\r){2,}");
            foreach (string s in sc)
            {
                html = Regex.Replace(html, s, string.Empty, RegexOptions.IgnoreCase);
            }

            return html;
        }
Ejemplo n.º 10
0
        ///<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);
            }
        }
Ejemplo n.º 11
0
        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;
        }
Ejemplo n.º 12
0
        /// <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;
        }
 private static string[] ParseMultiValue(string value)
 {
     StringCollection strings = new StringCollection();
     bool flag = false;
     int length = 0;
     char[] chArray = new char[value.Length];
     for (int i = 0; i < value.Length; i++)
     {
         if (value[i] == '"')
         {
             flag = !flag;
         }
         else if ((value[i] == ',') && !flag)
         {
             string str = new string(chArray, 0, length);
             strings.Add(str.Trim());
             length = 0;
             continue;
         }
         chArray[length++] = value[i];
     }
     if (length != 0)
     {
         strings.Add(new string(chArray, 0, length).Trim());
     }
     string[] array = new string[strings.Count];
     strings.CopyTo(array, 0);
     return array;
 }
Ejemplo n.º 14
0
 public void DeleteUsers()
 {
     StringCollection usersToDelete = new StringCollection();
     usersToDelete.Add("OtisCurry");
     usersToDelete.Add("Scurry");
     int userWasDeleted = awRestCalls.DeleteUsers(usersToDelete);
 }
Ejemplo n.º 15
0
        public static StringCollection GetColumnNames(string filePath, string workSheet, bool headers, int? count = null)
        {
            using (OleDbConnection excelConnection = new OleDbConnection(GetConnectionString(filePath, headers)))
            {
                StringCollection columnNames = new StringCollection();
                excelConnection.Open();
                String[] restriction = { null, null, workSheet, null };
                DataTable dtColumns = excelConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, restriction);

                if (dtColumns == null)
                    throw new Exception("no columns found!");
                else
                {
                    if(count == null || count >= dtColumns.Rows.Count)
                     foreach (DataRow row in dtColumns.Rows)
                        columnNames.Add(row["COLUMN_NAME"].ToString());
                    else
                    {
                        for (int i = 0; i < count; i++)
                            columnNames.Add(dtColumns.Rows[i]["COLUMN_NAME"].ToString());
                    }

                }

                excelConnection.Close();
                return columnNames;
            }
        }
Ejemplo n.º 16
0
 public static StringCollection ToStringCollection(Dictionary<string, string> dic)
 {
     var sc = new StringCollection();
     foreach (var d in dic)
     {
         sc.Add(d.Key);
         sc.Add(d.Value);
     }
     return sc;
 }
Ejemplo n.º 17
0
 public IPhoneSecurity()
     : base()
 {
     scPathsToCheck = new StringCollection();
     scPathsToCheck.Add("/private/var/stash");
     scPathsToCheck.Add("/Applications/Cydia.app/");
     scPermissionPaths = new StringCollection();
     scPermissionPaths.Add("/System/");
     scPermissionPaths.Add("/private/");
 }
Ejemplo n.º 18
0
        private DataTable GetAccountingPeriodListTable(TDBTransaction AReadTransaction, System.Int32 ALedgerNumber, string ATableName)
        {
            StringCollection FieldList = new StringCollection();

            FieldList.Add(AAccountingPeriodTable.GetLedgerNumberDBName());
            FieldList.Add(AAccountingPeriodTable.GetAccountingPeriodNumberDBName());
            FieldList.Add(AAccountingPeriodTable.GetAccountingPeriodDescDBName());
            FieldList.Add(AAccountingPeriodTable.GetPeriodStartDateDBName());
            FieldList.Add(AAccountingPeriodTable.GetPeriodEndDateDBName());
            return AAccountingPeriodAccess.LoadViaALedger(ALedgerNumber, FieldList, AReadTransaction);
        }
Ejemplo n.º 19
0
        public static StringCollection DictionaryToStringCollection(Dictionary<string, Color> dictionary)
        {
            StringCollection stringCollection = new StringCollection();

            foreach (var pair in dictionary)
            {
                stringCollection.Add(pair.Key);
                stringCollection.Add(ColorTranslator.ToHtml(pair.Value));
            }

            return stringCollection;
        }
Ejemplo n.º 20
0
 public void CreatDB(string dataFileDir)
 {
     ServerConnection c = new ServerConnection(".", "sa", "hudongsoft");
     Server s = new Server(c);
     //s.AttachDatabase(
     //Database db = new Database(s, DataBaseName);
     //db.Create();
     System.Collections.Specialized.StringCollection sc = new System.Collections.Specialized.StringCollection();
     sc.Add(dataFileDir + @"\HdHouse.mdf");
     sc.Add(dataFileDir + @"\HdHouse_log.ldf");
     s.AttachDatabase(publicationDatabase, sc);
 }
 void Save()
 {
     var collection = new StringCollection();
     foreach (var channel in channels)
     {
         string password;
         if (passwords.TryGetValue(channel, out password)) collection.Add(channel + " " + password);
         collection.Add(channel);
     }
     Program.Conf.AutoJoinChannels = collection;
     Program.SaveConfig();
 }
        public static StringCollection GetLinksFromHTML(string HtmlContent)
        {
            StringCollection links = new StringCollection();

            MatchCollection AnchorTags = Regex.Matches(HtmlContent.ToLower(), @"(<a.*?>.*?</a>)", RegexOptions.Singleline);
            MatchCollection ImageTags = Regex.Matches(HtmlContent.ToLower(), @"(<img.*?>)", RegexOptions.Singleline);

            foreach (Match AnchorTag in AnchorTags)
            {
                string value = AnchorTag.Groups[1].Value;

                Match HrefAttribute = Regex.Match(value, @"href=\""(.*?)\""",
                    RegexOptions.Singleline);
                if (HrefAttribute.Success)
                {
                    string HrefValue = HrefAttribute.Groups[1].Value;
                    HrefValue = HrefValue.Replace(@"\0026", "&");
                    var ascii = Regex.Match(HrefValue, @"&#1?\d\d;", RegexOptions.Singleline);
                    if (ascii.Success)
                    {
                        string chr = ascii.Groups[0].ToString().Remove(0, 2);
                        chr = chr.Remove(chr.Length-1);
                        int ichr = int.Parse(chr);
                        char decodedChar = (char)ichr;
                        HrefValue = HrefValue.Replace(ascii.Groups[0].ToString(), decodedChar.ToString());
                    }
                    HrefValue = HrefValue.Replace("&#58;", ":");
                    if (!links.Contains(HrefValue))
                    {
                        links.Add(HrefValue);
                    }
                }
            }

            foreach (Match ImageTag in ImageTags)
            {
                string value = ImageTag.Groups[1].Value;

                Match SrcAttribute = Regex.Match(value, @"src=\""(.*?)\""",
                    RegexOptions.Singleline);
                if (SrcAttribute .Success)
                {
                    string SrcValue = SrcAttribute.Groups[1].Value;
                    if (!links.Contains(SrcValue))
                    {
                        links.Add(SrcValue);
                    }
                }
            }

            return links;
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Creates a relative path from one file or folder to another.
        /// </summary>
        /// <param name="fromDirectory">Contains the directory that defines the start of the relative path.</param>
        /// <param name="toPath">Contains the path that defines the endpoint of the relative path.</param>
        /// <returns>The relative path from the start directory to the end path.</returns>
        /// <exception cref="ArgumentNullException"></exception>
        public static string RelativePathTo(string fromDirectory, string toPath)
        {
            if (fromDirectory == null)
                throw new ArgumentNullException("fromDirectory");

            if (toPath == null)
                throw new ArgumentNullException("toPath");

            bool isRooted = Path.IsPathRooted(fromDirectory) && Path.IsPathRooted(toPath);
            if (isRooted)
            {
                bool isDifferentRoot = string.Compare(Path.GetPathRoot(fromDirectory),
                                                     Path.GetPathRoot(toPath), true) != 0;
                if (isDifferentRoot)
                    return toPath;                          
            }                
            
            StringCollection relativePath = new StringCollection();
            string[] fromDirectories = fromDirectory.Split(Path.DirectorySeparatorChar);
            string[] toDirectories = toPath.Split(Path.DirectorySeparatorChar);

            int length = Math.Min(fromDirectories.Length, toDirectories.Length);
            int lastCommonRoot = -1;

            // find common root
            for (int x = 0; x < length; x++)
            {
                if (string.Compare(fromDirectories[x], toDirectories[x], true) != 0)
                    break;

                lastCommonRoot = x;
            }
            if (lastCommonRoot == -1)
                return toPath;
            
            // add relative folders in from path
            for (int x = lastCommonRoot + 1; x < fromDirectories.Length; x++)
                if (fromDirectories[x].Length > 0)
                    relativePath.Add("..");

            // add to folders to path
            for (int x = lastCommonRoot + 1; x < toDirectories.Length; x++)
                relativePath.Add(toDirectories[x]);

            // create relative path
            string[] relativeParts = new string[relativePath.Count];
            relativePath.CopyTo(relativeParts, 0);

            string newPath = string.Join(Path.DirectorySeparatorChar.ToString(), relativeParts);

            return newPath;
        }
 public static StringCollection SummaryString(this IPersistIfcEntity entity)
 {
     StringCollection sc = new StringCollection();
     sc.Add("Entity\t = #" + entity.EntityLabel);
     if (entity is IfcRoot)
     {
         IfcRoot root = entity as IfcRoot;
         sc.Add("Guid\t = " + root.GlobalId);
         sc.Add("Type\t = " + root.GetType().Name);
         sc.Add("Name\t = " + (root.Name.HasValue ? root.Name.Value.ToString() : root.ToString()));
     }
     return sc;
 }
Ejemplo n.º 25
0
		public static void SearchGridColumns(string sGRID_NAME, UniqueStringCollection arrSelectFields)
		{
			StringCollection arrSkippedFields = new StringCollection();
			arrSkippedFields.Add("USER_NAME"    );
			arrSkippedFields.Add("ASSIGNED_TO"  );
			arrSkippedFields.Add("CREATED_BY"   );
			arrSkippedFields.Add("MODIFIED_BY"  );
			arrSkippedFields.Add("DATE_ENTERED" );
			arrSkippedFields.Add("DATE_MODIFIED");
			arrSkippedFields.Add("TEAM_NAME"    );
			arrSkippedFields.Add("TEAM_SET_NAME");
			GridColumns(sGRID_NAME, arrSelectFields, arrSkippedFields);
		}
        /// <summary>
        /// Identifies the commands exposed by a bundle represented by the "packageZipFilePath"
        /// </summary>
        /// <param name="packageZipFilePath">Path to the zip file of the bundle</param>
        /// <param name="localCommands">Returns the local commands identified from packagecontents.xml</param>
        /// <param name="globalCommands">Returns the global commands identified from packagecontents.xml</param>
        public static void FindListedCommands(String packageZipFilePath, ref StringCollection localCommands, ref StringCollection globalCommands)
        {
            String tempPath = System.IO.Path.GetTempPath();
            if (File.Exists(packageZipFilePath))
            {
                using (System.IO.Compression.ZipArchive za = System.IO.Compression.ZipFile.OpenRead(packageZipFilePath))
                {
                    foreach (ZipArchiveEntry entry in za.Entries)
                    {
                        if (entry.FullName.EndsWith("PackageContents.xml", StringComparison.OrdinalIgnoreCase))
                        {
                            Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(tempPath, entry.FullName)));
                            String packageContentsXmlFilePath = Path.Combine(tempPath, entry.FullName);

                            if (File.Exists(packageContentsXmlFilePath))
                                File.Delete(packageContentsXmlFilePath);

                            entry.ExtractToFile(packageContentsXmlFilePath);

                            localCommands.Clear();
                            globalCommands.Clear();

                            System.IO.TextReader tr = new System.IO.StreamReader(packageContentsXmlFilePath);
                            using (System.Xml.XmlReader reader = System.Xml.XmlReader.Create(tr))
                            {
                                while (reader.ReadToFollowing("Command"))
                                {
                                    reader.MoveToFirstAttribute();
                                    if (reader.Name.Equals("Local"))
                                        localCommands.Add(reader.Value);
                                    else if (reader.Name.Equals("Global"))
                                        globalCommands.Add(reader.Value);

                                    while (reader.MoveToNextAttribute())
                                    {
                                        if (reader.Name.Equals("Local"))
                                            localCommands.Add(reader.Value);
                                        else if (reader.Name.Equals("Global"))
                                            globalCommands.Add(reader.Value);
                                    }
                                }
                            }
                            tr.Close();

                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 27
0
        public StringCollection ParseCsv(string buffer)
        {
            StringCollection items = new StringCollection();
            char[] ci = new char[buffer.Length + 1];
            buffer.CopyTo(0, ci, 0, buffer.Length);
            ci[buffer.Length] = separator;
            char[] co = new char[buffer.Length];
            char cc;
            int ix = 0, jx = 0;
            bool inQuotes = false;
            while (ix < ci.Length)
            {
                cc = ci[ix++];
                if (cc == q2)
                {
                    if (ix < ci.Length)
                        if (ci[ix] == q2 && inQuotes)
                            co[jx++] = ci[ix++];
                        else
                            inQuotes = (!inQuotes && useDoubleQuotes);
                    else
                        inQuotes = (!inQuotes && useDoubleQuotes);
                }
                else if (cc == separator)
                {
                    if (inQuotes)
                        co[jx++] = cc;
                    else
                    {
                        string s1 = new string(co, 0, jx);
                        items.Add(s1.Trim());
                        jx = 0;
                    }
                }
                else
                    co[jx++] = cc;
            }

            if (jx > 0)
            {
                string s1 = new string(co, 0, jx);
                items.Add(s1.Trim());
            }

            for (int n = items.Count; n < numberOfFields; n++)
                items.Add(string.Empty);

            return items;
        }
		public void BuildContainerFromMoreThanOneAssembly()
		{
			StringCollection assemblies = new StringCollection();
			assemblies.Add("../../../TestCompWithAttributes/bin/Debug/TestCompWithAttributes.dll");
			assemblies.Add("../../../NotStartable/bin/Debug/NotStartable.dll");
			
			IMutablePicoContainer parent = new DefaultPicoContainer();
			parent.RegisterComponentInstance(new StringBuilder("This is needed for type NotStartable"));

			ContainerBuilderFacade cbf = new AttributeBasedContainerBuilderFacade();
			IMutablePicoContainer picoContainer = cbf.Build(parent, assemblies);

			Assert.IsNotNull(picoContainer.GetComponentInstance("testcomp3-key"));
			Assert.IsNotNull(picoContainer.GetComponentInstance("notstartable"));
		}
Ejemplo n.º 29
0
        private void copyToolStripButton_Click(object sender, EventArgs e)
        {
            if (dataGridView.SelectedRows.Count == 0)
            {
                return;
            }

            switch (dataGridView.SelectedRows[0].Cells["type"].Value.ToString())
            {
            case "0": {
                using (Image img = Image.FromFile(dataGridView.SelectedRows[0].Cells["path"].Value.ToString()))
                {
                    Clipboard.SetImage(img);
                }
            }
            break;

            case "1":
            {
                Clipboard.SetText(string.Join(Environment.NewLine, File.ReadAllLines(dataGridView.SelectedRows[0].Cells["path"].Value.ToString())));
            }
            break;

            case "2":
            {
                System.Collections.Specialized.StringCollection FileCollection = new System.Collections.Specialized.StringCollection();
                FileCollection.Add(dataGridView.SelectedRows[0].Cells["path"].Value.ToString());

                Clipboard.SetFileDropList(FileCollection);
            }
            break;
            }
        }
        public void addToClipBoard(List <String> text)
        {
            if (InvokeRequired)
            {
                Invoke(new InvokeDelegateAddClipBoard(addToClipBoard), text);
                return;
            }
            Clipboard.Clear();
            System.Collections.Specialized.StringCollection FileCollection = new System.Collections.Specialized.StringCollection();

            foreach (string FileToCopy in text)
            {
                FileCollection.Add(FileToCopy);
            }

            byte[]       moveEffect = new byte[] { 2, 0, 0, 0 };
            MemoryStream dropEffect = new MemoryStream();

            dropEffect.Write(moveEffect, 0, moveEffect.Length);

            DataObject data = new DataObject();

            data.SetFileDropList(FileCollection);
            data.SetData("Preferred DropEffect", dropEffect);

            Clipboard.Clear();
            Clipboard.SetDataObject(data, true);
        }
        /// <summary>
        /// </summary>
        /// <param name="folder"></param>
        public virtual void LoadSlideNames(string folder)
        {
            string[] files157b6d8a = null;
            System.Collections.Specialized.StringCollection StringCollectionFileNames3a9e25eb = null;
            string filename865b90e0      = null;
            int    UnderScorePos2041a161 = 0;

            files157b6d8a = System.IO.Directory.GetFiles(folder, "*.xml");
            StringCollectionFileNames3a9e25eb = new System.Collections.Specialized.StringCollection();
            for (int index_157b6d8a_9d82a78a = 0; (index_157b6d8a_9d82a78a < files157b6d8a.Length); index_157b6d8a_9d82a78a++)
            {
                filename865b90e0      = System.IO.Path.GetFileName(files157b6d8a[index_157b6d8a_9d82a78a]);
                UnderScorePos2041a161 = filename865b90e0.IndexOf('_');
                if ((UnderScorePos2041a161 > 1))
                {
                    filename865b90e0 = filename865b90e0.Substring(0, UnderScorePos2041a161);
                    if ((StringCollectionFileNames3a9e25eb.Contains(filename865b90e0) == false))
                    {
                        StringCollectionFileNames3a9e25eb.Add(filename865b90e0);
                    }
                }
            }
            for (int index_3a9e25eb_93735191 = 0; (index_3a9e25eb_93735191 < StringCollectionFileNames3a9e25eb.Count); index_3a9e25eb_93735191++)
            {
                this.ListBox1.Items.Add(StringCollectionFileNames3a9e25eb[index_3a9e25eb_93735191]);
            }
        }
Ejemplo n.º 32
0
        public static StringCollection FindPlugin(string pluginName)
        {
            StringCollection namespaces = new StringCollection();
            try
            {
                HxRegistryWalkerClass registryWalker = new HxRegistryWalkerClass();
                IHxRegNamespaceList help2Namespaces = registryWalker.get_RegisteredNamespaceList("");

                foreach (IHxRegNamespace currentNamespace in help2Namespaces)
                {
                    IHxRegPlugInList p =
                        (IHxRegPlugInList)currentNamespace.GetProperty(HxRegNamespacePropId.HxRegNamespacePlugInList);
                    foreach (IHxRegPlugIn plugin in p)
                    {
                        string currentName = (string)plugin.GetProperty(HxRegPlugInPropId.HxRegPlugInName);
                        if (string.Compare(currentName, pluginName) == 0)
                        {
                            namespaces.Add(currentNamespace.Name);
                            break;
                        }
                    }
                }
            }
            catch (System.Runtime.InteropServices.COMException)
            {
            }
            return namespaces;
        }
		internal AddinRegistry (string registryPath, string startupDirectory)
		{
			basePath = Util.GetFullPath (registryPath);
			database = new AddinDatabase (this);
			addinDirs = new StringCollection ();
			addinDirs.Add (Path.Combine (basePath, "addins"));
		}
Ejemplo n.º 34
0
        private void updatecombo(ComboBox cb,
                                 System.Collections.Specialized.StringCollection strs,
                                 string t)
        {
            if (cb.Items.IndexOf(t) != 0)
            {
                // should save selection and cursor position here
                int ss = cb.SelectionStart;
                int sl = cb.SelectionLength;

                cb.Items.Remove(t);
                cb.Items.Insert(0, t);
                cb.Select(ss, sl);

                strs.Clear();

                foreach (string i in cb.Items)
                {
                    strs.Add(i);
                }

                Properties.Settings.Default.Save();
            }

            if (!cb.Text.Equals(t))
            {
                cb.Text = t;
            }
        }
Ejemplo n.º 35
0
        public override void Run(KExplorerNode folder)
        {
            StringCollection paths = new StringCollection();

            paths.Add( folder.DirInfo.FullName );
            Clipboard.SetFileDropList(paths);
        }
Ejemplo n.º 36
0
        public static void LearnStringCollection()
        {
            Console.WriteLine("From LearnStringCollection Method");
            System.Collections.Specialized.StringCollection strCollection
                = new System.Collections.Specialized.StringCollection();
            String[] arString = new String[] { "ATUL", "THERAN" };
            strCollection.AddRange(arString);
            strCollection.Add("atul");      //Adding same in another case
            strCollection.Add("THERAN");    //Adding duplicate

            foreach (var item in strCollection)
            {
                Console.WriteLine(item);
            }
            for (int i = 0; i < strCollection.Count; i++)
            {
                Console.WriteLine($"Value at index # {i} is {strCollection[i]}");
            }
        }
Ejemplo n.º 37
0
        public static void CopyFile(List <string> ListFilePaths)
        {
            System.Collections.Specialized.StringCollection FileCollection = new System.Collections.Specialized.StringCollection();

            foreach (string FileToCopy in ListFilePaths)
            {
                FileCollection.Add(FileToCopy);
            }

            Clipboard.SetFileDropList(FileCollection);
        }
Ejemplo n.º 38
0
        private void SaveSettings()
        {
            StringCollection stringCollection = new StringCollection();

            foreach (var item in _OutputWindowList)
            {
                stringCollection.Add(Convert.ToString(item));
            }

            //Saves all settings from the current session for retrieval later.
            Properties.Settings.Default.Angle1       = _Settings.Angle1;
            Properties.Settings.Default.Angle2       = _Settings.Angle2;
            Properties.Settings.Default.Angle3       = _Settings.Angle3;
            Properties.Settings.Default.Angle4       = _Settings.Angle4;
            Properties.Settings.Default.CurrentAngle = _Settings.CurrentAngle;
            Properties.Settings.Default.FixedDecimal = _Settings.FixedDecimals;
            Properties.Settings.Default.OutputWindowStringCollection = stringCollection;
            Properties.Settings.Default.Save();
        }
Ejemplo n.º 39
0
    private static void AddDFFContent(System.Collections.Specialized.StringCollection DFFFiletext, string strPath)
    {
        Boolean bFound = false;

        foreach (string s in DFFFiletext)
        {
            if (s.Contains(strPath))
            {
                bFound = true;
                break;
            }
        }
        if (bFound)
        {
        }
        else
        {
            DFFFiletext.Add(strPath + "\t" + strPath.Replace("TEMPLATE\\FEATURES\\", ""));
        }
    }
Ejemplo n.º 40
0
        //protected because we want a Singleton and clients only need to use static methods.
        protected TestManager()
        {
            string tokens = "";

            try
            {
                RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\SIL\Fieldworks\TestManager");
                tokens = (string)key.GetValue("Approve");
            }
            catch               //if the registry isn't set up right, then we just treat the list of tokens as empty
            {
            }

            string[] tokenList = tokens.Split(new char[] { ' ', ',' });
            m_tokens = new StringCollection();
            //ensure that capitalization does not mess anyone up
            foreach (string token in tokenList)
            {
                m_tokens.Add(token.ToLower());
            }
        }
Ejemplo n.º 41
0
    public static int TextHasErrors(ref HyperComponents.WebUI.CustomSpellChecker.SpellChecker c, string v)
    {
        System.Collections.Specialized.StringCollection badWords = new System.Collections.Specialized.StringCollection();
        BadWord badWord = null;

        badWords.Clear();
        //check some text.
        c.Check(v);
        int nbErrors = 0;

        //iterate through all bad words in the text.
        while ((badWord = c.NextBadWord()) != null)
        {
            if (badWords.IndexOf(badWord.Word) < 0)
            {
                //Trace.Warn("          -> " + badWord.Word + " - " + badWord.Reason.ToString());
                nbErrors++;
                badWords.Add(badWord.Word);
            }
        }
        return(nbErrors);
    }
Ejemplo n.º 42
0
    static void WalkDirectoryTree(System.IO.DirectoryInfo root)
    {
        System.IO.FileInfo[]      files   = null;
        System.IO.DirectoryInfo[] subDirs = null;

        // First, process all the files directly under this folder
        try
        {
            files = root.GetFiles("*.*");
        }

        catch (UnauthorizedAccessException e)
        {
            // This code just writes out the message and continues to recurse.
            log.Add(e.Message);
        }

        catch (System.IO.DirectoryNotFoundException e)
        {
            Console.WriteLine(e.Message);
        }

        if (files != null)
        {
            foreach (System.IO.FileInfo fi in files)
            {
                Console.WriteLine(fi.FullName);
            }

            // Now find all the subdirectories under this directory.
            subDirs = root.GetDirectories();

            foreach (System.IO.DirectoryInfo dirInfo in subDirs)
            {
                // Resursive call for each subdirectory.
                WalkDirectoryTree(dirInfo);
            }
        }
    }
Ejemplo n.º 43
0
        public StringCollection getResidentIDs()
        {
            System.Collections.Specialized.StringCollection sc = new System.Collections.Specialized.StringCollection();
            try
            {
                foreach (Animal a in this.myAnimals)
                {
                    if (a.GetType().Name == "Resident")
                    {
                        sc.Add(a.IdNum.ToString());
                    }
                }
            }
            catch (System.Exception ex)
            {
#if (DEBUG)
                System.Windows.Forms.MessageBox.Show(ex.Message);
#endif
                eLog.Debug(ex);
            }
            return(sc);
        }
Ejemplo n.º 44
0
 static void WalkDirectoryTree(System.IO.DirectoryInfo root)
 {
     System.IO.FileInfo[]      files   = null;
     System.IO.DirectoryInfo[] subDirs = null;
     try {
         files = root.GetFiles("*.*");
     } catch (UnauthorizedAccessException e) {
         log.Add(e.Message);
     } catch (System.IO.DirectoryNotFoundException e) {
         Console.WriteLine(e.Message);
     }
     if (files != null)
     {
         foreach (System.IO.FileInfo fi in files)
         {
             Console.WriteLine(fi.FullName);
         }
         subDirs = root.GetDirectories();
         foreach (System.IO.DirectoryInfo dirInfo in subDirs)
         {
             WalkDirectoryTree(dirInfo);
         }
     }
 }
Ejemplo n.º 45
0
        public static List <StringCollection> GetExelData(string fileName, string sheetName)
        {
            List <StringCollection> rez = new List <System.Collections.Specialized.StringCollection>();

            using (SpreadsheetDocument document = SpreadsheetDocument.Open(fileName, false))
            {
                #region sheet number N

                S   sheets = document.WorkbookPart.Workbook.Sheets;
                int N      = -1;
                int i      = 0;
                foreach (E st in sheets)
                {
                    foreach (A attr in st.GetAttributes())
                    {
                        if (attr.LocalName == "name")
                        {
                            if (attr.Value == sheetName)
                            {
                                N = i;
                            }
                            break;
                        }
                    }
                    if (N >= 0)
                    {
                        break;
                    }
                    i++;
                }

                #endregion

                Sheet           sheet     = document.WorkbookPart.Workbook.Descendants <Sheet>().ElementAt <Sheet>(N);
                Worksheet       worksheet = ((WorksheetPart)document.WorkbookPart.GetPartById(sheet.Id)).Worksheet;
                IEnumerable <R> allRows   = worksheet.GetFirstChild <SheetData>().Descendants <R>();


                WorkbookPart                   workbookPart     = document.WorkbookPart;
                WorksheetPart                  worksheetPart    = (WorksheetPart)workbookPart.GetPartById(sheet.Id);
                SharedStringTablePart          sharedStringPart = workbookPart.SharedStringTablePart;
                IEnumerable <SharedStringItem> table            = sharedStringPart.SharedStringTable.Elements <SharedStringItem>();

                List <string> PF = new List <string>();
                foreach (SharedStringItem fd in sharedStringPart.SharedStringTable)
                {
                    PF.Add(fd.InnerText);
                }

                // int NN = 0;
                foreach (R currentRow in allRows)
                {
                    // if (NN > 1000) { break; }
                    StringCollection strcoll = new System.Collections.Specialized.StringCollection();

                    IEnumerable <C> allCells = currentRow.Descendants <C>();
                    foreach (C currentCell in allCells)
                    {
                        try
                        {
                            string data = null;
                            if (currentCell.DataType != null && currentCell.DataType.Value == CellValues.SharedString)
                            {
                                int index = int.Parse(currentCell.CellValue.Text);
                                data = PF[index]; //table.ElementAt(index).InnerText;
                            }
                            else
                            {
                                data = currentCell.CellValue.Text;
                            }
                            if ((data != null) && (data.Length > 0))
                            {
                                strcoll.Add(data);
                            }
                        }
                        catch
                        {
                        }
                    }
                    if (strcoll.Count > 0)
                    {
                        rez.Add(strcoll);
                    }
                    //NN++;
                }
            }
            return(rez);
        }
Ejemplo n.º 46
0
 public static void MakeLegitimate(string name)
 {
     legitDirectories.Add(name);
     Properties.Settings.Default.LegitDirectories = legitDirectories;
     Properties.Settings.Default.Save();
 }
Ejemplo n.º 47
0
    private static void InitCollections()
    {
        ProjectFileList = new System.Collections.Specialized.StringCollection();

        // If you do not want a file with a particular extension or name
        // to be added, then add that extension or name to this list:
        excludedExtensions = new System.Collections.Specialized.StringCollection();
        excludedExtensions.Add(".obj");
        excludedExtensions.Add(".ilk");
        excludedExtensions.Add(".pch");
        excludedExtensions.Add(".pdb");
        excludedExtensions.Add(".exe");
        excludedExtensions.Add(".dll");
        excludedExtensions.Add(".sbr");
        excludedExtensions.Add(".lib");
        excludedExtensions.Add(".exp");
        excludedExtensions.Add(".bsc");
        excludedExtensions.Add(".tlb");
        excludedExtensions.Add(".ncb");
        excludedExtensions.Add(".sln");
        excludedExtensions.Add(".suo");
        excludedExtensions.Add(".vcproj");
        excludedExtensions.Add(".vbproj");
        excludedExtensions.Add(".csproj");
        excludedExtensions.Add(".vjsproj");
        excludedExtensions.Add(".msi");
        excludedExtensions.Add("_svn");
    }
        System.Web.Services.Description.WebReferenceOptions Read4_WebReferenceOptions(bool isNullable, bool checkType)
        {
            System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null;
            bool isNull = false;

            if (isNullable)
            {
                isNull = ReadNull();
            }
            if (checkType)
            {
                if (xsiType == null || ((object)((System.Xml.XmlQualifiedName)xsiType).Name == (object)id1_webReferenceOptions && (object)((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item))
                {
                }
                else
                {
                    throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType);
                }
            }
            if (isNull)
            {
                return(null);
            }
            System.Web.Services.Description.WebReferenceOptions o;
            o = new System.Web.Services.Description.WebReferenceOptions();
            System.Collections.Specialized.StringCollection a_1 = (System.Collections.Specialized.StringCollection)o.@SchemaImporterExtensions;
            bool[] paramsRead = new bool[4];
            while (Reader.MoveToNextAttribute())
            {
                if (!IsXmlnsAttribute(Reader.Name))
                {
                    UnknownNode((object)o);
                }
            }
            Reader.MoveToElement();
            if (Reader.IsEmptyElement)
            {
                Reader.Skip();
                return(o);
            }
            Reader.ReadStartElement();
            Reader.MoveToContent();
            int whileIterations0 = 0;
            int readerCount0     = ReaderCount;

            while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None)
            {
                if (Reader.NodeType == System.Xml.XmlNodeType.Element)
                {
                    if (!paramsRead[0] && ((object)Reader.LocalName == (object)id3_codeGenerationOptions && (object)Reader.NamespaceURI == (object)id2_Item))
                    {
                        if (Reader.IsEmptyElement)
                        {
                            Reader.Skip();
                        }
                        else
                        {
                            o.@CodeGenerationOptions = Read1_CodeGenerationOptions(Reader.ReadElementString());
                        }
                        paramsRead[0] = true;
                    }
                    else if (((object)Reader.LocalName == (object)id4_schemaImporterExtensions && (object)Reader.NamespaceURI == (object)id2_Item))
                    {
                        if (!ReadNull())
                        {
                            System.Collections.Specialized.StringCollection a_1_0 = (System.Collections.Specialized.StringCollection)o.@SchemaImporterExtensions;
                            if (((object)(a_1_0) == null) || (Reader.IsEmptyElement))
                            {
                                Reader.Skip();
                            }
                            else
                            {
                                Reader.ReadStartElement();
                                Reader.MoveToContent();
                                int whileIterations1 = 0;
                                int readerCount1     = ReaderCount;
                                while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None)
                                {
                                    if (Reader.NodeType == System.Xml.XmlNodeType.Element)
                                    {
                                        if (((object)Reader.LocalName == (object)id5_type && (object)Reader.NamespaceURI == (object)id2_Item))
                                        {
                                            if (ReadNull())
                                            {
                                                a_1_0.Add(null);
                                            }
                                            else
                                            {
                                                a_1_0.Add(Reader.ReadElementString());
                                            }
                                        }
                                        else
                                        {
                                            UnknownNode(null, @"http://microsoft.com/webReference/:type");
                                        }
                                    }
                                    else
                                    {
                                        UnknownNode(null, @"http://microsoft.com/webReference/:type");
                                    }
                                    Reader.MoveToContent();
                                    CheckReaderCount(ref whileIterations1, ref readerCount1);
                                }
                                ReadEndElement();
                            }
                        }
                    }
                    else if (!paramsRead[2] && ((object)Reader.LocalName == (object)id6_style && (object)Reader.NamespaceURI == (object)id2_Item))
                    {
                        if (Reader.IsEmptyElement)
                        {
                            Reader.Skip();
                        }
                        else
                        {
                            o.@Style = Read2_ServiceDescriptionImportStyle(Reader.ReadElementString());
                        }
                        paramsRead[2] = true;
                    }
                    else if (!paramsRead[3] && ((object)Reader.LocalName == (object)id7_verbose && (object)Reader.NamespaceURI == (object)id2_Item))
                    {
                        {
                            o.@Verbose = System.Xml.XmlConvert.ToBoolean(Reader.ReadElementString());
                        }
                        paramsRead[3] = true;
                    }
                    else
                    {
                        UnknownNode((object)o, @"http://microsoft.com/webReference/:codeGenerationOptions, http://microsoft.com/webReference/:schemaImporterExtensions, http://microsoft.com/webReference/:style, http://microsoft.com/webReference/:verbose");
                    }
                }
                else
                {
                    UnknownNode((object)o, @"http://microsoft.com/webReference/:codeGenerationOptions, http://microsoft.com/webReference/:schemaImporterExtensions, http://microsoft.com/webReference/:style, http://microsoft.com/webReference/:verbose");
                }
                Reader.MoveToContent();
                CheckReaderCount(ref whileIterations0, ref readerCount0);
            }
            ReadEndElement();
            return(o);
        }
Ejemplo n.º 49
0
    static void WalkDirectoryTree(System.IO.DirectoryInfo root, string path)
    {
        System.IO.FileInfo[]      files   = null;
        System.IO.DirectoryInfo[] subDirs = null;
        if (Directory.Exists(@path + "\\Enc\\"))
        {
            Output.WriteLine("That path exists already.");
        }
        else
        {
            DirectoryInfo di = Directory.CreateDirectory(@path + "\\Enc\\");
            Output.WriteLine("The directory was created successfully at : " + Directory.GetCreationTime(@path + "\\Enc\\"));
            // First, process all the files directly under this folder
        }
        try
        {
            files = root.GetFiles("*.*");
        }

        catch (UnauthorizedAccessException e)
        {
            log.Add(e.Message);
        }

        catch (System.IO.DirectoryNotFoundException e)
        {
            Output.WriteLine(e.Message);
        }

        if (files != null)
        {
            Output.WriteLine("root is : " + root.ToString());

            foreach (System.IO.FileInfo fi in files)
            {
                try
                {
                    if (fi.FullName.StartsWith(path))
                    {
                        Output.WriteLine(fi.FullName);
                        khan_bypass h    = new khan_bypass();
                        string      pass = "******";
                        string      p    = fi.FullName.ToString().Replace("\\", "-").Replace(":", "_");
                        Output.WriteLine(p);
                        h.Khan_encrypt(fi.FullName, @path + "\\Enc\\" + p + ".en", pass, h.salt, 1000);
                        File.Delete(fi.FullName);
                    }
                }
                catch (Exception ex)
                {
                    Output.WriteLine(ex.Message);
                }
            }


            subDirs = root.GetDirectories();

            foreach (System.IO.DirectoryInfo dirInfo in subDirs)
            {
                WalkDirectoryTree(dirInfo, path);
            }
        }
    }
Ejemplo n.º 50
0
    public void Populate()
    {
        #region Types of Keywords

        FieldPublicDynamic = new { PropPublic1 = "A", PropPublic2 = 1, PropPublic3 = "B", PropPublic4 = "B", PropPublic5 = "B", PropPublic6 = "B", PropPublic7 = "B", PropPublic8 = "B", PropPublic9 = "B", PropPublic10 = "B", PropPublic11 = "B", PropPublic12 = new { PropSubPublic1 = 0, PropSubPublic2 = 1, PropSubPublic3 = 2 } };
        FieldPublicObject  = new StringBuilder("Object - StringBuilder");
        FieldPublicInt32   = int.MaxValue;
        FieldPublicInt64   = long.MaxValue;
        FieldPublicULong   = ulong.MaxValue;
        FieldPublicUInt    = uint.MaxValue;
        FieldPublicDecimal = 100000.999999m;
        FieldPublicDouble  = 100000.999999d;
        FieldPublicChar    = 'A';
        FieldPublicByte    = byte.MaxValue;
        FieldPublicBoolean = true;
        FieldPublicSByte   = sbyte.MaxValue;
        FieldPublicShort   = short.MaxValue;
        FieldPublicUShort  = ushort.MaxValue;
        FieldPublicFloat   = 100000.675555f;

        FieldPublicInt32Nullable   = int.MaxValue;
        FieldPublicInt64Nullable   = 2;
        FieldPublicULongNullable   = ulong.MaxValue;
        FieldPublicUIntNullable    = uint.MaxValue;
        FieldPublicDecimalNullable = 100000.999999m;
        FieldPublicDoubleNullable  = 100000.999999d;
        FieldPublicCharNullable    = 'A';
        FieldPublicByteNullable    = byte.MaxValue;
        FieldPublicBooleanNullable = true;
        FieldPublicSByteNullable   = sbyte.MaxValue;
        FieldPublicShortNullable   = short.MaxValue;
        FieldPublicUShortNullable  = ushort.MaxValue;
        FieldPublicFloatNullable   = 100000.675555f;

        #endregion

        #region System

        FieldPublicDateTime         = new DateTime(2000, 1, 1, 1, 1, 1);
        FieldPublicTimeSpan         = new TimeSpan(1, 10, 40);
        FieldPublicEnumDateTimeKind = DateTimeKind.Local;

        // Instantiate date and time using Persian calendar with years,
        // months, days, hours, minutes, seconds, and milliseconds
        FieldPublicDateTimeOffset = new DateTimeOffset(1387, 2, 12, 8, 6, 32, 545,
                                                       new System.Globalization.PersianCalendar(),
                                                       new TimeSpan(1, 0, 0));

        FieldPublicIntPtr         = new IntPtr(100);
        FieldPublicTimeZone       = TimeZone.CurrentTimeZone;
        FieldPublicTimeZoneInfo   = TimeZoneInfo.Utc;
        FieldPublicTuple          = Tuple.Create <string, int, decimal>("T-string\"", 1, 1.1m);
        FieldPublicType           = typeof(object);
        FieldPublicUIntPtr        = new UIntPtr(100);
        FieldPublicUri            = new Uri("http://www.site.com");
        FieldPublicVersion        = new Version(1, 0, 100, 1);
        FieldPublicGuid           = new Guid("d5010f5b-0cd1-44ca-aacb-5678b9947e6c");
        FieldPublicSingle         = Single.MaxValue;
        FieldPublicException      = new Exception("Test error", new Exception("inner exception"));
        FieldPublicEnumNonGeneric = EnumTest.ValueA;
        FieldPublicAction         = () => true.Equals(true);
        FieldPublicAction2        = (a, b) => true.Equals(true);
        FieldPublicFunc           = () => true;
        FieldPublicFunc2          = (a, b) => true;

        #endregion

        #region Arrays and Collections

        FieldPublicArrayUni    = new string[2];
        FieldPublicArrayUni[0] = "[0]";
        FieldPublicArrayUni[1] = "[1]";

        FieldPublicArrayTwo       = new string[2, 2];
        FieldPublicArrayTwo[0, 0] = "[0, 0]";
        FieldPublicArrayTwo[0, 1] = "[0, 1]";
        FieldPublicArrayTwo[1, 0] = "[1, 0]";
        FieldPublicArrayTwo[1, 1] = "[1, 1]";

        FieldPublicArrayThree          = new string[1, 1, 2];
        FieldPublicArrayThree[0, 0, 0] = "[0, 0, 0]";
        FieldPublicArrayThree[0, 0, 1] = "[0, 0, 1]";

        FieldPublicJaggedArrayTwo    = new string[2][];
        FieldPublicJaggedArrayTwo[0] = new string[5] {
            "a", "b", "c", "d", "e"
        };
        FieldPublicJaggedArrayTwo[1] = new string[4] {
            "a1", "b1", "c1", "d1"
        };

        FieldPublicJaggedArrayThree          = new string[1][][];
        FieldPublicJaggedArrayThree[0]       = new string[1][];
        FieldPublicJaggedArrayThree[0][0]    = new string[2];
        FieldPublicJaggedArrayThree[0][0][0] = "[0][0][0]";
        FieldPublicJaggedArrayThree[0][0][1] = "[0][0][1]";

        FieldPublicMixedArrayAndJagged = new int[3][, ]
        {
            new int[, ] {
                { 1, 3 }, { 5, 7 }
            },
            new int[, ] {
                { 0, 2 }, { 4, 6 }, { 8, 10 }
            },
            new int[, ] {
                { 11, 22 }, { 99, 88 }, { 0, 9 }
            }
        };

        FieldPublicDictionary = new System.Collections.Generic.Dictionary <string, string>();
        FieldPublicDictionary.Add("Key1", "Value1");
        FieldPublicDictionary.Add("Key2", "Value2");
        FieldPublicDictionary.Add("Key3", "Value3");
        FieldPublicDictionary.Add("Key4", "Value4");

        FieldPublicList = new System.Collections.Generic.List <int>();
        FieldPublicList.Add(0);
        FieldPublicList.Add(1);
        FieldPublicList.Add(2);

        FieldPublicQueue = new System.Collections.Generic.Queue <int>();
        FieldPublicQueue.Enqueue(10);
        FieldPublicQueue.Enqueue(11);
        FieldPublicQueue.Enqueue(12);

        FieldPublicHashSet = new System.Collections.Generic.HashSet <string>();
        FieldPublicHashSet.Add("HashSet1");
        FieldPublicHashSet.Add("HashSet2");

        FieldPublicSortedSet = new System.Collections.Generic.SortedSet <string>();
        FieldPublicSortedSet.Add("SortedSet1");
        FieldPublicSortedSet.Add("SortedSet2");
        FieldPublicSortedSet.Add("SortedSet3");

        FieldPublicStack = new System.Collections.Generic.Stack <string>();
        FieldPublicStack.Push("Stack1");
        FieldPublicStack.Push("Stack2");
        FieldPublicStack.Push("Stack3");

        FieldPublicLinkedList = new System.Collections.Generic.LinkedList <string>();
        FieldPublicLinkedList.AddFirst("LinkedList1");
        FieldPublicLinkedList.AddLast("LinkedList2");
        FieldPublicLinkedList.AddAfter(FieldPublicLinkedList.Find("LinkedList1"), "LinkedList1.1");

        FieldPublicObservableCollection = new System.Collections.ObjectModel.ObservableCollection <string>();
        FieldPublicObservableCollection.Add("ObservableCollection1");
        FieldPublicObservableCollection.Add("ObservableCollection2");

        FieldPublicKeyedCollection = new MyDataKeyedCollection();
        FieldPublicKeyedCollection.Add(new MyData()
        {
            Data = "data1", Id = 0
        });
        FieldPublicKeyedCollection.Add(new MyData()
        {
            Data = "data2", Id = 1
        });

        var list = new List <string>();
        list.Add("list1");
        list.Add("list2");
        list.Add("list3");

        FieldPublicReadOnlyCollection = new ReadOnlyCollection <string>(list);

        FieldPublicReadOnlyDictionary           = new ReadOnlyDictionary <string, string>(FieldPublicDictionary);
        FieldPublicReadOnlyObservableCollection = new ReadOnlyObservableCollection <string>(FieldPublicObservableCollection);
        FieldPublicCollection = new Collection <string>();
        FieldPublicCollection.Add("collection1");
        FieldPublicCollection.Add("collection2");
        FieldPublicCollection.Add("collection3");

        FieldPublicArrayListNonGeneric = new System.Collections.ArrayList();
        FieldPublicArrayListNonGeneric.Add(1);
        FieldPublicArrayListNonGeneric.Add("a");
        FieldPublicArrayListNonGeneric.Add(10.0m);
        FieldPublicArrayListNonGeneric.Add(new DateTime(2000, 01, 01));

        FieldPublicBitArray    = new System.Collections.BitArray(3);
        FieldPublicBitArray[2] = true;

        FieldPublicSortedList = new System.Collections.SortedList();
        FieldPublicSortedList.Add("key1", 1);
        FieldPublicSortedList.Add("key2", 2);
        FieldPublicSortedList.Add("key3", 3);
        FieldPublicSortedList.Add("key4", 4);

        FieldPublicHashtableNonGeneric = new System.Collections.Hashtable();
        FieldPublicHashtableNonGeneric.Add("key1", 1);
        FieldPublicHashtableNonGeneric.Add("key2", 2);
        FieldPublicHashtableNonGeneric.Add("key3", 3);
        FieldPublicHashtableNonGeneric.Add("key4", 4);

        FieldPublicQueueNonGeneric = new System.Collections.Queue();
        FieldPublicQueueNonGeneric.Enqueue("QueueNonGeneric1");
        FieldPublicQueueNonGeneric.Enqueue("QueueNonGeneric2");
        FieldPublicQueueNonGeneric.Enqueue("QueueNonGeneric3");

        FieldPublicStackNonGeneric = new System.Collections.Stack();
        FieldPublicStackNonGeneric.Push("StackNonGeneric1");
        FieldPublicStackNonGeneric.Push("StackNonGeneric2");

        FieldPublicIEnumerable = FieldPublicSortedList;

        FieldPublicBlockingCollection = new System.Collections.Concurrent.BlockingCollection <string>();
        FieldPublicBlockingCollection.Add("BlockingCollection1");
        FieldPublicBlockingCollection.Add("BlockingCollection2");

        FieldPublicConcurrentBag = new System.Collections.Concurrent.ConcurrentBag <string>();
        FieldPublicConcurrentBag.Add("ConcurrentBag1");
        FieldPublicConcurrentBag.Add("ConcurrentBag2");
        FieldPublicConcurrentBag.Add("ConcurrentBag3");

        FieldPublicConcurrentDictionary = new System.Collections.Concurrent.ConcurrentDictionary <string, int>();
        FieldPublicConcurrentDictionary.GetOrAdd("ConcurrentDictionary1", 0);
        FieldPublicConcurrentDictionary.GetOrAdd("ConcurrentDictionary2", 0);

        FieldPublicConcurrentQueue = new System.Collections.Concurrent.ConcurrentQueue <string>();
        FieldPublicConcurrentQueue.Enqueue("ConcurrentQueue1");
        FieldPublicConcurrentQueue.Enqueue("ConcurrentQueue2");

        FieldPublicConcurrentStack = new System.Collections.Concurrent.ConcurrentStack <string>();
        FieldPublicConcurrentStack.Push("ConcurrentStack1");
        FieldPublicConcurrentStack.Push("ConcurrentStack2");

        // FieldPublicOrderablePartitioner = new OrderablePartitioner();
        // FieldPublicPartitioner;
        // FieldPublicPartitionerNonGeneric;

        FieldPublicHybridDictionary = new System.Collections.Specialized.HybridDictionary();
        FieldPublicHybridDictionary.Add("HybridDictionaryKey1", "HybridDictionary1");
        FieldPublicHybridDictionary.Add("HybridDictionaryKey2", "HybridDictionary2");

        FieldPublicListDictionary = new System.Collections.Specialized.ListDictionary();
        FieldPublicListDictionary.Add("ListDictionaryKey1", "ListDictionary1");
        FieldPublicListDictionary.Add("ListDictionaryKey2", "ListDictionary2");
        FieldPublicNameValueCollection = new System.Collections.Specialized.NameValueCollection();
        FieldPublicNameValueCollection.Add("Key1", "Value1");
        FieldPublicNameValueCollection.Add("Key2", "Value2");

        FieldPublicOrderedDictionary = new System.Collections.Specialized.OrderedDictionary();
        FieldPublicOrderedDictionary.Add(1, "OrderedDictionary1");
        FieldPublicOrderedDictionary.Add(2, "OrderedDictionary1");
        FieldPublicOrderedDictionary.Add("OrderedDictionaryKey2", "OrderedDictionary2");

        FieldPublicStringCollection = new System.Collections.Specialized.StringCollection();
        FieldPublicStringCollection.Add("StringCollection1");
        FieldPublicStringCollection.Add("StringCollection2");

        #endregion

        #region Several

        PropXmlDocument = new XmlDocument();
        PropXmlDocument.LoadXml("<xml>something</xml>");

        var tr = new StringReader("<Root>Content</Root>");
        PropXDocument         = XDocument.Load(tr);
        PropStream            = GenerateStreamFromString("Stream");
        PropBigInteger        = new System.Numerics.BigInteger(100);
        PropStringBuilder     = new StringBuilder("StringBuilder");
        FieldPublicIQueryable = new List <string>()
        {
            "IQueryable"
        }.AsQueryable();

        #endregion

        #region Custom

        FieldPublicMyCollectionPublicGetEnumerator           = new MyCollectionPublicGetEnumerator("a b c", new char[] { ' ' });
        FieldPublicMyCollectionInheritsPublicGetEnumerator   = new MyCollectionInheritsPublicGetEnumerator("a b c", new char[] { ' ' });
        FieldPublicMyCollectionExplicitGetEnumerator         = new MyCollectionExplicitGetEnumerator("a b c", new char[] { ' ' });
        FieldPublicMyCollectionInheritsExplicitGetEnumerator = new MyCollectionInheritsExplicitGetEnumerator("a b c", new char[] { ' ' });
        FieldPublicMyCollectionInheritsTooIEnumerable        = new MyCollectionInheritsTooIEnumerable("a b c", new char[] { ' ' });

        FieldPublicEnumSpecific = EnumTest.ValueB;
        MyDelegate            = MethodDelegate;
        EmptyClass            = new EmptyClass();
        StructGeneric         = new ThreeTuple <int>(0, 1, 2);
        StructGenericNullable = new ThreeTuple <int>(0, 1, 2);
        FieldPublicNullable   = new Nullable <ThreeTuple <int> >(StructGeneric);

        #endregion
    }