diff --git a/MadMilkman.Ini-1.0.6/.gitattributes b/MadMilkman.Ini-1.0.6/.gitattributes deleted file mode 100644 index d1d7702..0000000 --- a/MadMilkman.Ini-1.0.6/.gitattributes +++ /dev/null @@ -1,14 +0,0 @@ -# Linguist overrides -*.h linguist-language=cpp -*.cs linguist-language=C# - -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp -*.sln merge=union -*.csproj merge=union -*.vbproj merge=union -*.vcxproj merge=union -*.vcxproj.filters merge=union diff --git a/MadMilkman.Ini-1.0.6/.gitignore b/MadMilkman.Ini-1.0.6/.gitignore deleted file mode 100644 index b202764..0000000 --- a/MadMilkman.Ini-1.0.6/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Rr]elease/ -[Bb]in/ -[Oo]bj/ - -# MSTest test Results -[Tt]est[Rr]esult/ - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/LICENSE b/MadMilkman.Ini-1.0.6/LICENSE deleted file mode 100644 index e06d208..0000000 --- a/MadMilkman.Ini-1.0.6/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Documentation.chm b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Documentation.chm deleted file mode 100644 index 72d5709..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Documentation.chm and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/AssemblyInfo.cpp b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/AssemblyInfo.cpp deleted file mode 100644 index 01e44f8..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/AssemblyInfo.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "stdafx.h" - -using namespace System; -using namespace System::Reflection; -using namespace System::Runtime::CompilerServices; -using namespace System::Runtime::InteropServices; -using namespace System::Security::Permissions; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly:AssemblyTitleAttribute("MadMilkmanIniSamplesCPP")]; -[assembly:AssemblyDescriptionAttribute("")]; -[assembly:AssemblyConfigurationAttribute("")]; -[assembly:AssemblyCompanyAttribute("")]; -[assembly:AssemblyProductAttribute("MadMilkmanIniSamplesCPP")]; -[assembly:AssemblyCopyrightAttribute("Copyright (c) 2015")]; -[assembly:AssemblyTrademarkAttribute("")]; -[assembly:AssemblyCultureAttribute("")]; - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the value or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly:AssemblyVersionAttribute("1.0.*")]; - -[assembly:ComVisible(false)]; - -[assembly:CLSCompliantAttribute(true)]; - -[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)]; diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/IniSamples.cpp b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/IniSamples.cpp deleted file mode 100644 index 77dad51..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/IniSamples.cpp +++ /dev/null @@ -1,463 +0,0 @@ -#include "stdafx.h" -using namespace System; -using namespace System::IO; -using namespace System::Text; -using namespace System::Collections::Generic; -using namespace MadMilkman::Ini; - -void HelloWorld() -{ - // Create new file. - IniFile^ file = gcnew IniFile(); - - // Add new section. - IniSection^ section = file->Sections->Add("Section Name"); - - // Add new key and its value. - IniKey^ key = section->Keys->Add("Key Name", "Hello World"); - - // Read file's specific value. - Console::WriteLine(file->Sections["Section Name"]->Keys["Key Name"]->Value); -} - -void Create() -{ - // Create new file with default formatting. - IniFile^ file = gcnew IniFile(gcnew IniOptions()); - - // Add new content. - IniSection^ section = gcnew IniSection(file, IniSection::GlobalSectionName); - IniKey ^key = gcnew IniKey(file, "Key 1", "Value 1"); - file->Sections->Add(section); - section->Keys->Add(key); - - // Add new content. - file->Sections->Add("Section 2")->Keys->Add("Key 2", "Value 2"); - - // Add new content. - file->Sections->Add( - gcnew IniSection(file, "Section 3", - gcnew IniKey(file, "Key 3.1", "Value 3.1"), - gcnew IniKey(file, "Key 3.2", "Value 3.2"))); - - // Add new content. - Dictionary^ collection = gcnew Dictionary(); - collection->Add("Key 4.1", "Value 4.1"); - collection->Add("Key 4.2", "Value 4.2"); - file->Sections->Add( - gcnew IniSection(file, "Section 4", collection)); -} - -void Load() -{ - IniOptions^ options = gcnew IniOptions(); - IniFile^ iniFile = gcnew IniFile(options); - - // Load file from path. - iniFile->Load("..\\MadMilkman.Ini.Samples.Files\\Load Example.ini"); - - // Load file from stream. - Stream^ fileStream = File::OpenRead("..\\MadMilkman.Ini.Samples.Files\\Load Example.ini"); - try { iniFile->Load(fileStream); } - finally { delete fileStream; } - - // Load file's content from string. - String^ iniContent = "[Section 1]" + Environment::NewLine + - "Key 1.1 = Value 1.1" + Environment::NewLine + - "Key 1.2 = Value 1.2" + Environment::NewLine + - "Key 1.3 = Value 1.3" + Environment::NewLine + - "Key 1.4 = Value 1.4"; - iniFile->Load(gcnew StringReader(iniContent)); - - // Read file's content. - for each (IniSection^ section in iniFile->Sections) - { - Console::WriteLine("SECTION: {0}", section->Name); - for each (IniKey^ key in section->Keys) - { - Console::WriteLine("KEY: {0}, VALUE: {1}", key->Name, key->Value); - } - } -} - -void Style() -{ - IniFile^ file = gcnew IniFile(); - file->Sections->Add("Section 1")->Keys->Add("Key 1", "Value 1"); - file->Sections->Add("Section 2")->Keys->Add("Key 2", "Value 2"); - file->Sections->Add("Section 3")->Keys->Add("Key 3", "Value 3"); - - // Add leading comments. - file->Sections[0]->LeadingComment->Text = "Section 1 leading comment."; - file->Sections[0]->Keys[0]->LeadingComment->Text = "Key 1 leading comment."; - - // Add trailing comments. - file->Sections[1]->TrailingComment->Text = "Section 2 trailing comment->"; - file->Sections[1]->Keys[0]->TrailingComment->Text = "Key 2 trailing comment->"; - - // Add left space, indentation. - file->Sections[1]->LeftIndentation = 4; - file->Sections[1]->TrailingComment->LeftIndentation = 4; - file->Sections[1]->Keys[0]->LeftIndentation = 4; - file->Sections[1]->Keys[0]->TrailingComment->LeftIndentation = 4; - - // Add above space, empty lines. - file->Sections[2]->TrailingComment->EmptyLinesBefore = 2; -} - -void Save() -{ - IniOptions^ options = gcnew IniOptions(); - IniFile^ iniFile = gcnew IniFile(options); - iniFile->Sections->Add( - gcnew IniSection(iniFile, "Section 1", - gcnew IniKey(iniFile, "Key 1.1", "Value 1.1"), - gcnew IniKey(iniFile, "Key 1.2", "Value 1.2"), - gcnew IniKey(iniFile, "Key 1.3", "Value 1.3"), - gcnew IniKey(iniFile, "Key 1.4", "Value 1.4"))); - - // Save file to path. - iniFile->Save("..\\MadMilkman.Ini.Samples.Files\\Save Example.ini"); - - // Save file to stream. - Stream^ fileStream = File::Create("..\\MadMilkman.Ini.Samples.Files\\Save Example.ini"); - try { iniFile->Save(fileStream); } - finally { delete fileStream; } - - // Save file's content to string. - StringWriter^ contentWriter = gcnew StringWriter(); - iniFile->Save(contentWriter); - String^ iniContent = contentWriter->ToString(); - - Console::WriteLine(iniContent); -} - -void Encrypt() -{ - // Enable file's protection by providing an encryption password. - IniOptions^ options = gcnew IniOptions(); - options->EncryptionPassword = "M4dM1lkM4n.1n1"; - IniFile^ file = gcnew IniFile(options); - - IniSection^ section = file->Sections->Add("User's Account"); - section->Keys->Add("Username", "John Doe"); - section->Keys->Add("Password", "P@55\\/\\/0|2D"); - - // Save and encrypt the file. - file->Save("..\\MadMilkman.Ini.Samples.Files\\Encrypt Example.ini"); - - file->Sections->Clear(); - - // Load and dencrypt the file. - file->Load("..\\MadMilkman.Ini.Samples.Files\\Encrypt Example.ini"); - - Console::WriteLine("User Name: {0}", file->Sections[0]->Keys["Username"]->Value); - Console::WriteLine("Password: {0}", file->Sections[0]->Keys["Password"]->Value); -} - -void Compress() -{ - // Enable file's size reduction. - IniOptions^ options = gcnew IniOptions(); - options->Compression = true; - IniFile^ file = gcnew IniFile(options); - - for (int i = 1; i <= 100; i++) - { - file->Sections->Add("Section " + i)->Keys->Add("Key " + i, "Value " + i); - } - - // Save and compress the file. - file->Save("..\\MadMilkman.Ini.Samples.Files\\Compress Example.ini"); - - file->Sections->Clear(); - - // Load and decompress the file. - file->Load("..\\MadMilkman.Ini.Samples.Files\\Compress Example.ini"); - - Console::WriteLine(file->Sections->Count); -} - -void Custom() -{ - IniOptions^ options = gcnew IniOptions(); - options->CommentStarter = IniCommentStarter::Hash; - options->KeyDelimiter = IniKeyDelimiter::Colon; - options->KeySpaceAroundDelimiter = true; - options->SectionWrapper = IniSectionWrapper::CurlyBrackets; - options->Encoding = Encoding::UTF8; - IniFile^ file = gcnew IniFile(options); - - // Load file. - file->Load("..\\MadMilkman.Ini.Samples.Files\\Custom Example Input.ini"); - - // Change first section's fourth key's value. - file->Sections[0]->Keys[3]->Value = "NEW VALUE"; - - // Save file. - file->Save("..\\MadMilkman.Ini.Samples.Files\\Custom Example Output.ini"); -} - -void Copy() -{ - // Create new file. - IniFile^ file = gcnew IniFile(); - - // Add new content. - IniSection^ section = file->Sections->Add("Section"); - IniKey^ key = section->Keys->Add("Key"); - - // Add duplicate section. - file->Sections->Add(section->Copy()); - - // Add duplicate key. - section->Keys->Add(key->Copy()); - - // Create new file. - IniFile^ newFile = gcnew IniFile(gcnew IniOptions()); - - // Import first file's section to second file. - newFile->Sections->Add(section->Copy(newFile)); -} - -void Parse() -{ - IniFile^ file = gcnew IniFile(); - String^ content = "[Player]" + Environment::NewLine + - "Full Name = John Doe" + Environment::NewLine + - "Birthday = 12/31/1999" + Environment::NewLine + - "Married = Yes" + Environment::NewLine + - "Score = 9999999" + Environment::NewLine + - "Game Time = 00:59:59"; - file->Load(gcnew StringReader(content)); - - // Map 'yes' value as 'true' boolean. - file->ValueMappings->Add("yes", true); - // Map 'no' value as 'false' boolean. - file->ValueMappings->Add("no", false); - - IniSection^ playerSection = file->Sections["Player"]; - - // Retrieve player's name. - String^ playerName = playerSection->Keys["Full Name"]->Value; - - // Retrieve player's birthday as DateTime. - DateTime playerBirthday; - playerSection->Keys["Birthday"]->TryParseValue(playerBirthday); - - // Retrieve player's marital status as bool. - // TryParseValue succeeds due to the mapping of 'yes' value to 'true' boolean. - bool playerMarried; - playerSection->Keys["Married"]->TryParseValue(playerMarried); - - // Retrieve player's score as long. - long playerScore; - playerSection->Keys["Score"]->TryParseValue(playerScore); - - // Retrieve player's game time as TimeSpan. - TimeSpan playerGameTime; - playerSection->Keys["Game Time"]->TryParseValue(playerGameTime); -} - -void BindInternal() -{ - IniFile^ file = gcnew IniFile(); - String^ content = "[Machine Settings]" + Environment::NewLine + - "Program Files = C:\\Program Files" + Environment::NewLine + - "[Application Settings]" + Environment::NewLine + - "Name = Example App" + Environment::NewLine + - "Version = 1.0" + Environment::NewLine + - "Full Name = @{Name} v@{Version}" + Environment::NewLine + - "Executable Path = @{Machine Settings|Program Files}\\@{Name}.exe"; - file->Load(gcnew StringReader(content)); - - // Bind placeholders with file's content, internal information. - file->ValueBinding->Bind(); - - // Retrieve application's full name, value is 'Example App v1.0'. - String^ appFullName = file->Sections["Application Settings"]->Keys["Full Name"]->Value; - - // Retrieve application's executable path, value is 'C:\\Program Files\\Example App.exe'. - String^ appExePath = file->Sections["Application Settings"]->Keys["Executable Path"]->Value; -} - -void BindExternal() -{ - IniFile^ file = gcnew IniFile(); - String^ content = "[User's Settings]" + Environment::NewLine + - "Nickname = @{User Alias}" + Environment::NewLine + - "Full Name = @{User Name} @{User Surname}" + Environment::NewLine + - "Profile Page = @{Homepage}/Profiles/@{User Alias}"; - file->Load(gcnew StringReader(content)); - - // Bind placeholders with user's data, external information. - Dictionary^ userData = gcnew Dictionary(); - userData->Add("User Alias", "Johny"); - userData->Add("User Name", "John"); - userData->Add("User Surname", "Doe"); - file->ValueBinding->Bind(userData); - - // Bind 'Homepage' placeholder with 'www.example.com' value. - file->ValueBinding->Bind( - KeyValuePair("Homepage", "www.example.com")); - - // Retrieve user's full name, value is 'John Doe'. - String^ userFullName = file->Sections["User's Settings"]->Keys["Full Name"]->Value; - - // Retrieve user's profile page, value is 'www.example.com/Profiles/Johny'. - String^ userProfilePage = file->Sections["User's Settings"]->Keys["Profile Page"]->Value; -} - -private ref class BindingCustomizationSample { -public: - void BindCustomize() - { - IniFile^ file = gcnew IniFile(); - String^ content = "[Player]" + Environment::NewLine + - "Name = @{Name}" + Environment::NewLine + - "Surname = @{Surname}" + Environment::NewLine + - "Adult = @{Age}" + Environment::NewLine + - "Medal = @{Rank}"; - file->Load(gcnew StringReader(content)); - - // Customize binding operation. - file->ValueBinding->Binding += gcnew EventHandler(this, &BindingCustomizationSample::CustomEventHandler); - - // Execute binding operation. - Dictionary^ dataSource = gcnew Dictionary(); - dataSource->Add("Name", "John"); - dataSource->Add("Age", "20"); - dataSource->Add("Rank", "1"); - file->ValueBinding->Bind(dataSource); - } - - void CustomEventHandler(Object^ sender, IniValueBindingEventArgs^ e) - { - if (!e->IsValueFound) - { - e->Value = "UNKNOWN"; - return; - } - if (e->PlaceholderKey->Name->Equals("Adult") && e->PlaceholderName->Equals("Age")) - { - int age; - if (int::TryParse(e->Value, age)) - { - e->Value = (age >= 18) ? "YES" : "NO"; - } - else - { - e->Value = "UNKNOWN"; - } - return; - } - if (e->PlaceholderKey->Name->Equals("Medal") && e->PlaceholderName->Equals("Rank")) - { - int rank; - if (int::TryParse(e->Value, rank)) - { - switch (rank) - { - case 1: - e->Value = "GOLD"; - break; - case 2: - e->Value = "SILVER"; - break; - case 3: - e->Value = "BRONCE"; - break; - default: - e->Value = "NONE"; - break; - } - } - else - { - e->Value = "UNKNOWN"; - } - return; - } - } -}; - -// Custom type used for serialization sample. -private ref class GameCharacter -{ -public: - property String^ Name; - - // Serialize this property as a key with "Sword" name. - [IniSerialization("Sword")] - property double Attack; - - // Serialize this property as a key with "Shield" name. - [IniSerialization("Shield")] - property double Defence; - - // Ignore serializing this property. - [IniSerialization(true)] - property double Health; - - GameCharacter() - { - this->Health = 100; - } -}; - -void Serialize() -{ - IniFile^ file = gcnew IniFile(); - IniSection^ section = file->Sections->Add("User's Character"); - - GameCharacter^ character = gcnew GameCharacter(); - character->Name = "John"; - character->Attack = 5.5; - character->Defence = 1; - character->Health = 75; - - // Serialize GameCharacter object into section's keys. - section->Serialize(character); - - // Deserialize section into GameCharacter object. - GameCharacter^ savedCharacter = section->Deserialize(); - - Console::WriteLine(section->Keys["Name"]->Value); - Console::WriteLine(savedCharacter->Name); - Console::WriteLine(section->Keys["Sword"]->Value); - Console::WriteLine(savedCharacter->Attack); - Console::WriteLine(section->Keys["Shield"]->Value); - Console::WriteLine(savedCharacter->Defence); -} - -void main() -{ - HelloWorld(); - - Create(); - - Load(); - - Style(); - - Save(); - - Encrypt(); - - Compress(); - - Custom(); - - Copy(); - - Parse(); - - BindInternal(); - - BindExternal(); - - BindingCustomizationSample^ sample = gcnew BindingCustomizationSample(); - sample->BindCustomize(); - - Serialize(); -} \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/MadMilkman.Ini.Samples.CPP.vcxproj b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/MadMilkman.Ini.Samples.CPP.vcxproj deleted file mode 100644 index 66bafaf..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/MadMilkman.Ini.Samples.CPP.vcxproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {097C11FE-8D4B-48D8-884E-0747454E43DB} - v4.5 - ManagedCProj - MadMilkmanIniSamplesCPP - - - - Application - true - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - true - - - false - - - - Level3 - Disabled - WIN32;_DEBUG;%(PreprocessorDefinitions) - Use - - - true - - Console - - - - - Level3 - WIN32;NDEBUG;%(PreprocessorDefinitions) - Use - - - true - - Console - - - - - - - - - - Create - Create - - - - - {bef9735d-c3cc-41e6-aac6-18c5985d3107} - - - - - - \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/MadMilkman.Ini.Samples.CPP.vcxproj.filters b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/MadMilkman.Ini.Samples.CPP.vcxproj.filters deleted file mode 100644 index 24a30fc..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/MadMilkman.Ini.Samples.CPP.vcxproj.filters +++ /dev/null @@ -1,20 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/stdafx.cpp b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/stdafx.cpp deleted file mode 100644 index 2600e88..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/stdafx.cpp +++ /dev/null @@ -1,7 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// MadMilkman.Ini.Samples.CPP.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - - diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/stdafx.h b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/stdafx.h deleted file mode 100644 index 39986bd..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CPP/stdafx.h +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - -// TODO: reference additional headers your program requires here diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CS/IniSamples.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CS/IniSamples.cs deleted file mode 100644 index fb645c3..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CS/IniSamples.cs +++ /dev/null @@ -1,456 +0,0 @@ -using System; -using System.IO; -using System.Text; -using System.Collections.Generic; -using MadMilkman.Ini; - -namespace MadMilkman.Ini.Samples.CS -{ - class IniSamples - { - private static void HelloWorld() - { - // Create new file. - IniFile file = new IniFile(); - - // Add new section. - IniSection section = file.Sections.Add("Section Name"); - - // Add new key and its value. - IniKey key = section.Keys.Add("Key Name", "Hello World"); - - // Read file's specific value. - Console.WriteLine(file.Sections["Section Name"].Keys["Key Name"].Value); - } - - private static void Create() - { - // Create new file with a default formatting. - IniFile file = new IniFile(new IniOptions()); - - // Add new content. - IniSection section = new IniSection(file, IniSection.GlobalSectionName); - IniKey key = new IniKey(file, "Key 1", "Value 1"); - file.Sections.Add(section); - section.Keys.Add(key); - - // Add new content. - file.Sections.Add("Section 2").Keys.Add("Key 2", "Value 2"); - - // Add new content. - file.Sections.Add( - new IniSection(file, "Section 3", - new IniKey(file, "Key 3.1", "Value 3.1"), - new IniKey(file, "Key 3.2", "Value 3.2"))); - - // Add new content. - file.Sections.Add( - new IniSection(file, "Section 4", - new Dictionary() - { - {"Key 4.1", "Value 4.1"}, - {"Key 4.2", "Value 4.2"} - })); - } - - private static void Load() - { - IniOptions options = new IniOptions(); - IniFile iniFile = new IniFile(options); - - // Load file from path. - iniFile.Load(@"..\..\..\MadMilkman.Ini.Samples.Files\Load Example.ini"); - - // Load file from stream. - using (Stream stream = File.OpenRead(@"..\..\..\MadMilkman.Ini.Samples.Files\Load Example.ini")) - iniFile.Load(stream); - - // Load file's content from string. - string iniContent = "[Section 1]" + Environment.NewLine + - "Key 1.1 = Value 1.1" + Environment.NewLine + - "Key 1.2 = Value 1.2" + Environment.NewLine + - "Key 1.3 = Value 1.3" + Environment.NewLine + - "Key 1.4 = Value 1.4"; - iniFile.Load(new StringReader(iniContent)); - - // Read file's content. - foreach (var section in iniFile.Sections) - { - Console.WriteLine("SECTION: {0}", section.Name); - foreach (var key in section.Keys) - Console.WriteLine("KEY: {0}, VALUE: {1}", key.Name, key.Value); - } - } - - private static void Style() - { - IniFile file = new IniFile(); - file.Sections.Add("Section 1").Keys.Add("Key 1", "Value 1"); - file.Sections.Add("Section 2").Keys.Add("Key 2", "Value 2"); - file.Sections.Add("Section 3").Keys.Add("Key 3", "Value 3"); - - // Add leading comments. - file.Sections[0].LeadingComment.Text = "Section 1 leading comment."; - file.Sections[0].Keys[0].LeadingComment.Text = "Key 1 leading comment."; - - // Add trailing comments. - file.Sections[1].TrailingComment.Text = "Section 2 trailing comment."; - file.Sections[1].Keys[0].TrailingComment.Text = "Key 2 trailing comment."; - - // Add left space, indentation. - file.Sections[1].LeftIndentation = 4; - file.Sections[1].TrailingComment.LeftIndentation = 4; - file.Sections[1].Keys[0].LeftIndentation = 4; - file.Sections[1].Keys[0].TrailingComment.LeftIndentation = 4; - - // Add above space, empty lines. - file.Sections[2].TrailingComment.EmptyLinesBefore = 2; - } - - private static void Save() - { - IniOptions options = new IniOptions(); - IniFile iniFile = new IniFile(options); - iniFile.Sections.Add( - new IniSection(iniFile, "Section 1", - new IniKey(iniFile, "Key 1.1", "Value 1.1"), - new IniKey(iniFile, "Key 1.2", "Value 1.2"), - new IniKey(iniFile, "Key 1.3", "Value 1.3"), - new IniKey(iniFile, "Key 1.4", "Value 1.4"))); - - // Save file to path. - iniFile.Save(@"..\..\..\MadMilkman.Ini.Samples.Files\Save Example.ini"); - - // Save file to stream. - using (Stream stream = File.Create(@"..\..\..\MadMilkman.Ini.Samples.Files\Save Example.ini")) - iniFile.Save(stream); - - // Save file's content to string. - StringWriter contentWriter = new StringWriter(); - iniFile.Save(contentWriter); - string iniContent = contentWriter.ToString(); - - Console.WriteLine(iniContent); - } - - private static void Encrypt() - { - // Enable file's protection by providing an encryption password. - IniOptions options = new IniOptions() { EncryptionPassword = "M4dM1lkM4n.1n1" }; - IniFile file = new IniFile(options); - - IniSection section = file.Sections.Add("User's Account"); - section.Keys.Add("Username", "John Doe"); - section.Keys.Add("Password", @"P@55\/\/0|2D"); - - // Save and encrypt the file. - file.Save(@"..\..\..\MadMilkman.Ini.Samples.Files\Encrypt Example.ini"); - - file.Sections.Clear(); - - // Load and dencrypt the file. - file.Load(@"..\..\..\MadMilkman.Ini.Samples.Files\Encrypt Example.ini"); - - Console.WriteLine("User Name: {0}", file.Sections[0].Keys["Username"].Value); - Console.WriteLine("Password: {0}", file.Sections[0].Keys["Password"].Value); - } - - private static void Compress() - { - // Enable file's size reduction. - IniOptions options = new IniOptions() { Compression = true }; - IniFile file = new IniFile(options); - - for (int i = 1; i <= 100; i++) - file.Sections.Add("Section " + i).Keys.Add("Key " + i, "Value " + i); - - // Save and compress the file. - file.Save(@"..\..\..\MadMilkman.Ini.Samples.Files\Compress Example.ini"); - - file.Sections.Clear(); - - // Load and decompress the file. - file.Load(@"..\..\..\MadMilkman.Ini.Samples.Files\Compress Example.ini"); - - Console.WriteLine(file.Sections.Count); - } - - private static void Custom() - { - // Create new file with custom formatting. - IniFile file = new IniFile( - new IniOptions() - { - CommentStarter = IniCommentStarter.Hash, - KeyDelimiter = IniKeyDelimiter.Colon, - KeySpaceAroundDelimiter = true, - SectionWrapper = IniSectionWrapper.CurlyBrackets, - Encoding = Encoding.UTF8 - }); - - // Load file. - file.Load(@"..\..\..\MadMilkman.Ini.Samples.Files\Custom Example Input.ini"); - - // Change first section's fourth key's value. - file.Sections[0].Keys[3].Value = "NEW VALUE"; - - // Save file. - file.Save(@"..\..\..\MadMilkman.Ini.Samples.Files\Custom Example Output.ini"); - } - - private static void Copy() - { - // Create new file. - IniFile file = new IniFile(); - - // Add new content. - IniSection section = file.Sections.Add("Section"); - IniKey key = section.Keys.Add("Key"); - - // Add duplicate section. - file.Sections.Add(section.Copy()); - - // Add duplicate key. - section.Keys.Add(key.Copy()); - - // Create new file. - IniFile newFile = new IniFile(new IniOptions()); - - // Import first file's section to second file. - newFile.Sections.Add(section.Copy(newFile)); - } - - private static void Parse() - { - IniFile file = new IniFile(); - string content = "[Player]" + Environment.NewLine + - "Full Name = John Doe" + Environment.NewLine + - "Birthday = 12/31/1999" + Environment.NewLine + - "Married = Yes" + Environment.NewLine + - "Score = 9999999" + Environment.NewLine + - "Game Time = 00:59:59"; - file.Load(new StringReader(content)); - - // Map 'yes' value as 'true' boolean. - file.ValueMappings.Add("yes", true); - // Map 'no' value as 'false' boolean. - file.ValueMappings.Add("no", false); - - IniSection playerSection = file.Sections["Player"]; - - // Retrieve player's name. - string playerName = playerSection.Keys["Full Name"].Value; - - // Retrieve player's birthday as DateTime. - DateTime playerBirthday; - playerSection.Keys["Birthday"].TryParseValue(out playerBirthday); - - // Retrieve player's marital status as bool. - // TryParseValue succeeds due to the mapping of 'yes' value to 'true' boolean. - bool playerMarried; - playerSection.Keys["Married"].TryParseValue(out playerMarried); - - // Retrieve player's score as long. - long playerScore; - playerSection.Keys["Score"].TryParseValue(out playerScore); - - // Retrieve player's game time as TimeSpan. - TimeSpan playerGameTime; - playerSection.Keys["Game Time"].TryParseValue(out playerGameTime); - } - - private static void BindInternal() - { - IniFile file = new IniFile(); - string content = "[Machine Settings]" + Environment.NewLine + - "Program Files = C:\\Program Files" + Environment.NewLine + - "[Application Settings]" + Environment.NewLine + - "Name = Example App" + Environment.NewLine + - "Version = 1.0" + Environment.NewLine + - "Full Name = @{Name} v@{Version}" + Environment.NewLine + - "Executable Path = @{Machine Settings|Program Files}\\@{Name}.exe"; - file.Load(new StringReader(content)); - - // Bind placeholders with file's content, internal information. - file.ValueBinding.Bind(); - - // Retrieve application's full name, value is 'Example App v1.0'. - string appFullName = file.Sections["Application Settings"].Keys["Full Name"].Value; - - // Retrieve application's executable path, value is 'C:\\Program Files\\Example App.exe'. - string appExePath = file.Sections["Application Settings"].Keys["Executable Path"].Value; - } - - private static void BindExternal() - { - IniFile file = new IniFile(); - string content = "[User's Settings]" + Environment.NewLine + - "Nickname = @{User Alias}" + Environment.NewLine + - "Full Name = @{User Name} @{User Surname}" + Environment.NewLine + - "Profile Page = @{Homepage}/Profiles/@{User Alias}"; - file.Load(new StringReader(content)); - - // Bind placeholders with user's data, external information. - file.ValueBinding.Bind( - new Dictionary - { - {"User Alias", "Johny"}, - {"User Name", "John"}, - {"User Surname", "Doe"} - }); - - // Bind 'Homepage' placeholder with 'www.example.com' value. - file.ValueBinding.Bind( - new KeyValuePair("Homepage", "www.example.com")); - - // Retrieve user's full name, value is 'John Doe'. - string userFullName = file.Sections["User's Settings"].Keys["Full Name"].Value; - - // Retrieve user's profile page, value is 'www.example.com/Profiles/Johny'. - string userProfilePage = file.Sections["User's Settings"].Keys["Profile Page"].Value; - } - - private static void BindCustomize() - { - IniFile file = new IniFile(); - string content = "[Player]" + Environment.NewLine + - "Name = @{Name}" + Environment.NewLine + - "Surname = @{Surname}" + Environment.NewLine + - "Adult = @{Age}" + Environment.NewLine + - "Medal = @{Rank}"; - file.Load(new StringReader(content)); - - // Customize binding operation. - file.ValueBinding.Binding += (sender, e) => - { - // Set placeholders that do not have a value in data source to 'UNKNOWN'. - if (!e.IsValueFound) - { - e.Value = "UNKNOWN"; - return; - } - - // Set 'Age' placeholder inside 'Adult' key to an appropriate value. - if (e.PlaceholderKey.Name.Equals("Adult") && e.PlaceholderName.Equals("Age")) - { - int age; - if (int.TryParse(e.Value, out age)) - e.Value = (age >= 18) ? "YES" : "NO"; - else - e.Value = "UNKNOWN"; - return; - } - - // Set 'Rank' placeholder inside 'Medal' key to an appropriate value. - if (e.PlaceholderKey.Name.Equals("Medal") && e.PlaceholderName.Equals("Rank")) - { - int rank; - if (int.TryParse(e.Value, out rank)) - switch (rank) - { - case 1: - e.Value = "GOLD"; - break; - case 2: - e.Value = "SILVER"; - break; - case 3: - e.Value = "BRONCE"; - break; - default: - e.Value = "NONE"; - break; - } - else - e.Value = "UNKNOWN"; - return; - } - }; - - // Execute binding operation. - file.ValueBinding.Bind( - new Dictionary - { - {"Name", "John"}, - {"Age", "20"}, - {"Rank", "1"} - }); - } - - // Custom type used for serialization sample. - private class GameCharacter - { - public string Name { get; set; } - - // Serialize this property as a key with "Sword" name. - [IniSerialization("Sword")] - public double Attack { get; set; } - - // Serialize this property as a key with "Shield" name. - [IniSerialization("Shield")] - public double Defence { get; set; } - - // Ignore serializing this property. - [IniSerialization(true)] - public double Health { get; set; } - - public GameCharacter() { this.Health = 100; } - } - - private static void Serialize() - { - IniFile file = new IniFile(); - IniSection section = file.Sections.Add("User's Character"); - - GameCharacter character = new GameCharacter(); - character.Name = "John"; - character.Attack = 5.5; - character.Defence = 1; - character.Health = 75; - - // Serialize GameCharacter object into section's keys. - section.Serialize(character); - - // Deserialize section into GameCharacter object. - GameCharacter savedCharacter = section.Deserialize(); - - Console.WriteLine(section.Keys["Name"].Value); - Console.WriteLine(savedCharacter.Name); - Console.WriteLine(section.Keys["Sword"].Value); - Console.WriteLine(savedCharacter.Attack); - Console.WriteLine(section.Keys["Shield"].Value); - Console.WriteLine(savedCharacter.Defence); - } - - static void Main() - { - HelloWorld(); - - Create(); - - Load(); - - Style(); - - Save(); - - Encrypt(); - - Compress(); - - Custom(); - - Copy(); - - Parse(); - - BindInternal(); - - BindExternal(); - - BindCustomize(); - - Serialize(); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CS/MadMilkman.Ini.Samples.CS.csproj b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CS/MadMilkman.Ini.Samples.CS.csproj deleted file mode 100644 index e803c14..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CS/MadMilkman.Ini.Samples.CS.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Debug - AnyCPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1} - Exe - Properties - MadMilkman.Ini.Samples.CS - MadMilkman.Ini.Samples.CS - v4.5 - 512 - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - - - - - - - - {bef9735d-c3cc-41e6-aac6-18c5985d3107} - MadMilkman.Ini - - - - - \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CS/Properties/AssemblyInfo.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CS/Properties/AssemblyInfo.cs deleted file mode 100644 index be592b0..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.CS/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MadMilkman.Ini.Samples.CS")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MadMilkman.Ini.Samples.CS")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b1e20845-bdae-4fbe-842c-42d4ee655565")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Compress Example.ini b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Compress Example.ini deleted file mode 100644 index d0f62ce..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Compress Example.ini +++ /dev/null @@ -1 +0,0 @@ -BAwAAB+LCAAAAAAABABV1j2OUDkQReEciT30EtpVrr+AFRAikaAJRqMORkKQQMDuIfAx98Unep/87Pvl09t/P/7//u1l/fP+3ce3Xy/rw+d/v/58e1nv332h2Wl2mknz0/w0l7ZP26dtaXFanBbS8rQ8LaXVaXVaSevT+rSWNqfNaSNtvfLxr3z9q+Zrc3FUZ8Gz8FkKtBBaEC01WiAtlJYyLZwWUEulFlQLq6VYC60F11KvBdhCbCnZwmyBtlTNUDPUTNUMNUPNHmfqHqp7qlTNUDPUTNUMNUPNVM1QM9RM1Qw1Q81UzVAz1EzVDDVDzVTNUDPUTNUcNUfNVc1Rc9Rc1Rw1R80fP+P9G+/vqGqOmqPmquaoOWquao6ao+aq5qg5aq5qjpqj5qrmqDlqrmobtY3aVrWN2kZtq9pGbaO2VW2jtlHbj1vsXmP3HlO1jdpGbavaRm2jtlVto7ZR26q2UduobVXbqG3UtqoFaoFaqFqgFqiFqgVqgVqoWqAWqIWqBWqBWjyu/3v/3wdA1QK1QC1ULVAL1ELVArVALVQtUAvUQtUStUQtVS1RS9RS1RK1RC1VLVFL1FLVErVELVUtUUvU8vFu3ofzvpyqlqglaqlqiVqilqqWqCVqqWqFWqFWqlaoFWqlaoVaoVaqVqgVaqVqhVqhVqpWqBVqpWqFWqFWj8FxF8edHKpWqBVqpWqFWqFWqtaoNWqtao1ao9aq1qg1aq1qjVqj1qrWqDVqrWqNWqPWqtaoNWqtao1ao9aPpXan2t1qqtaoNWqtaoPaoDaqNqgNaqNqg9qgNqo2qA1qo2qD2qA2qjaoDWqjaoPaoDaqNqgNaqNqg9qgNo+JezfuHbnPlft35v7duX/gfgMYovcVBAwAAA== \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Custom Example Input.ini b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Custom Example Input.ini deleted file mode 100644 index 59a1e1f..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Custom Example Input.ini +++ /dev/null @@ -1,18 +0,0 @@ - - # Hello World in few languages - - {Worlds} - - Chinese : 你好世界 - Croatian : Zdravo Svijete - Dutch : Hello Wereld - English : Hello World - French : Bonjour Monde - German : Hallo Welt - Greek : γειά σου κόσμος - Italian : Ciao Mondo - Japanese : こんにちは世界 - Korean : 여보세요 세계 - Portuguese : Olá Mundo - Russian : Здравствулте Мир - Spanish : Hola Mundo \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Custom Example Output.ini b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Custom Example Output.ini deleted file mode 100644 index fb0d7a2..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Custom Example Output.ini +++ /dev/null @@ -1,18 +0,0 @@ - - # Hello World in few languages - - {Worlds} - - Chinese : 你好世界 - Croatian : Zdravo Svijete - Dutch : Hello Wereld - English : NEW VALUE - French : Bonjour Monde - German : Hallo Welt - Greek : γειά σου κόσμος - Italian : Ciao Mondo - Japanese : こんにちは世界 - Korean : 여보세요 세계 - Portuguese : Olá Mundo - Russian : Здравствулте Мир - Spanish : Hola Mundo diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Encrypt Example.ini b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Encrypt Example.ini deleted file mode 100644 index 7da5501..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Encrypt Example.ini +++ /dev/null @@ -1 +0,0 @@ -X3zNmiTOWEKAG73S8BzrlddMtsozck0eDN7TYwYQv9kswSItWrB31gjJMHtcuGUxFcimtUxtuZ3y0UzoZ8/TBg== \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Load Example.ini b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Load Example.ini deleted file mode 100644 index 6390e19..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Load Example.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Section 1] -Key 1.1=Value 1.1 -Key 1.2=Value 1.2 -Key 1.3=Value 1.3 -Key 1.4=Value 1.4 \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Save Example.ini b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Save Example.ini deleted file mode 100644 index f9faa46..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.Files/Save Example.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Section 1] -Key 1.1=Value 1.1 -Key 1.2=Value 1.2 -Key 1.3=Value 1.3 -Key 1.4=Value 1.4 diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/IniSamples.vb b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/IniSamples.vb deleted file mode 100644 index d9bfd46..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/IniSamples.vb +++ /dev/null @@ -1,469 +0,0 @@ -Imports System -Imports System.IO -Imports System.Text -Imports System.Collections.Generic -Imports MadMilkman.Ini - -Module IniSamples - - Private Sub HelloWorld() - ' Create new file. - Dim file As New IniFile() - - ' Add new section. - Dim section As IniSection = file.Sections.Add("Section Name") - - ' Add new key and its value. - Dim key As IniKey = section.Keys.Add("Key Name", "Hello World") - - ' Read file's specific value. - Console.WriteLine(file.Sections("Section Name").Keys("Key Name").Value) - End Sub - - Private Sub Create() - ' Create new file with default formatting. - Dim file As New IniFile(New IniOptions()) - - ' Add new content. - Dim section As New IniSection(file, IniSection.GlobalSectionName) - Dim key As New IniKey(file, "Key 1", "Value 1") - file.Sections.Add(section) - section.Keys.Add(key) - - ' Add new content. - file.Sections.Add("Section 2").Keys.Add("Key 2", "Value 2") - - ' Add new content. - file.Sections.Add( - New IniSection(file, "Section 3", - New IniKey(file, "Key 3.1", "Value 3.1"), - New IniKey(file, "Key 3.2", "Value 3.2"))) - - ' Add new content. - file.Sections.Add( - New IniSection(file, "Section 4", - New Dictionary(Of String, String)() From { - {"Key 4.1", "Value 4.1"}, - {"Key 4.2", "Value 4.2"} - })) - End Sub - - Private Sub Load() - Dim options As New IniOptions() - Dim iniFile As New IniFile(options) - - ' Load file from path. - iniFile.Load("..\..\..\MadMilkman.Ini.Samples.Files\Load Example.ini") - - ' Load file from stream. - Using stream As Stream = File.OpenRead("..\..\..\MadMilkman.Ini.Samples.Files\Load Example.ini") - iniFile.Load(stream) - End Using - - ' Load file's content from string. - Dim iniContent As String = "[Section 1]" + Environment.NewLine + - "Key 1.1 = Value 1.1" + Environment.NewLine + - "Key 1.2 = Value 1.2" + Environment.NewLine + - "Key 1.3 = Value 1.3" + Environment.NewLine + - "Key 1.4 = Value 1.4" - iniFile.Load(New StringReader(iniContent)) - - ' Read file's content. - For Each section In iniFile.Sections - Console.WriteLine("SECTION: {0}", section.Name) - For Each key In section.Keys - Console.WriteLine("KEY: {0}, VALUE: {1}", key.Name, key.Value) - Next - Next - End Sub - - Private Sub Style() - Dim file As New IniFile() - file.Sections.Add("Section 1").Keys.Add("Key 1", "Value 1") - file.Sections.Add("Section 2").Keys.Add("Key 2", "Value 2") - file.Sections.Add("Section 3").Keys.Add("Key 3", "Value 3") - - ' Add leading comments. - file.Sections(0).LeadingComment.Text = "Section 1 leading comment." - file.Sections(0).Keys(0).LeadingComment.Text = "Key 1 leading comment." - - ' Add trailing comments. - file.Sections(1).TrailingComment.Text = "Section 2 trailing comment." - file.Sections(1).Keys(0).TrailingComment.Text = "Key 2 trailing comment." - - ' Add left space, indentation. - file.Sections(1).LeftIndentation = 4 - file.Sections(1).TrailingComment.LeftIndentation = 4 - file.Sections(1).Keys(0).LeftIndentation = 4 - file.Sections(1).Keys(0).TrailingComment.LeftIndentation = 4 - - ' Add above space, empty lines. - file.Sections(2).TrailingComment.EmptyLinesBefore = 2 - End Sub - - Private Sub Save() - Dim options As New IniOptions() - Dim iniFile As New IniFile(options) - iniFile.Sections.Add( - New IniSection(iniFile, "Section 1", - New IniKey(iniFile, "Key 1.1", "Value 1.1"), - New IniKey(iniFile, "Key 1.2", "Value 1.2"), - New IniKey(iniFile, "Key 1.3", "Value 1.3"), - New IniKey(iniFile, "Key 1.4", "Value 1.4"))) - - ' Save file to path. - iniFile.Save("..\..\..\MadMilkman.Ini.Samples.Files\Save Example.ini") - - ' Save file to stream. - Using stream As Stream = File.Create("..\..\..\MadMilkman.Ini.Samples.Files\Save Example.ini") - iniFile.Save(stream) - End Using - - ' Save file's content to string. - Dim contentWriter As New StringWriter() - iniFile.Save(contentWriter) - Dim iniContent As String = contentWriter.ToString() - - Console.WriteLine(iniContent) - End Sub - - Private Sub Encrypt() - ' Enable file's protection by providing an encryption password. - Dim options As IniOptions = New IniOptions() With {.EncryptionPassword = "M4dM1lkM4n.1n1"} - Dim file As IniFile = New IniFile(options) - - Dim section As IniSection = file.Sections.Add("User's Account") - section.Keys.Add("Username", "John Doe") - section.Keys.Add("Password", "P@55\/\/0|2D") - - ' Save and encrypt the file. - file.Save("..\..\..\MadMilkman.Ini.Samples.Files\Encrypt Example.ini") - - file.Sections.Clear() - - ' Load and dencrypt the file. - file.Load("..\..\..\MadMilkman.Ini.Samples.Files\Encrypt Example.ini") - - Console.WriteLine("User Name: {0}", file.Sections(0).Keys("Username").Value) - Console.WriteLine("Password: {0}", file.Sections(0).Keys("Password").Value) - End Sub - - Private Sub Compress() - ' Enable file's size reduction. - Dim options As IniOptions = New IniOptions() With {.Compression = True} - Dim file = New IniFile(options) - - For i As Integer = 1 To 100 - file.Sections.Add("Section " + i.ToString()).Keys.Add("Key " + i.ToString(), "Value " + i.ToString()) - Next - - ' Save and compress the file. - file.Save("..\..\..\MadMilkman.Ini.Samples.Files\Compress Example.ini") - - file.Sections.Clear() - - ' Load and decompress the file. - file.Load("..\..\..\MadMilkman.Ini.Samples.Files\Compress Example.ini") - - Console.WriteLine(file.Sections.Count) - End Sub - - Private Sub Custom() - ' Create new file with custom formatting. - Dim file As New IniFile( - New IniOptions() With { - .CommentStarter = IniCommentStarter.Hash, - .KeyDelimiter = IniKeyDelimiter.Colon, - .KeySpaceAroundDelimiter = True, - .SectionWrapper = IniSectionWrapper.CurlyBrackets, - .Encoding = Encoding.UTF8 - }) - - ' Load file. - file.Load("..\..\..\MadMilkman.Ini.Samples.Files\Custom Example Input.ini") - - ' Change first section's fourth key's value. - file.Sections(0).Keys(3).Value = "NEW VALUE" - - ' Save file. - file.Save("..\..\..\MadMilkman.Ini.Samples.Files\Custom Example Output.ini") - End Sub - - Private Sub Copy() - ' Create new file. - Dim file As New IniFile() - - ' Add new content. - Dim section As IniSection = file.Sections.Add("Section") - Dim key As IniKey = section.Keys.Add("Key") - - ' Add duplicate section. - file.Sections.Add(section.Copy()) - - ' Add duplicate key. - section.Keys.Add(key.Copy()) - - ' Create new file. - Dim newFile As New IniFile(New IniOptions()) - - ' Import first file's section to second file. - newFile.Sections.Add(section.Copy(newFile)) - End Sub - - Private Sub Parse() - Dim file As New IniFile() - Dim content As String = "[Player]" + Environment.NewLine + - "Full Name = John Doe" + Environment.NewLine + - "Birthday = 12/31/1999" + Environment.NewLine + - "Married = Yes" + Environment.NewLine + - "Score = 9999999" + Environment.NewLine + - "Game Time = 00:59:59" - file.Load(New StringReader(content)) - - ' Map 'yes' value as 'true' boolean. - file.ValueMappings.Add("yes", True) - ' Map 'no' value as 'false' boolean. - file.ValueMappings.Add("no", False) - - Dim playerSection As IniSection = file.Sections("Player") - - ' Retrieve player's name. - Dim playerName As String = playerSection.Keys("Full Name").Value - - ' Retrieve player's birthday as DateTime. - Dim playerBirthday As DateTime - playerSection.Keys("Birthday").TryParseValue(playerBirthday) - - ' Retrieve player's marital status as bool. - ' TryParseValue succeeds due to the mapping of 'yes' value to 'true' boolean. - Dim playerMarried As Boolean - playerSection.Keys("Married").TryParseValue(playerMarried) - - ' Retrieve player's score as long. - Dim playerScore As Long - playerSection.Keys("Score").TryParseValue(playerScore) - - ' Retrieve player's game time as TimeSpan. - Dim playerGameTime As TimeSpan - playerSection.Keys("Game Time").TryParseValue(playerGameTime) - End Sub - - Private Sub BindInternal() - Dim file As New IniFile() - Dim content As String = "[Machine Settings]" + Environment.NewLine + - "Program Files = C:\Program Files" + Environment.NewLine + - "[Application Settings]" + Environment.NewLine + - "Name = Example App" + Environment.NewLine + - "Version = 1.0" + Environment.NewLine + - "Full Name = @{Name} v@{Version}" + Environment.NewLine + - "Executable Path = @{Machine Settings|Program Files}\@{Name}.exe" - file.Load(New StringReader(content)) - - ' Bind placeholders with file's content, internal information. - file.ValueBinding.Bind() - - ' Retrieve application's full name, value is 'Example App v1.0'. - Dim appFullName As String = file.Sections("Application Settings").Keys("Full Name").Value - - ' Retrieve application's executable path, value is 'C:\\Program Files\\Example App.exe'. - Dim appExePath As String = file.Sections("Application Settings").Keys("Executable Path").Value - End Sub - - Private Sub BindExternal() - Dim file As New IniFile() - Dim content As String = "[User's Settings]" + Environment.NewLine + - "Nickname = @{User Alias}" + Environment.NewLine + - "Full Name = @{User Name} @{User Surname}" + Environment.NewLine + - "Profile Page = @{Homepage}/Profiles/@{User Alias}" - file.Load(New StringReader(content)) - - ' Bind placeholders with user's data, external information. - file.ValueBinding.Bind( - New Dictionary(Of String, String)() From - { - {"User Alias", "Johny"}, - {"User Name", "John"}, - {"User Surname", "Doe"} - }) - - ' Bind 'Homepage' placeholder with 'www.example.com' value. - file.ValueBinding.Bind( - New KeyValuePair(Of String, String)("Homepage", "www.example.com")) - - ' Retrieve user's full name, value is 'John Doe'. - Dim userFullName As String = file.Sections("User's Settings").Keys("Full Name").Value - - ' Retrieve user's profile page, value is 'www.example.com/Profiles/Johny'. - Dim userProfilePage As String = file.Sections("User's Settings").Keys("Profile Page").Value - End Sub - - Private Sub BindCustomize() - Dim file As New IniFile() - Dim content As String = "[Player]" + Environment.NewLine + - "Name = @{Name}" + Environment.NewLine + - "Surname = @{Surname}" + Environment.NewLine + - "Adult = @{Age}" + Environment.NewLine + - "Medal = @{Rank}" - file.Load(New StringReader(content)) - - ' Customize binding operation. - AddHandler file.ValueBinding.Binding, - Sub(sender, e) - ' Set placeholders that do not have a value in data source to 'UNKNOWN'. - If Not e.IsValueFound Then - e.Value = "UNKNOWN" - Return - End If - - ' Set 'Age' placeholder inside 'Adult' key to an appropriate value. - If e.PlaceholderKey.Name.Equals("Adult") AndAlso e.PlaceholderName.Equals("Age") Then - Dim age As Integer - If Integer.TryParse(e.Value, age) Then - e.Value = If((age >= 18), "YES", "NO") - Else - e.Value = "UNKNOWN" - End If - Return - End If - - ' Set 'Rank' placeholder inside 'Medal' key to an appropriate value. - If e.PlaceholderKey.Name.Equals("Medal") AndAlso e.PlaceholderName.Equals("Rank") Then - Dim rank As Integer - If Integer.TryParse(e.Value, rank) Then - Select Case rank - Case 1 - e.Value = "GOLD" - Exit Select - Case 2 - e.Value = "SILVER" - Exit Select - Case 3 - e.Value = "BRONCE" - Exit Select - Case Else - e.Value = "NONE" - Exit Select - End Select - Else - e.Value = "UNKNOWN" - End If - Return - End If - End Sub - - ' Execute binding operation. - file.ValueBinding.Bind(New Dictionary(Of String, String)() From { - {"Name", "John"}, - {"Age", "20"}, - {"Rank", "1"} - }) - End Sub - - ' Custom type used for serialization sample. - Private Class GameCharacter - Public Property Name() As String - Get - Return m_Name - End Get - Set(value As String) - m_Name = Value - End Set - End Property - Private m_Name As String - - ' Serialize this property as a key with "Sword" name. - - Public Property Attack() As Double - Get - Return m_Attack - End Get - Set(value As Double) - m_Attack = value - End Set - End Property - Private m_Attack As Double - - ' Serialize this property as a key with "Shield" name. - - Public Property Defence() As Double - Get - Return m_Defence - End Get - Set(value As Double) - m_Defence = value - End Set - End Property - Private m_Defence As Double - - ' Ignore serializing this property. - - Public Property Health() As Double - Get - Return m_Health - End Get - Set(value As Double) - m_Health = value - End Set - End Property - Private m_Health As Double - - Public Sub New() - Me.Health = 100 - End Sub - End Class - - Private Sub Serialize() - Dim file As New IniFile() - Dim section As IniSection = file.Sections.Add("User's Character") - - Dim character As New GameCharacter() - character.Name = "John" - character.Attack = 5.5 - character.Defence = 1 - character.Health = 75 - - ' Serialize GameCharacter object into section's keys. - section.Serialize(character) - - ' Deserialize section into GameCharacter object. - Dim savedCharacter As GameCharacter = section.Deserialize(Of GameCharacter)() - - Console.WriteLine(section.Keys("Name").Value) - Console.WriteLine(savedCharacter.Name) - Console.WriteLine(section.Keys("Sword").Value) - Console.WriteLine(savedCharacter.Attack) - Console.WriteLine(section.Keys("Shield").Value) - Console.WriteLine(savedCharacter.Defence) - End Sub - - Sub Main() - HelloWorld() - - Create() - - Load() - - Style() - - Save() - - Encrypt() - - Compress() - - Custom() - - Copy() - - Parse() - - BindInternal() - - BindExternal() - - BindCustomize() - - Serialize() - End Sub - -End Module \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/MadMilkman.Ini.Samples.VB.vbproj b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/MadMilkman.Ini.Samples.VB.vbproj deleted file mode 100644 index 247b4a2..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/MadMilkman.Ini.Samples.VB.vbproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - - Debug - AnyCPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11} - Exe - MadMilkman.Ini.Samples.VB.IniSamples - MadMilkman.Ini.Samples.VB - MadMilkman.Ini.Samples.VB - 512 - Console - v4.5 - - - AnyCPU - true - full - true - true - bin\Debug\ - MadMilkman.Ini.Samples.VB.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - AnyCPU - pdbonly - false - true - true - bin\Release\ - MadMilkman.Ini.Samples.VB.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - On - - - Binary - - - Off - - - On - - - - - - - - - True - Application.myapp - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - {bef9735d-c3cc-41e6-aac6-18c5985d3107} - MadMilkman.Ini - - - - - \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Application.Designer.vb b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Application.Designer.vb deleted file mode 100644 index 0aecefe..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Application.Designer.vb +++ /dev/null @@ -1,13 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.18444 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Application.myapp b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Application.myapp deleted file mode 100644 index e62f1a5..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - false - false - 0 - true - 0 - 2 - true - diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/AssemblyInfo.vb b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/AssemblyInfo.vb deleted file mode 100644 index 32a4cb2..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Resources.Designer.vb b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Resources.Designer.vb deleted file mode 100644 index 8d6d3a9..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Resources.Designer.vb +++ /dev/null @@ -1,62 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.18444 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My.Resources - - 'This class was auto-generated by the StronglyTypedResourceBuilder - 'class via a tool like ResGen or Visual Studio. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. - ''' - ''' A strongly-typed resource class, for looking up localized strings, etc. - ''' - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - - ''' - ''' Returns the cached ResourceManager instance used by this class. - ''' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("MadMilkman.Ini.Samples.VB.Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ''' - ''' Overrides the current thread's CurrentUICulture property for all - ''' resource lookups using this strongly typed resource class. - ''' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set(ByVal value As Global.System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Resources.resx b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Settings.Designer.vb b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Settings.Designer.vb deleted file mode 100644 index 72dc6d5..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Settings.Designer.vb +++ /dev/null @@ -1,73 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.18444 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - _ - Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) - -#Region "My.Settings Auto-Save Functionality" -#If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub -#End If -#End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - -#If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If -#End If - Return defaultInstance - End Get - End Property - End Class -End Namespace - -Namespace My - - _ - Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.MadMilkman.Ini.Samples.VB.My.MySettings - Get - Return Global.MadMilkman.Ini.Samples.VB.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Settings.settings b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Settings.settings deleted file mode 100644 index 85b890b..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Samples/MadMilkman.Ini.Samples.VB/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Setup.msi b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Setup.msi deleted file mode 100644 index 01be69c..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Setup.msi and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/BugFixes.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/BugFixes.cs deleted file mode 100644 index 36667ad..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/BugFixes.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System; -using System.Collections.Generic; -using NUnit.Framework; - -namespace MadMilkman.Ini.Tests -{ - [TestFixture] - public class BugFixes - { - [Test] - public void Bug1() - { - string iniFileContent = "[Segment [A]]" + Environment.NewLine + - "[Segment [A]];[Comment];" + Environment.NewLine + - - "[Segment [A][1]]" + Environment.NewLine + - "[Segment [A][1]] ;[Comment][1];" + Environment.NewLine + - - "[Segment;A]" + Environment.NewLine + - "[Segment[A;B]]" + Environment.NewLine + - "[Segment[A;B]];" + Environment.NewLine + - "[Segment[A;B]] ;[Comment];" + Environment.NewLine + - - "[Segment[A;B]]AB;Invalid comment" + Environment.NewLine + - "[Segment[A;B]][[;Invalid comment" + Environment.NewLine + - "[Segment[A;B;]"; - - IniOptions options = new IniOptions(); - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, options); - - Assert.AreEqual("Segment [A]", file.Sections[0].Name); - Assert.AreEqual("Segment [A]", file.Sections[1].Name); - Assert.AreEqual("[Comment];", file.Sections[1].LeadingComment.Text); - - Assert.AreEqual("Segment [A][1]", file.Sections[2].Name); - Assert.AreEqual("Segment [A][1]", file.Sections[3].Name); - Assert.AreEqual("[Comment][1];", file.Sections[3].LeadingComment.Text); - Assert.AreEqual(2, file.Sections[3].LeadingComment.LeftIndentation); - - Assert.AreEqual("Segment;A", file.Sections[4].Name); - Assert.AreEqual(null, file.Sections[4].LeadingComment.Text); - Assert.AreEqual("Segment[A;B]", file.Sections[5].Name); - Assert.AreEqual(null, file.Sections[5].LeadingComment.Text); - Assert.AreEqual("Segment[A;B]", file.Sections[6].Name); - Assert.AreEqual(string.Empty, file.Sections[6].LeadingComment.Text); - Assert.AreEqual("Segment[A;B]", file.Sections[7].Name); - Assert.AreEqual("[Comment];", file.Sections[7].LeadingComment.Text); - Assert.AreEqual(4, file.Sections[7].LeadingComment.LeftIndentation); - - Assert.AreEqual("Segment[A;B]", file.Sections[8].Name); - Assert.AreEqual(null, file.Sections[8].LeadingComment.Text); - Assert.AreEqual("Segment[A;B]", file.Sections[9].Name); - Assert.AreEqual(null, file.Sections[9].LeadingComment.Text); - Assert.AreEqual("Segment[A;B;", file.Sections[10].Name); - - string[] lines = IniUtilities.SaveIniFileContent(file, options); - - Assert.AreEqual("[Segment [A]]", lines[0]); - Assert.AreEqual("[Segment [A]];[Comment];", lines[1]); - Assert.AreEqual("[Segment [A][1]]", lines[2]); - Assert.AreEqual("[Segment [A][1]] ;[Comment][1];", lines[3]); - Assert.AreEqual("[Segment;A]", lines[4]); - Assert.AreEqual("[Segment[A;B]]", lines[5]); - Assert.AreEqual("[Segment[A;B]];", lines[6]); - Assert.AreEqual("[Segment[A;B]] ;[Comment];", lines[7]); - Assert.AreEqual("[Segment[A;B]]", lines[8]); - Assert.AreEqual("[Segment[A;B]]", lines[9]); - Assert.AreEqual("[Segment[A;B;]", lines[10]); - } - - public class Bug2Class - { - public string[] NullArray { get; set; } - public List NullList { get; set; } - - public string[] EmptyArray { get; set; } - public List EmptyList { get; set; } - } - - [Test] - public void Bug2() - { - var ini = new IniFile(); - var sec = ini.Sections.Add("Sample"); - - sec.Serialize( - new Bug2Class() - { - EmptyArray = new string[3], - EmptyList = new List() - }); - - var deserializeObj = sec.Deserialize(); - - Assert.IsNull(sec.Keys["NullArray"].Value); - Assert.IsNull(sec.Keys["NullList"].Value); - Assert.AreEqual("{,,}", sec.Keys["EmptyArray"].Value); - Assert.AreEqual("{}", sec.Keys["EmptyList"].Value); - - Assert.IsNull(deserializeObj.NullArray); - Assert.IsNull(deserializeObj.NullList); - CollectionAssert.AreEqual(new string[] { "", "", "" }, deserializeObj.EmptyArray); - CollectionAssert.IsEmpty(deserializeObj.EmptyList); - } - - [Test] - public void Bug3() - { - string iniFileContent = "[sektion]" + Environment.NewLine + - "key=\"Data Source=server;Initial Catalog=catalog;Integrated Security=SSPI\""; - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions()); - - IniKey key = file.Sections["sektion"].Keys["key"]; - Assert.AreEqual("\"Data Source=server;Initial Catalog=catalog;Integrated Security=SSPI\"", key.Value); - Assert.IsNull(key.LeadingComment.Text); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileCreateUpdateTests.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileCreateUpdateTests.cs deleted file mode 100644 index 041775b..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileCreateUpdateTests.cs +++ /dev/null @@ -1,400 +0,0 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using NUnit.Framework; - -namespace MadMilkman.Ini.Tests -{ - [TestFixture] - public class IniFileCreateUpdateTests - { - [Test] - public void CreateIniFileBasicTest() - { - var file = new IniFile(); - - var section1 = file.Sections.Add("Section 1."); - var section2 = file.Sections.Add("Section 2."); - var section3 = file.Sections.Add("Section 3."); - - var key1 = section1.Keys.Add("Key 1.", "Value 1."); - var key2 = section2.Keys.Add("Key 2.", "Value 2."); - var key3 = section3.Keys.Add("Key 3.", "Value 3."); - - Assert.AreEqual(3, file.Sections.Count); - - Assert.AreEqual("Section 1.", section1.Name); - Assert.AreEqual("Section 2.", section2.Name); - Assert.AreEqual("Section 3.", section3.Name); - - Assert.AreEqual(1, section1.Keys.Count); - Assert.AreEqual(1, section2.Keys.Count); - Assert.AreEqual(1, section3.Keys.Count); - - Assert.AreEqual("Key 1.", key1.Name); - Assert.AreEqual("Value 1.", key1.Value); - Assert.AreEqual("Key 2.", key2.Name); - Assert.AreEqual("Value 2.", key2.Value); - Assert.AreEqual("Key 3.", key3.Name); - Assert.AreEqual("Value 3.", key3.Value); - } - - [Test] - public void CreateIniFileAdvanceTest() - { - var file = new IniFile(); - - file.Sections.Add( - new IniSection(file, "Section 1.", - new IniKey(file, "Key 1.1.") { Value = "Value 1.1." }, - new IniKey(file, "Key 1.2.") { Value = "Value 1.2." })); - file.Sections.Add( - new IniSection(file, "Section 2.", - new IniKey(file, "Key 2.1.") { Value = "Value 2.1." }, - new IniKey(file, "Key 2.2.") { Value = "Value 2.2." })); - file.Sections.Add( - new IniSection(file, "Section 3.", - new IniKey(file, "Key 3.1.") { Value = "Value 3.1." }, - new IniKey(file, "Key 3.2.") { Value = "Value 3.2." })); - - Assert.AreEqual(3, file.Sections.Count); - - Assert.AreEqual("Section 1.", file.Sections[0].Name); - Assert.AreEqual("Section 2.", file.Sections[1].Name); - Assert.AreEqual("Section 3.", file.Sections[2].Name); - - Assert.AreEqual(2, file.Sections[0].Keys.Count); - Assert.AreEqual(2, file.Sections[1].Keys.Count); - Assert.AreEqual(2, file.Sections[2].Keys.Count); - - Assert.AreEqual("Key 1.1.", file.Sections[0].Keys[0].Name); - Assert.AreEqual("Value 1.1.", file.Sections[0].Keys[0].Value); - Assert.AreEqual("Key 1.2.", file.Sections[0].Keys[1].Name); - Assert.AreEqual("Value 1.2.", file.Sections[0].Keys[1].Value); - Assert.AreEqual("Key 2.1.", file.Sections[1].Keys[0].Name); - Assert.AreEqual("Value 2.1.", file.Sections[1].Keys[0].Value); - Assert.AreEqual("Key 2.2.", file.Sections[1].Keys[1].Name); - Assert.AreEqual("Value 2.2.", file.Sections[1].Keys[1].Value); - Assert.AreEqual("Key 3.1.", file.Sections[2].Keys[0].Name); - Assert.AreEqual("Value 3.1.", file.Sections[2].Keys[0].Value); - Assert.AreEqual("Key 3.2.", file.Sections[2].Keys[1].Name); - Assert.AreEqual("Value 3.2.", file.Sections[2].Keys[1].Value); - } - - [Test] - public void CreateIniFileExpertTest() - { - var dictionary = new Dictionary() - { - { "Key 2.1.", "Value 2.1." }, - { "Key 2.2.", "Value 2.2." }, - { "Key 2.3.", "Value 2.3." }, - { "Key 2.4.", "Value 2.4." } - }; - - var file = new IniFile(); - file.Sections.Add("Section 1.").Keys.Add(new KeyValuePair("Key 1.1.", "Value 1.1.")); - file.Sections.Add("Section 2.", dictionary); - - Assert.AreEqual(2, file.Sections.Count); - - Assert.AreEqual("Section 1.", file.Sections[0].Name); - Assert.AreEqual("Section 2.", file.Sections[1].Name); - - Assert.AreEqual(1, file.Sections[0].Keys.Count); - Assert.AreEqual(4, file.Sections[1].Keys.Count); - - Assert.AreEqual("Key 1.1.", file.Sections[0].Keys[0].Name); - Assert.AreEqual("Value 1.1.", file.Sections[0].Keys[0].Value); - Assert.AreEqual("Key 2.1.", file.Sections[1].Keys[0].Name); - Assert.AreEqual("Value 2.1.", file.Sections[1].Keys[0].Value); - Assert.AreEqual("Key 2.2.", file.Sections[1].Keys[1].Name); - Assert.AreEqual("Value 2.2.", file.Sections[1].Keys[1].Value); - Assert.AreEqual("Key 2.3.", file.Sections[1].Keys[2].Name); - Assert.AreEqual("Value 2.3.", file.Sections[1].Keys[2].Value); - Assert.AreEqual("Key 2.4.", file.Sections[1].Keys[3].Name); - Assert.AreEqual("Value 2.4.", file.Sections[1].Keys[3].Value); - } - - [Test] - public void UpdateIniFileLinqTest() - { - var file = new IniFile(); - - var section1 = file.Sections.Add("Section 1."); - - var key1 = section1.Keys.Add("Key 1.1.", "Value 1.1."); - var key2 = section1.Keys.Add("Key 1.2.", "Value 1.2."); - - foreach (var key in section1.Keys.Where(k => k.Name.Contains("1"))) - key.Name = key.Name.Replace("Key 1.", "First Section Key "); - - Assert.AreEqual("First Section Key 1.", section1.Keys[0].Name); - Assert.AreEqual("First Section Key 2.", section1.Keys[1].Name); - - var values = from key in section1.Keys select key.Value; - - Assert.AreEqual(2, values.Count()); - Assert.AreEqual("Value 1.1.", values.First()); - Assert.AreEqual("Value 1.2.", values.Last()); - } - - [Test] - public void UpdateIniFileCorrectTest() - { - var file = new IniFile(); - var section = new IniSection(file, "Section", - new IniKey(file, "Key")); - - file.Sections.Add(section); - Assert.AreEqual(1, file.Sections.Count); - - file.Sections.Clear(); - Assert.AreEqual(0, file.Sections.Count); - - file.Sections.Add(section); - Assert.AreEqual(1, file.Sections.Count); - - var key = section.Keys[0]; - section.Keys.RemoveAt(0); - Assert.AreEqual(0, section.Keys.Count); - - section.Keys.Add(key); - Assert.AreEqual(1, section.Keys.Count); - } - - [Test, ExpectedException(typeof(InvalidOperationException))] - public void UpdateIniFileIncorrectBasicTest() - { - var file = new IniFile(); - - var section = file.Sections.Add("Section"); - - file.Sections.Add(section); - } - - [Test, ExpectedException(typeof(InvalidOperationException))] - public void UpdateIniFileIncorrectAdvanceTest() - { - var file = new IniFile(new IniOptions()); - - var section = file.Sections.Add("Section"); - - var newFile = new IniFile(new IniOptions()); - newFile.Sections.Add(section); - } - - [Test] - public void UpdateIniFileCopyTest() - { - var file = new IniFile(); - file.Sections.Add( - new IniSection(file, "Section", - new IniKey(file, "Key", "Value"))); - var section = file.Sections[0]; - file.Sections.Add(section.Copy()); - - Assert.AreEqual(2, file.Sections.Count); - - section.Name = "S"; - section.Keys[0].Name = "K"; - section.Keys[0].Value = "V"; - section = file.Sections[1]; - - Assert.AreEqual("Section", section.Name); - Assert.AreEqual("Key", section.Keys[0].Name); - Assert.AreEqual("Value", section.Keys[0].Value); - - var newFile = new IniFile(); - newFile.Sections.Add(section.Copy(newFile)); - - Assert.AreEqual(1, newFile.Sections.Count); - - section.Name = "S"; - section.Keys[0].Name = "K"; - section.Keys[0].Value = "V"; - section = newFile.Sections[0]; - - Assert.AreEqual("Section", section.Name); - Assert.AreEqual("Key", section.Keys[0].Name); - Assert.AreEqual("Value", section.Keys[0].Value); - - section.Keys.Add(section.Keys[0].Copy()); - Assert.AreEqual(2, section.Keys.Count); - } - - [Test] - public void UpdateIgnoreDuplicatesTest() - { - var options = new IniOptions() - { - KeyDuplicate = IniDuplication.Ignored, - KeyNameCaseSensitive = true, - SectionDuplicate = IniDuplication.Ignored, - SectionNameCaseSensitive = false - }; - - var file = new IniFile(options); - file.Sections.Add( - new IniSection(file, "SECTION", - new IniKey(file, "KEY"), - new IniKey(file, "key"))); - file.Sections.Add( - new IniSection(file, "section")); - - Assert.AreEqual(1, file.Sections.Count); - Assert.AreEqual(2, file.Sections[0].Keys.Count); - Assert.IsTrue(file.Sections[0].Keys.Contains("KEY")); - Assert.IsTrue(file.Sections[0].Keys.Contains("key")); - - Assert.AreEqual("key", file.Sections[0].Keys[1].Name); - file.Sections[0].Keys[1].Name = "KEY"; - Assert.AreNotEqual("KEY", file.Sections[0].Keys[1].Name); - - file.Sections[0].Keys.Insert(0, "key"); - Assert.AreEqual(2, file.Sections[0].Keys.Count); - Assert.AreNotEqual("key", file.Sections[0].Keys[0].Name); - - file.Sections[0].Keys.Remove("KEY"); - Assert.IsFalse(file.Sections.Contains("KEY")); - - Assert.AreEqual("key", file.Sections[0].Keys[0].Name); - file.Sections[0].Keys[0].Name = "KEY"; - Assert.AreEqual("KEY", file.Sections[0].Keys[0].Name); - } - - [Test, ExpectedException(typeof(InvalidOperationException))] - public void UpdateDisallowDuplicatesSectionsTest() - { - var options = new IniOptions() - { - SectionDuplicate = IniDuplication.Disallowed - }; - - var file = new IniFile(options); - file.Sections.Add("SECTION1").Keys.Add("KEY1"); - var section = new IniSection(file, "SECTION1"); - file.Sections.Add(section); - } - - [Test, ExpectedException(typeof(InvalidOperationException))] - public void UpdateDisallowDuplicatesKeysTest() - { - var options = new IniOptions() - { - KeyDuplicate = IniDuplication.Disallowed, - }; - - var file = new IniFile(options); - file.Sections.Add("SECTION1").Keys.Add("KEY1"); - file.Sections.Add("SECTION1").Keys.Add("KEY1"); - - Assert.AreEqual(2, file.Sections.Count); - Assert.AreEqual(1, file.Sections[0].Keys.Count); - Assert.AreEqual(1, file.Sections[1].Keys.Count); - - var key = new IniKey(file, "KEY1"); - - file.Sections[0].Keys.Add(key); - } - - [Test] - public void UpdateArrayIndexerTest() - { - var file = new IniFile(); - file.Sections.Add( - new IniSection(file, "SECTION 0", - new IniKey(file, "UNKNOWN"), - new IniKey(file, "KEY 1"), - new IniKey(file, "KEY 2"), - new IniKey(file, "UNKNOWN"))); - - file.Sections.Add(new IniSection(file, "UNKNOWN")); - file.Sections.Add(new IniSection(file, "SEC 2")); - file.Sections.Add(new IniSection(file, "UNKNOWN")); - - bool isOneKeyNull = false; - foreach (var key in file.Sections[0].Keys["UNKNOWN", "UNKNOWN", "UNKNOWN", "KEY 2", "KEY 1"]) - { - if (key == null) - { - if (isOneKeyNull) Assert.Fail(); - isOneKeyNull = true; - } - else - key.Value = "VALUE " + key.ParentCollection.IndexOf(key); - } - - if (!isOneKeyNull) Assert.Fail(); - for (int i = 0; i < file.Sections[0].Keys.Count; i++) - Assert.AreEqual("VALUE " + i, file.Sections[0].Keys[i].Value); - - bool isOneSectionRenamed = false; - foreach (var section in file.Sections["UNKNOWN", "UNKNOWN", "SEC 2", "SECTION 2"]) - { - string newSectionName = "SECTION " + section.ParentCollection.IndexOf(section); - - if (section.Name == newSectionName) - { - if (isOneSectionRenamed) Assert.Fail(); - isOneSectionRenamed = true; - } - else - section.Name = "SECTION " + section.ParentCollection.IndexOf(section); - } - - if (!isOneSectionRenamed) Assert.Fail(); - for (int i = 0; i < file.Sections.Count; i++) - Assert.AreEqual("SECTION " + i, file.Sections[i].Name); - - var order = new IniSection(file, "ORDER", - new IniKey(file, "A"), - new IniKey(file, "B"), - new IniKey(file, "C"), - new IniKey(file, "A"), - new IniKey(file, "B"), - new IniKey(file, "C")); - file.Sections.Add(order); - - int returnedIndex = 0; - foreach (var key in order.Keys["A", "A", "B", "B", "C", "C"]) - key.Value = (returnedIndex++).ToString(); - - Assert.AreEqual("0", order.Keys[0].Value); - Assert.AreEqual("1", order.Keys[3].Value); - Assert.AreEqual("2", order.Keys[1].Value); - Assert.AreEqual("3", order.Keys[4].Value); - Assert.AreEqual("4", order.Keys[2].Value); - Assert.AreEqual("5", order.Keys[5].Value); - } - - [Test] - public void IniItemParentsTest() - { - var file = new IniFile(); - var section = new IniSection(file, "Section"); - var key = new IniKey(file, "Key"); - - Assert.AreSame(file, section.ParentFile); - Assert.AreSame(file, key.ParentFile); - - Assert.IsNull(section.ParentCollection); - Assert.IsNull(key.ParentCollection); - Assert.IsNull(key.ParentSection); - - section.Keys.Add(key); - Assert.AreSame(section.Keys, key.ParentCollection); - Assert.AreSame(section, key.ParentSection); - - file.Sections.Add(section); - Assert.AreSame(file.Sections, section.ParentCollection); - - file.Sections.Remove(section); - Assert.IsNull(section.ParentCollection); - - section.Keys.Remove(key); - Assert.IsNull(key.ParentCollection); - Assert.IsNull(key.ParentSection); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileEncryptionCompressionTests.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileEncryptionCompressionTests.cs deleted file mode 100644 index 1460ba0..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileEncryptionCompressionTests.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.IO; -using NUnit.Framework; - -namespace MadMilkman.Ini.Tests -{ - [TestFixture] - public class IniFileEncryptionCompressionTests - { - [Test] - public void CompressAndDecompressTest() - { - var file = new IniFile(); - var section = file.Sections.Add("Compression Test"); - for (int i = 0; i < 1000; i++) - section.Keys.Add( - new IniKey(file, "Key " + i, Guid.NewGuid().ToString())); - - var compressedFile = new IniFile(new IniOptions() { Compression = true }); - compressedFile.Sections.Add(section.Copy(compressedFile)); - - var fileStream = new MemoryStream(); - file.Save(fileStream); - var compressedFileStream = new MemoryStream(); - compressedFile.Save(compressedFileStream); - - Assert.That(compressedFileStream.Length, Is.LessThan(fileStream.Length)); - - compressedFile.Sections.Clear(); - compressedFile.Load(compressedFileStream); - - Assert.AreEqual(file.Sections[0].Name, compressedFile.Sections[0].Name); - for (int i = 0; i < file.Sections[0].Keys.Count; i++) - { - Assert.AreEqual(file.Sections[0].Keys[i].Name, compressedFile.Sections[0].Keys[i].Name); - Assert.AreEqual(file.Sections[0].Keys[i].Value, compressedFile.Sections[0].Keys[i].Value); - } - } - - [Test] - public void EncryptAndDecryptTest() - { - var file = new IniFile(); - var section = file.Sections.Add("Encrypt Test"); - section.Keys.Add("Key 1", "Value 1"); - section.Keys.Add("Key 2", "Value 2"); - - var encryptedFile = new IniFile(new IniOptions() { EncryptionPassword = @"abcdef" }); - encryptedFile.Sections.Add(section.Copy(encryptedFile)); - - var encryptedFileWriter = new StringWriter(); - encryptedFile.Save(encryptedFileWriter); - var encryptedFileContent = encryptedFileWriter.ToString(); - - Assert.IsFalse(encryptedFileContent.Contains("Encrypt Test")); - Assert.IsFalse(encryptedFileContent.Contains("Key 1")); - Assert.IsFalse(encryptedFileContent.Contains("Value 1")); - Assert.IsFalse(encryptedFileContent.Contains("Key 2")); - Assert.IsFalse(encryptedFileContent.Contains("Value 2")); - - encryptedFile.Sections.Clear(); - encryptedFile.Load(new StringReader(encryptedFileContent)); - - Assert.AreEqual("Encrypt Test", encryptedFile.Sections[0].Name); - Assert.AreEqual("Key 1", encryptedFile.Sections[0].Keys[0].Name); - Assert.AreEqual("Value 1", encryptedFile.Sections[0].Keys[0].Value); - Assert.AreEqual("Key 2", encryptedFile.Sections[0].Keys[1].Name); - Assert.AreEqual("Value 2", encryptedFile.Sections[0].Keys[1].Value); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileReadTests.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileReadTests.cs deleted file mode 100644 index c2987f1..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileReadTests.cs +++ /dev/null @@ -1,307 +0,0 @@ -using System; -using System.IO; -using System.Text; -using NUnit.Framework; - -namespace MadMilkman.Ini.Tests -{ - [TestFixture] - public class IniFileReadTests - { - [Test] - public void ReadDefaultTest() - { - string iniFileContent = ";Section's trailing comment." + Environment.NewLine + - "[Section's name];Section's leading comment." + Environment.NewLine + - ";Key's trailing comment." + Environment.NewLine + - "Key's name = Key's value;Key's leading comment."; - - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions()); - - Assert.AreEqual(1, file.Sections.Count); - Assert.AreEqual("Section's trailing comment.", file.Sections[0].TrailingComment.Text); - Assert.AreEqual("Section's name", file.Sections[0].Name); - Assert.AreEqual("Section's leading comment.", file.Sections[0].LeadingComment.Text); - - Assert.AreEqual(1, file.Sections[0].Keys.Count); - Assert.AreEqual("Key's trailing comment.", file.Sections[0].Keys[0].TrailingComment.Text); - Assert.AreEqual("Key's name", file.Sections[0].Keys[0].Name); - Assert.AreEqual("Key's value", file.Sections[0].Keys[0].Value); - Assert.AreEqual("Key's leading comment.", file.Sections[0].Keys[0].LeadingComment.Text); - } - - [Test] - public void ReadCustomTest() - { - string iniFileContent = "#Section's trailing comment." + Environment.NewLine + - "{Section's name}#Section's leading comment." + Environment.NewLine + - "#Key's trailing comment." + Environment.NewLine + - "Key's name : Key's value#Key's leading comment."; - - IniOptions options = new IniOptions() - { - CommentStarter = IniCommentStarter.Hash, - SectionWrapper = IniSectionWrapper.CurlyBrackets, - KeyDelimiter = IniKeyDelimiter.Colon - }; - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, options); - - Assert.AreEqual(1, file.Sections.Count); - Assert.AreEqual("Section's trailing comment.", file.Sections[0].TrailingComment.Text); - Assert.AreEqual("Section's name", file.Sections[0].Name); - Assert.AreEqual("Section's leading comment.", file.Sections[0].LeadingComment.Text); - - Assert.AreEqual(1, file.Sections[0].Keys.Count); - Assert.AreEqual("Key's trailing comment.", file.Sections[0].Keys[0].TrailingComment.Text); - Assert.AreEqual("Key's name", file.Sections[0].Keys[0].Name); - Assert.AreEqual("Key's value", file.Sections[0].Keys[0].Value); - Assert.AreEqual("Key's leading comment.", file.Sections[0].Keys[0].LeadingComment.Text); - } - - [Test] - public void ReadGlobalSectionTest() - { - string iniFileContent = ";Trailing comment1" + Environment.NewLine + - "Key1 = Value1" + Environment.NewLine + - ";Trailing comment2" + Environment.NewLine + - "Key2 = Value2"; - - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions()); - - Assert.AreEqual(1, file.Sections.Count); - Assert.AreEqual(IniSection.GlobalSectionName, file.Sections[0].Name); - - Assert.AreEqual(2, file.Sections[0].Keys.Count); - Assert.AreEqual("Trailing comment1", file.Sections[0].Keys[0].TrailingComment.Text); - Assert.AreEqual("Key1", file.Sections[0].Keys[0].Name); - Assert.AreEqual("Value1", file.Sections[0].Keys[0].Value); - Assert.AreEqual("Trailing comment2", file.Sections[0].Keys[1].TrailingComment.Text); - Assert.AreEqual("Key2", file.Sections[0].Keys[1].Name); - Assert.AreEqual("Value2", file.Sections[0].Keys[1].Value); - } - - [Test] - public void ReadMultipleGlobalSectionsTest() - { - string inputContent = "Key = Value" + Environment.NewLine + - "[Section]" + Environment.NewLine + - "Key = Value"; - IniFile file = new IniFile(); - - using (var stream = new MemoryStream(Encoding.ASCII.GetBytes(inputContent))) - { - file.Load(stream); - file.Load(stream); - file.Load(stream); - } - - Assert.AreEqual(6, file.Sections.Count); - Assert.AreEqual(IniSection.GlobalSectionName, file.Sections[0].Name); - Assert.AreEqual(IniSection.GlobalSectionName, file.Sections[2].Name); - Assert.AreEqual(IniSection.GlobalSectionName, file.Sections[4].Name); - Assert.AreEqual("Section", file.Sections[1].Name); - Assert.AreEqual("Section", file.Sections[3].Name); - Assert.AreEqual("Section", file.Sections[5].Name); - - foreach (var section in file.Sections) - Assert.AreEqual(1, section.Keys.Count); - - string outputContent; - using (var stream = new MemoryStream()) - { - file.Save(stream); - outputContent = new StreamReader(stream, Encoding.ASCII).ReadToEnd(); - } - - file.Sections.Clear(); - using (var stream = new MemoryStream(Encoding.ASCII.GetBytes(outputContent))) - file.Load(stream); - - Assert.AreEqual(6, file.Sections.Count); - Assert.AreEqual(IniSection.GlobalSectionName, file.Sections[0].Name); - Assert.AreEqual(IniSection.GlobalSectionName, file.Sections[2].Name); - Assert.AreEqual(IniSection.GlobalSectionName, file.Sections[4].Name); - Assert.AreEqual("Section", file.Sections[1].Name); - Assert.AreEqual("Section", file.Sections[3].Name); - Assert.AreEqual("Section", file.Sections[5].Name); - - foreach (var section in file.Sections) - Assert.AreEqual(1, section.Keys.Count); - } - - [Test] - public void ReadUTF8EncodingTest() - { - string iniFileContent = "[Καλημέρα κόσμε]" + Environment.NewLine + - "こんにちは 世界 = ¥ £ € $ ¢ ₡ ₢ ₣ ₤ ₥ ₦ ₧ ₨ ₩ ₪ ₫ ₭ ₮ ₯ ₹"; - - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions() { Encoding = Encoding.UTF8 }); - - Assert.AreEqual("Καλημέρα κόσμε", file.Sections[0].Name); - Assert.AreEqual("こんにちは 世界", file.Sections[0].Keys[0].Name); - Assert.AreEqual("¥ £ € $ ¢ ₡ ₢ ₣ ₤ ₥ ₦ ₧ ₨ ₩ ₪ ₫ ₭ ₮ ₯ ₹", file.Sections[0].Keys[0].Value); - } - - [Test] - public void ReadEmptyLinesTest() - { - string iniFileContent = Environment.NewLine + - " \t " + Environment.NewLine + - "[Section]" + Environment.NewLine + - Environment.NewLine + - Environment.NewLine + - " \t " + Environment.NewLine + - "Key = Value" + Environment.NewLine + - Environment.NewLine + - " \t " + Environment.NewLine + - ";" + Environment.NewLine + - "[Section]" + Environment.NewLine + - Environment.NewLine + - " \t " + Environment.NewLine + - Environment.NewLine + - ";" + Environment.NewLine + - "Key = Value"; - - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions()); - - Assert.AreEqual(2, file.Sections[0].LeadingComment.EmptyLinesBefore); - Assert.AreEqual(3, file.Sections[0].Keys[0].LeadingComment.EmptyLinesBefore); - Assert.AreEqual(2, file.Sections[1].TrailingComment.EmptyLinesBefore); - Assert.AreEqual(3, file.Sections[1].Keys[0].TrailingComment.EmptyLinesBefore); - } - - [Test] - public void ReadCommentEdgeCasesTest() - { - string iniFileContent = ";" + Environment.NewLine + - ";Section's trailing comment;" + Environment.NewLine + - "[Section]" + Environment.NewLine + - "[Section];" + Environment.NewLine + - "[Section] ;" + Environment.NewLine + - ";" + Environment.NewLine + - ";Key's trailing comment;" + Environment.NewLine + - "Key = Value " + Environment.NewLine + - "Key = Value;" + Environment.NewLine + - "Key = Value ;"; - - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions()); - - Assert.AreEqual(Environment.NewLine + "Section's trailing comment;", file.Sections[0].TrailingComment.Text); - Assert.AreEqual("Section", file.Sections[0].Name); - Assert.IsNull(file.Sections[0].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[0].LeadingComment.LeftIndentation); - - Assert.AreEqual("Section", file.Sections[1].Name); - Assert.IsEmpty(file.Sections[1].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[1].LeadingComment.LeftIndentation); - - Assert.AreEqual("Section", file.Sections[2].Name); - Assert.IsEmpty(file.Sections[2].LeadingComment.Text); - Assert.AreEqual(2, file.Sections[2].LeadingComment.LeftIndentation); - - Assert.AreEqual(Environment.NewLine + "Key's trailing comment;", file.Sections[2].Keys[0].TrailingComment.Text); - Assert.AreEqual("Key", file.Sections[2].Keys[0].Name); - Assert.AreEqual("Value", file.Sections[2].Keys[0].Value); - Assert.IsNull(file.Sections[2].Keys[0].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[2].Keys[0].LeadingComment.LeftIndentation); - - Assert.AreEqual("Key", file.Sections[2].Keys[1].Name); - Assert.AreEqual("Value", file.Sections[2].Keys[1].Value); - Assert.IsEmpty(file.Sections[2].Keys[1].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[2].Keys[1].LeadingComment.LeftIndentation); - - Assert.AreEqual("Key", file.Sections[2].Keys[2].Name); - Assert.AreEqual("Value", file.Sections[2].Keys[2].Value); - Assert.IsEmpty(file.Sections[2].Keys[2].LeadingComment.Text); - Assert.AreEqual(2, file.Sections[2].Keys[2].LeadingComment.LeftIndentation); - } - - [Test] - public void ReadValueEdgeCasesTest() - { - string iniFileContent = "[Section]" + Environment.NewLine + - "Key=" + Environment.NewLine + - "Key=;" + Environment.NewLine + - "Key= " + Environment.NewLine + - "Key= ;" + Environment.NewLine + - "Key =" + Environment.NewLine + - "Key =;" + Environment.NewLine + - "Key = " + Environment.NewLine + - "Key = ;"; - - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions()); - - Assert.IsEmpty(file.Sections[0].Keys[0].Value); - Assert.IsNull(file.Sections[0].Keys[0].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[0].Keys[0].LeadingComment.LeftIndentation); - Assert.IsEmpty(file.Sections[0].Keys[1].Value); - Assert.IsEmpty(file.Sections[0].Keys[1].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[0].Keys[1].LeadingComment.LeftIndentation); - Assert.IsEmpty(file.Sections[0].Keys[2].Value); - Assert.IsNull(file.Sections[0].Keys[2].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[0].Keys[2].LeadingComment.LeftIndentation); - Assert.IsEmpty(file.Sections[0].Keys[3].Value); - Assert.IsEmpty(file.Sections[0].Keys[3].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[0].Keys[3].LeadingComment.LeftIndentation); - Assert.IsEmpty(file.Sections[0].Keys[4].Value); - Assert.IsNull(file.Sections[0].Keys[4].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[0].Keys[4].LeadingComment.LeftIndentation); - Assert.IsEmpty(file.Sections[0].Keys[5].Value); - Assert.IsEmpty(file.Sections[0].Keys[5].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[0].Keys[5].LeadingComment.LeftIndentation); - Assert.IsEmpty(file.Sections[0].Keys[6].Value); - Assert.IsNull(file.Sections[0].Keys[6].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[0].Keys[6].LeadingComment.LeftIndentation); - Assert.IsEmpty(file.Sections[0].Keys[7].Value); - Assert.IsEmpty(file.Sections[0].Keys[7].LeadingComment.Text); - Assert.AreEqual(0, file.Sections[0].Keys[7].LeadingComment.LeftIndentation); - } - - [Test] - public void ReadSectionEdgeCasesTest() - { - string iniFileContent = "[" + Environment.NewLine + - "]" + Environment.NewLine + - "[]" + Environment.NewLine + - "[;]" + Environment.NewLine + - "[;;]" + Environment.NewLine + - "[[]]" + Environment.NewLine + - "[[]];" + Environment.NewLine + - "[[;]]" + Environment.NewLine + - "[[;]];"; - - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions()); - Assert.AreEqual(7, file.Sections.Count); - Assert.AreEqual(string.Empty, file.Sections[0].Name); - Assert.AreEqual(";", file.Sections[1].Name); - Assert.AreEqual(";;", file.Sections[2].Name); - Assert.AreEqual("[]", file.Sections[3].Name); - Assert.AreEqual("[]", file.Sections[4].Name); - Assert.AreEqual(string.Empty, file.Sections[4].LeadingComment.Text); - Assert.AreEqual("[;]", file.Sections[5].Name); - Assert.AreEqual("[;]", file.Sections[6].Name); - Assert.AreEqual(string.Empty, file.Sections[6].LeadingComment.Text); - } - - [Test] - public void ReadQuotedValue() - { - string iniFileContent = "key1 = \"Test;Test\"" + Environment.NewLine + - "key2 = \"Test;Test\";" + Environment.NewLine + - "key3 = \"Test;Test" + Environment.NewLine + - "key4 = \"Test;Test;Test\"Test;Test;Test"; - - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions()); - IniSection section = file.Sections[0]; - - Assert.AreEqual("\"Test;Test\"", file.Sections[0].Keys[0].Value); - Assert.IsNull(file.Sections[0].Keys[0].LeadingComment.Text); - Assert.AreEqual("\"Test;Test\"", file.Sections[0].Keys[1].Value); - Assert.AreEqual(string.Empty, file.Sections[0].Keys[1].LeadingComment.Text); - Assert.AreEqual("\"Test", file.Sections[0].Keys[2].Value); - Assert.AreEqual("Test", file.Sections[0].Keys[2].LeadingComment.Text); - Assert.AreEqual("\"Test;Test;Test\"Test", file.Sections[0].Keys[3].Value); - Assert.AreEqual("Test;Test", file.Sections[0].Keys[3].LeadingComment.Text); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileWriteTests.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileWriteTests.cs deleted file mode 100644 index d60f6ee..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniFileWriteTests.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System; -using System.IO; -using System.Text; -using NUnit.Framework; - -namespace MadMilkman.Ini.Tests -{ - [TestFixture] - public class IniFileWriteTests - { - [Test] - public void WriteDefaultTest() - { - IniOptions options = new IniOptions(); - IniFile file = new IniFile(options); - - file.Sections.Add( - new IniSection(file, "Section", - new IniKey(file, "Key", "Value") - { - TrailingComment = { Text = "Trailing comment" }, - LeadingComment = { Text = "Leading comment" } - }) - { - TrailingComment = { Text = "Trailing comment" }, - LeadingComment = { Text = "Leading comment" } - }); - - string[] lines = IniUtilities.SaveIniFileContent(file, options); - Assert.AreEqual(";Trailing comment", lines[0]); - Assert.AreEqual("[Section];Leading comment", lines[1]); - Assert.AreEqual(";Trailing comment", lines[2]); - Assert.AreEqual("Key=Value;Leading comment", lines[3]); - } - - [Test] - public void WriteCustomTest() - { - IniOptions options = new IniOptions() - { - KeyDelimiter = IniKeyDelimiter.Colon, - KeySpaceAroundDelimiter = true, - SectionWrapper = IniSectionWrapper.Parentheses - }; - IniFile file = new IniFile(options); - - file.Sections.Add( - new IniSection(file, "Section", - new IniKey(file, "Key", "Value"))); - - string[] lines = IniUtilities.SaveIniFileContent(file, options); - Assert.AreEqual("(Section)", lines[0]); - Assert.AreEqual("Key : Value", lines[1]); - } - - [Test] - public void WriteGlobalSectionTest() - { - IniOptions options = new IniOptions(); - IniFile file = new IniFile(options); - - file.Sections.Add( - new IniSection(file, IniSection.GlobalSectionName, - new IniKey(file, "Key1", "Value1"), - new IniKey(file, "Key2", "Value2"))); - - string[] lines = IniUtilities.SaveIniFileContent(file, options); - Assert.AreEqual("Key1=Value1", lines[0]); - Assert.AreEqual("Key2=Value2", lines[1]); - } - - [Test] - public void WriteUTF8EncodingTest() - { - IniOptions options = new IniOptions() { Encoding = Encoding.UTF8 }; - IniFile file = new IniFile(options); - - file.Sections.Add(new IniSection(file, "Καλημέρα κόσμε")); - file.Sections.Add(new IniSection(file, "こんにちは 世界")); - - string[] lines = IniUtilities.SaveIniFileContent(file, options); - Assert.AreEqual("[Καλημέρα κόσμε]", lines[0]); - Assert.AreEqual("[こんにちは 世界]", lines[1]); - } - - [Test] - public void WriteEmptyLinesTest() - { - IniOptions options = new IniOptions() { Encoding = Encoding.UTF8 }; - IniFile file = new IniFile(options); - - file.Sections.Add( - new IniSection(file, "Section", - new IniKey(file, "Key") - { - TrailingComment = { Text = string.Empty, EmptyLinesBefore = 2 }, - LeadingComment = { Text = string.Empty, EmptyLinesBefore = 1 } - }) - { - TrailingComment = { Text = string.Empty, EmptyLinesBefore = 2 }, - LeadingComment = { Text = string.Empty, EmptyLinesBefore = 1 } - }); - - string[] lines = IniUtilities.SaveIniFileContent(file, options); - Assert.IsEmpty(lines[0]); - Assert.IsEmpty(lines[1]); - Assert.AreEqual(";", lines[2]); - Assert.IsEmpty(lines[3]); - Assert.AreEqual("[Section];", lines[4]); - Assert.IsEmpty(lines[5]); - Assert.IsEmpty(lines[6]); - Assert.AreEqual(";", lines[7]); - Assert.IsEmpty(lines[8]); - Assert.AreEqual("Key=;", lines[9]); - } - - [Test] - public void WriteLeftIndentionTest() - { - IniOptions options = new IniOptions() { Encoding = Encoding.UTF8 }; - IniFile file = new IniFile(options); - - file.Sections.Add( - new IniSection(file, "Section", - new IniKey(file, "Key") - { - LeftIndentation = 2, - TrailingComment = { Text = string.Empty, LeftIndentation = 4 }, - LeadingComment = { Text = string.Empty, LeftIndentation = 2 } - }) - { - LeftIndentation = 2, - TrailingComment = { Text = string.Empty, LeftIndentation = 4 }, - LeadingComment = { Text = string.Empty, LeftIndentation = 2 } - }); - - string[] lines = IniUtilities.SaveIniFileContent(file, options); - Assert.AreEqual(" ;", lines[0]); - Assert.AreEqual(" [Section] ;", lines[1]); - Assert.AreEqual(" ;", lines[2]); - Assert.AreEqual(" Key= ;", lines[3]); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniSerializationDeserializationTests.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniSerializationDeserializationTests.cs deleted file mode 100644 index bd163af..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniSerializationDeserializationTests.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; - -namespace MadMilkman.Ini.Tests -{ - [TestFixture] - public class IniSerializationDeserializationTests - { - [Test] - public void SerializeDeserializeTest() - { - var file = new IniFile(); - var section = file.Sections.Add("Sample Class"); - - var serializedClass = new SampleClass(); - serializedClass.Initialize(); - - section.Serialize(serializedClass); - var deserializedClass = section.Deserialize(); - - Assert.IsTrue(serializedClass.Equals(deserializedClass)); - } - - [Test] - public void SerializeDeserializeAttributeTest() - { - var file = new IniFile(); - var section = file.Sections.Add("Sample Attributed Class"); - - var serializedClass = new SampleAttributedClass(); - serializedClass.Initialize(); - - section.Serialize(serializedClass); - Assert.IsNull(section.Keys["FirstSampleProperty"]); - Assert.IsNotNull(section.Keys["SecondSampleProperty"]); - Assert.IsNotNull(section.Keys["3. Sample Property"]); - Assert.IsNotNull(section.Keys["FourthSampleProperty"]); - - var deserializedClass = section.Deserialize(); - Assert.AreNotEqual(serializedClass.FirstSampleProperty, deserializedClass.FirstSampleProperty); - Assert.IsNull(deserializedClass.FirstSampleProperty); - Assert.AreEqual(serializedClass.SecondSampleProperty, deserializedClass.SecondSampleProperty); - Assert.AreEqual(serializedClass.ThirdSampleProperty, deserializedClass.ThirdSampleProperty); - Assert.IsTrue( - // null - string.IsNullOrEmpty(serializedClass.FourthSampleProperty) && - // string.Empty - string.IsNullOrEmpty(deserializedClass.FourthSampleProperty)); - } - - private class SampleClass - { - public char SampleChar { get; set; } - public string SampleString { get; set; } - public DateTime SampleDate { get; set; } - public TimeSpan SampleTime { get; set; } - public DayOfWeek SampleDay { get; set; } - public byte SampleByte { get; set; } - public double SampleDouble { get; set; } - public int[] SampleValueArray { get; set; } - public string[] SampleReferenceArray { get; set; } - public List SampleValueList { get; set; } - public List SampleReferenceList { get; set; } - - public void Initialize() - { - this.SampleChar = 'S'; - this.SampleString = "Sample"; - this.SampleDate = new DateTime(2000, 1, 10); - this.SampleTime = new TimeSpan(20, 1, 10); - this.SampleDay = DayOfWeek.Sunday; - this.SampleByte = 200; - this.SampleDouble = 2000.2; - this.SampleValueArray = new int[] { 2, 20, 200 }; - this.SampleReferenceArray = new string[] { "Sample 1", "Sample 2", "Sample 3" }; - this.SampleValueList = new List() { 2000, 20000, 200000 }; - this.SampleReferenceList = new List() { "Sample 4", "Sample 5", "Sample 6" }; - } - - public override int GetHashCode() - { - return base.GetHashCode(); - } - - public override bool Equals(object obj) - { - SampleClass sampleObj; - - if (obj == null || (sampleObj = obj as SampleClass) == null) - return false; - - return this.SampleChar == sampleObj.SampleChar && - this.SampleString == sampleObj.SampleString && - this.SampleDate == sampleObj.SampleDate && - this.SampleTime == sampleObj.SampleTime && - this.SampleDay == sampleObj.SampleDay && - this.SampleByte == sampleObj.SampleByte && - this.SampleDouble == sampleObj.SampleDouble && - this.SampleValueArray.SequenceEqual(sampleObj.SampleValueArray) && - this.SampleReferenceArray.SequenceEqual(sampleObj.SampleReferenceArray) && - this.SampleValueList.SequenceEqual(sampleObj.SampleValueList) && - this.SampleReferenceList.SequenceEqual(sampleObj.SampleReferenceList); - } - } - - private class SampleAttributedClass - { - [IniSerialization(true)] - public string FirstSampleProperty { get; set; } - [IniSerialization(false)] - public string SecondSampleProperty { get; set; } - [IniSerialization("3. Sample Property")] - public string ThirdSampleProperty { get; set; } - public string FourthSampleProperty { get; set; } - - public void Initialize() - { - this.FirstSampleProperty = "1. Sample Content"; - this.SecondSampleProperty = "2. Sample Content"; - this.ThirdSampleProperty = "3. Sample Content"; - } - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniUtilities.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniUtilities.cs deleted file mode 100644 index 36bd558..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniUtilities.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.IO; - -namespace MadMilkman.Ini.Tests -{ - public static class IniUtilities - { - public static IniFile LoadIniFileContent(string iniFileContent, IniOptions options) - { - IniFile file = new IniFile(options); - - using (var stream = new MemoryStream(options.Encoding.GetBytes(iniFileContent))) - file.Load(stream); - - return file; - } - - public static string[] SaveIniFileContent(IniFile file, IniOptions options) - { - string iniFileContent; - using (var stream = new MemoryStream()) - { - file.Save(stream); - iniFileContent = new StreamReader(stream, options.Encoding).ReadToEnd(); - } - - return iniFileContent.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniValueManipulationTests.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniValueManipulationTests.cs deleted file mode 100644 index 6e32835..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/IniValueManipulationTests.cs +++ /dev/null @@ -1,308 +0,0 @@ -using System; -using System.Collections.Generic; -using NUnit.Framework; - -namespace MadMilkman.Ini.Tests -{ - [TestFixture] - public class IniValueManipulationTests - { - [Test] - public void ParseValueTest() - { - var dateTime = new DateTime(9999, 12, 31, 23, 59, 59); - var timeSpan = new TimeSpan(10, 23, 59, 59, 999); - - var file = new IniFile(); - file.Sections.Add( - new IniSection(file, "Section", - new IniKey(file, "bool", bool.TrueString), - new IniKey(file, "number", 10.ToString()), - new IniKey(file, "date", dateTime.ToString()), - new IniKey(file, "time", timeSpan.ToString()), - new IniKey(file, "day", DayOfWeek.Sunday.ToString()))); - - bool resultingBoolean; - Assert.IsTrue(file.Sections["Section"].Keys["bool"].TryParseValue(out resultingBoolean)); - Assert.AreEqual(true, resultingBoolean); - - var numberKey = file.Sections["Section"].Keys["number"]; - - byte resultingByte; - Assert.IsTrue(numberKey.TryParseValue(out resultingByte)); - Assert.AreEqual((byte)10, resultingByte); - - sbyte resultingSignedByte; - Assert.IsTrue(numberKey.TryParseValue(out resultingSignedByte)); - Assert.AreEqual((sbyte)10, resultingSignedByte); - - short resultingShort; - Assert.IsTrue(numberKey.TryParseValue(out resultingShort)); - Assert.AreEqual((short)10, resultingShort); - - ushort resultingUnsignedShort; - Assert.IsTrue(numberKey.TryParseValue(out resultingUnsignedShort)); - Assert.AreEqual((ushort)10, resultingUnsignedShort); - - int resultingInteger; - Assert.IsTrue(numberKey.TryParseValue(out resultingInteger)); - Assert.AreEqual(10, resultingInteger); - - uint resultingUnsignedInteger; - Assert.IsTrue(numberKey.TryParseValue(out resultingUnsignedInteger)); - Assert.AreEqual(10U, resultingUnsignedInteger); - - long resultingLong; - Assert.IsTrue(numberKey.TryParseValue(out resultingLong)); - Assert.AreEqual(10L, resultingLong); - - ulong resultingUnsignedLong; - Assert.IsTrue(numberKey.TryParseValue(out resultingUnsignedLong)); - Assert.AreEqual(10UL, resultingUnsignedLong); - - float resultingSingle; - Assert.IsTrue(numberKey.TryParseValue(out resultingSingle)); - Assert.AreEqual(10F, resultingSingle); - - double resultingDouble; - Assert.IsTrue(numberKey.TryParseValue(out resultingDouble)); - Assert.AreEqual(10D, resultingDouble); - - decimal resultingDecimal; - Assert.IsTrue(numberKey.TryParseValue(out resultingDecimal)); - Assert.AreEqual(10M, resultingDecimal); - - DateTime resultingDateTime; - Assert.IsTrue(file.Sections["Section"].Keys["date"].TryParseValue(out resultingDateTime)); - Assert.AreEqual(dateTime, resultingDateTime); - - TimeSpan resultingTimeSpan; - Assert.IsTrue(file.Sections["Section"].Keys["time"].TryParseValue(out resultingTimeSpan)); - Assert.AreEqual(timeSpan, resultingTimeSpan); - - DayOfWeek resultingEnum; - Assert.IsTrue(file.Sections["Section"].Keys["day"].TryParseValue(out resultingEnum)); - Assert.AreEqual(DayOfWeek.Sunday, resultingEnum); - } - - [Test] - public void ParseValueArrayTest() - { - var file = new IniFile(); - file.Sections.Add( - new IniSection(file, "Section", - new IniKey(file, "integers", "{ 1 , 2 , 3 , 4 , 5 , 6 }"), - new IniKey(file, "invalid integers", "{ 1 , 2 , 3 , A , B , C }"), - new IniKey(file, "dates", "{1/1/2010, 1/1/2011, 1/1/2012, 1/1/2013}"))); - - var section = file.Sections[0]; - - int[] numberArray; - Assert.IsTrue(section.Keys[0].TryParseValue(out numberArray)); - Assert.AreEqual(6, numberArray.Length); - - List numberList; - Assert.IsTrue(section.Keys[0].TryParseValue(out numberList)); - Assert.AreEqual(6, numberList.Count); - - for (int i = 0; i < 6; i++) - Assert.IsTrue(numberArray[i] == i + 1 && numberList[i] == i + 1); - - Assert.IsFalse(section.Keys[1].TryParseValue(out numberArray)); - Assert.IsNull(numberArray); - - Assert.IsFalse(section.Keys[1].TryParseValue(out numberList)); - Assert.IsNull(numberList); - - DateTime[] dateArray; - Assert.IsTrue(section.Keys[2].TryParseValue(out dateArray)); - for (int i = 0; i < 4; i++) - { - Assert.AreEqual(1, dateArray[i].Day); - Assert.AreEqual(1, dateArray[i].Month); - Assert.AreEqual(2010 + i, dateArray[i].Year); - } - } - - [Test] - public void ParseValueMappingsTest() - { - var file = new IniFile(); - - file.Sections.Add( - new IniSection(file, "TRUE BOOLEANS", - new IniKey(file, "bool value", "YES"), - new IniKey(file, "bool value", "ON"), - new IniKey(file, "bool value", "1"), - new IniKey(file, "bool value", "TRUE"))); - - file.Sections.Add( - new IniSection(file, "FALSE BOOLEANS", - new IniKey(file, "bool value", "NO"), - new IniKey(file, "bool value", "OFF"), - new IniKey(file, "bool value", "0"), - new IniKey(file, "bool value", "FALSE"))); - - file.Sections.Add( - new IniSection(file, "DOUBLES", - new IniKey(file, "double value", "+∞"), - new IniKey(file, "double value", "-∞"), - new IniKey(file, "double value", "NaN"))); - - file.Sections.Add( - new IniSection(file, "ARRAYS", - new IniKey(file, "bool values", "{YES, ON, 1, TRUE}"), - new IniKey(file, "bool values", "{NO, OFF, 0, FALSE}"), - new IniKey(file, "double values", "{1.1, 10.1, 100.1, 1000.1, +∞}"))); - - file.ValueMappings.Add("yes", true); - file.ValueMappings.Add("on", true); - file.ValueMappings.Add("1", true); - file.ValueMappings.Add("no", false); - file.ValueMappings.Add("off", false); - file.ValueMappings.Add("0", false); - - file.ValueMappings.Add("+∞", double.PositiveInfinity); - file.ValueMappings.Add("-∞", double.NegativeInfinity); - file.ValueMappings.Add("NaN", double.NaN); - - foreach (var key in file.Sections["TRUE BOOLEANS"].Keys) - { - bool booleanResult; - Assert.IsTrue(key.TryParseValue(out booleanResult)); - Assert.IsTrue(booleanResult); - } - foreach (var key in file.Sections["FALSE BOOLEANS"].Keys) - { - bool booleanResult; - Assert.IsTrue(key.TryParseValue(out booleanResult)); - Assert.IsFalse(booleanResult); - } - - double doubleResult; - Assert.IsTrue(file.Sections["DOUBLES"].Keys[0].TryParseValue(out doubleResult)); - Assert.AreEqual(double.PositiveInfinity, doubleResult); - Assert.IsTrue(file.Sections["DOUBLES"].Keys[1].TryParseValue(out doubleResult)); - Assert.AreEqual(double.NegativeInfinity, doubleResult); - Assert.IsTrue(file.Sections["DOUBLES"].Keys[2].TryParseValue(out doubleResult)); - Assert.IsNaN(doubleResult); - - bool[] booleansResult; - Assert.IsTrue(file.Sections["ARRAYS"].Keys[0].TryParseValue(out booleansResult)); - foreach (var boolean in booleansResult) - Assert.IsTrue(boolean); - Assert.IsTrue(file.Sections["ARRAYS"].Keys[1].TryParseValue(out booleansResult)); - foreach (var boolean in booleansResult) - Assert.IsFalse(boolean); - List doublesResult; - Assert.IsTrue(file.Sections["ARRAYS"].Keys[2].TryParseValue(out doublesResult)); - Assert.AreEqual(1.1, doublesResult[0]); - Assert.AreEqual(10.1, doublesResult[1]); - Assert.AreEqual(100.1, doublesResult[2]); - Assert.AreEqual(1000.1, doublesResult[3]); - Assert.AreEqual(double.PositiveInfinity, doublesResult[4]); - } - - [Test] - public void BindValueWithInternalDataTest() - { - string iniFileContent = "[Source Section]\n" + - "Source Key 1 = Source Value 1\n" + - "Source Key 2 = Source Value 2\n" + - "Source Key 3 = Source Value 3\n" + - - "[Binding Section]\n" + - "Source Key 4 = Source Value 4\n" + - "Test Key 1 = @{Source Section|Source Key 1}\n" + - "Test Key 2-3 = @{Source Section|Source Key 2} and @{Source Section|Source Key 3}\n" + - "Test Key 1-4 = @{Source Section|Source Key 1} and @{Source Key 4}\n" + - "Test Key X = @{Unknown}"; - - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions()); - file.ValueBinding.Bind(); - - var bindedSection = file.Sections["Binding Section"]; - Assert.AreEqual("Source Value 1", bindedSection.Keys["Test Key 1"].Value); - Assert.AreEqual("Source Value 2 and Source Value 3", bindedSection.Keys["Test Key 2-3"].Value); - Assert.AreEqual("Source Value 1 and Source Value 4", bindedSection.Keys["Test Key 1-4"].Value); - Assert.AreEqual("@{Unknown}", bindedSection.Keys["Test Key X"].Value); - } - - [Test] - public void BindValueWithExternalDataTest() - { - string iniFileContent = "[Binding Section]\n" + - "Test Key 1 = @{First Tester}\n" + - "Test Key 2-3 = @{Second Tester} and @{Third Tester}\n" + - "Test Key 3-3-4 = {@{Third Tester}, @{Third Tester}, @{Fourth Tester}}\n" + - "Test Key X = @{Unknown}\n" + - "Test Key Nested = @{Nested @{Test}}"; - - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions()); - file.ValueBinding.Bind( - new Dictionary() - { - {"First Tester", "Source Value 1"}, - {"Second Tester", "Source Value 2"}, - {"Third Tester", "Source Value 3"}, - {"Fourth Tester", "Source Value 4"}, - {"Test", "Tester"} - }); - - var bindedSection = file.Sections["Binding Section"]; - Assert.AreEqual("Source Value 1", bindedSection.Keys["Test Key 1"].Value); - Assert.AreEqual("Source Value 2 and Source Value 3", bindedSection.Keys["Test Key 2-3"].Value); - Assert.AreEqual("{Source Value 3, Source Value 3, Source Value 4}", bindedSection.Keys["Test Key 3-3-4"].Value); - Assert.AreEqual("@{Unknown}", bindedSection.Keys["Test Key X"].Value); - Assert.AreEqual("@{Nested Tester}", bindedSection.Keys["Test Key Nested"].Value); - - file.ValueBinding.Bind(new KeyValuePair("Nested Tester", "Nested Source Value")); - Assert.AreEqual("Nested Source Value", bindedSection.Keys["Test Key Nested"].Value); - } - - [Test] - public void BindValueCustomization() - { - string iniFileContent = "[Binding Customization Section]\n" + - "Test Key 1 = @{First Tester}\n" + - "Test Key 2-3 = @{Second Tester} and @{Third Tester}\n" + - "Test Key 2-4 = @{Second Tester} and @{Fourth Tester}\n" + - "Test Key X = @{Unknown}"; - - IniFile file = IniUtilities.LoadIniFileContent(iniFileContent, new IniOptions()); - file.ValueBinding.Binding += (sender, e) => - { - if (!e.IsValueFound) - e.Value = "Missing"; - else - switch (e.PlaceholderName) - { - case "First Tester": - e.Value = "Custom " + e.Value; - break; - case "Third Tester": - e.Value = null; - break; - case "Fourth Tester": - e.Value = string.Empty; - break; - } - }; - - file.ValueBinding.Bind( - new Dictionary() - { - {"First Tester", "Source Value 1"}, - {"Second Tester", "Source Value 2"}, - {"Third Tester", "Source Value 3"}, - {"Fourth Tester", "Source Value 4"} - }); - - var bindedSection = file.Sections["Binding Customization Section"]; - Assert.AreEqual("Custom Source Value 1", bindedSection.Keys["Test Key 1"].Value); - Assert.AreEqual("Source Value 2 and @{Third Tester}", bindedSection.Keys["Test Key 2-3"].Value); - Assert.AreEqual("Source Value 2 and ", bindedSection.Keys["Test Key 2-4"].Value); - Assert.AreEqual("Missing", bindedSection.Keys["Test Key X"].Value); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/MadMilkman.Ini.Tests.csproj b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/MadMilkman.Ini.Tests.csproj deleted file mode 100644 index bbaee7b..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/MadMilkman.Ini.Tests.csproj +++ /dev/null @@ -1,76 +0,0 @@ - - - - Debug - AnyCPU - {BDD080C9-016F-4869-95DE-61171E2AB746} - Library - Properties - MadMilkman.Ini.Tests - MadMilkman.Ini.Tests - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - Resources\NUnitTestAdapter.1.2\lib\nunit.core.dll - - - Resources\NUnitTestAdapter.1.2\lib\nunit.core.interfaces.dll - - - Resources\NUnit.2.6.4\lib\nunit.framework.dll - - - Resources\NUnitTestAdapter.1.2\lib\nunit.util.dll - - - Resources\NUnitTestAdapter.1.2\lib\NUnit.VisualStudio.TestAdapter.dll - - - - - - - - - - - - - - - - - {bef9735d-c3cc-41e6-aac6-18c5985d3107} - MadMilkman.Ini - - - - - \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Properties/AssemblyInfo.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index f19b1f3..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MadMilkman.Ini.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MadMilkman.Ini.Tests")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ad6f8d98-8028-453b-be32-406fe9a3b9cd")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/console/nunit-console.exe b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/console/nunit-console.exe deleted file mode 100644 index e24be6a..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/console/nunit-console.exe and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/console/nunit-console.exe.config b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/console/nunit-console.exe.config deleted file mode 100644 index 81e5346..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/console/nunit-console.exe.config +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/lib/nunit.framework.dll b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/lib/nunit.framework.dll deleted file mode 100644 index ed6550b..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/lib/nunit.framework.dll and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/lib/nunit.framework.xml b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/lib/nunit.framework.xml deleted file mode 100644 index 450552c..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/lib/nunit.framework.xml +++ /dev/null @@ -1,10984 +0,0 @@ - - - - nunit.framework - - - - - The different targets a test action attribute can be applied to - - - - - Default target, which is determined by where the action attribute is attached - - - - - Target a individual test case - - - - - Target a suite of test cases - - - - - Delegate used by tests that execute code and - capture any thrown exception. - - - - - The Assert class contains a collection of static methods that - implement the most common assertions used in NUnit. - - - - - We don't actually want any instances of this object, but some people - like to inherit from it to add other static methods. Hence, the - protected constructor disallows any instances of this object. - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - Throws a with the message and arguments - that are passed in. This allows a test to be cut short, with a result - of success returned to NUnit. - - The message to initialize the with. - Arguments to be used in formatting the message - - - - Throws a with the message and arguments - that are passed in. This allows a test to be cut short, with a result - of success returned to NUnit. - - The message to initialize the with. - - - - Throws a with the message and arguments - that are passed in. This allows a test to be cut short, with a result - of success returned to NUnit. - - - - - Throws an with the message and arguments - that are passed in. This is used by the other Assert functions. - - The message to initialize the with. - Arguments to be used in formatting the message - - - - Throws an with the message that is - passed in. This is used by the other Assert functions. - - The message to initialize the with. - - - - Throws an . - This is used by the other Assert functions. - - - - - Throws an with the message and arguments - that are passed in. This causes the test to be reported as ignored. - - The message to initialize the with. - Arguments to be used in formatting the message - - - - Throws an with the message that is - passed in. This causes the test to be reported as ignored. - - The message to initialize the with. - - - - Throws an . - This causes the test to be reported as ignored. - - - - - Throws an with the message and arguments - that are passed in. This causes the test to be reported as inconclusive. - - The message to initialize the with. - Arguments to be used in formatting the message - - - - Throws an with the message that is - passed in. This causes the test to be reported as inconclusive. - - The message to initialize the with. - - - - Throws an . - This causes the test to be reported as Inconclusive. - - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - The actual value to test - A Constraint to be applied - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - The actual value to test - A Constraint to be applied - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - The actual value to test - A Constraint expression to be applied - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display if the condition is false - Arguments to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display if the condition is false - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - An ActualValueDelegate returning the value to be tested - A Constraint expression to be applied - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - An ActualValueDelegate returning the value to be tested - A Constraint expression to be applied - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - An ActualValueDelegate returning the value to be tested - A Constraint expression to be applied - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - The actual value to test - A Constraint to be applied - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - The actual value to test - A Constraint to be applied - The message that will be displayed on failure - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - The actual value to test - A Constraint to be applied - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that the code represented by a delegate throws an exception - that satisfies the constraint provided. - - A TestDelegate to be executed - A ThrowsConstraint used in the test - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - Used as a synonym for That in rare cases where a private setter - causes a Visual Basic compilation error. - - The actual value to test - A Constraint to be applied - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - Used as a synonym for That in rare cases where a private setter - causes a Visual Basic compilation error. - - The actual value to test - A Constraint to be applied - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - Used as a synonym for That in rare cases where a private setter - causes a Visual Basic compilation error. - - - This method is provided for use by VB developers needing to test - the value of properties with private setters. - - The actual value to test - A Constraint expression to be applied - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws a particular exception when called. - - A constraint to be satisfied by the exception - A TestDelegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws a particular exception when called. - - A constraint to be satisfied by the exception - A TestDelegate - The message that will be displayed on failure - - - - Verifies that a delegate throws a particular exception when called. - - A constraint to be satisfied by the exception - A TestDelegate - - - - Verifies that a delegate throws a particular exception when called. - - The exception Type expected - A TestDelegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws a particular exception when called. - - The exception Type expected - A TestDelegate - The message that will be displayed on failure - - - - Verifies that a delegate throws a particular exception when called. - - The exception Type expected - A TestDelegate - - - - Verifies that a delegate throws a particular exception when called. - - Type of the expected exception - A TestDelegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws a particular exception when called. - - Type of the expected exception - A TestDelegate - The message that will be displayed on failure - - - - Verifies that a delegate throws a particular exception when called. - - Type of the expected exception - A TestDelegate - - - - Verifies that a delegate throws an exception when called - and returns it. - - A TestDelegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws an exception when called - and returns it. - - A TestDelegate - The message that will be displayed on failure - - - - Verifies that a delegate throws an exception when called - and returns it. - - A TestDelegate - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - The message that will be displayed on failure - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - The message that will be displayed on failure - - - - Verifies that a delegate throws an exception of a certain Type - or one derived from it when called and returns it. - - The expected Exception Type - A TestDelegate - - - - Verifies that a delegate does not throw an exception - - A TestDelegate - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Verifies that a delegate does not throw an exception. - - A TestDelegate - The message that will be displayed on failure - - - - Verifies that a delegate does not throw an exception. - - A TestDelegate - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display in case of failure - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display in case of failure - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - The message to display in case of failure - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - The message to display in case of failure - - - - Asserts that a condition is false. If the condition is true the method throws - an . - - The evaluated condition - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - - - - Verifies that the object that is passed in is not equal to null - If the object is null then an - is thrown. - - The object that is to be tested - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - The message to display in case of failure - - - - Verifies that the object that is passed in is equal to null - If the object is not null then an - is thrown. - - The object that is to be tested - - - - Verifies that two ints are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two ints are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two ints are equal. If they are not, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two longs are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two longs are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two longs are equal. If they are not, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two unsigned ints are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two unsigned ints are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two unsigned ints are equal. If they are not, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two unsigned longs are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two unsigned longs are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two unsigned longs are equal. If they are not, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two decimals are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two decimals are equal. If they are not, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two decimals are equal. If they are not, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - The message to display in case of failure - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - The message to display in case of failure - - - - Verifies that two doubles are equal considering a delta. If the - expected value is infinity then the delta value is ignored. If - they are not equal then an is - thrown. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - - - - Verifies that two objects are equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are not equal an is thrown. - - The value that is expected - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two objects are equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are not equal an is thrown. - - The value that is expected - The actual value - The message to display in case of failure - - - - Verifies that two objects are equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are not equal an is thrown. - - The value that is expected - The actual value - - - - Verifies that two ints are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two ints are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two ints are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two longs are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two longs are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two longs are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two unsigned ints are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two unsigned ints are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two unsigned ints are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two unsigned longs are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two unsigned longs are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two unsigned longs are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two decimals are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two decimals are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two decimals are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two floats are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two floats are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two floats are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two doubles are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two doubles are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - The message to display in case of failure - - - - Verifies that two doubles are not equal. If they are equal, then an - is thrown. - - The expected value - The actual value - - - - Verifies that two objects are not equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are equal an is thrown. - - The value that is expected - The actual value - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that two objects are not equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are equal an is thrown. - - The value that is expected - The actual value - The message to display in case of failure - - - - Verifies that two objects are not equal. Two objects are considered - equal if both are null, or if both have the same value. NUnit - has special semantics for some object types. - If they are equal an is thrown. - - The value that is expected - The actual value - - - - Asserts that two objects refer to the same object. If they - are not the same an is thrown. - - The expected object - The actual object - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that two objects refer to the same object. If they - are not the same an is thrown. - - The expected object - The actual object - The message to display in case of failure - - - - Asserts that two objects refer to the same object. If they - are not the same an is thrown. - - The expected object - The actual object - - - - Asserts that two objects do not refer to the same object. If they - are the same an is thrown. - - The expected object - The actual object - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that two objects do not refer to the same object. If they - are the same an is thrown. - - The expected object - The actual object - The message to display in case of failure - - - - Asserts that two objects do not refer to the same object. If they - are the same an is thrown. - - The expected object - The actual object - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - The message to display in case of failure - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - The message to display in case of failure - - - - Verifies that the double that is passed in is an NaN value. - If the object is not NaN then an - is thrown. - - The value that is to be tested - - - - Assert that a string is empty - that is equal to string.Empty - - The string to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that a string is empty - that is equal to string.Empty - - The string to be tested - The message to display in case of failure - - - - Assert that a string is empty - that is equal to string.Empty - - The string to be tested - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing ICollection - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing ICollection - The message to display in case of failure - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing ICollection - - - - Assert that a string is not empty - that is not equal to string.Empty - - The string to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that a string is not empty - that is not equal to string.Empty - - The string to be tested - The message to display in case of failure - - - - Assert that a string is not empty - that is not equal to string.Empty - - The string to be tested - - - - Assert that an array, list or other collection is not empty - - An array, list or other collection implementing ICollection - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that an array, list or other collection is not empty - - An array, list or other collection implementing ICollection - The message to display in case of failure - - - - Assert that an array, list or other collection is not empty - - An array, list or other collection implementing ICollection - - - - Assert that a string is either null or equal to string.Empty - - The string to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that a string is either null or equal to string.Empty - - The string to be tested - The message to display in case of failure - - - - Assert that a string is either null or equal to string.Empty - - The string to be tested - - - - Assert that a string is not null or empty - - The string to be tested - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Assert that a string is not null or empty - - The string to be tested - The message to display in case of failure - - - - Assert that a string is not null or empty - - The string to be tested - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - - - - Asserts that an object may be assigned a value of a given Type. - - The expected Type. - The object under examination - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - The message to display in case of failure - - - - Asserts that an object may not be assigned a value of a given Type. - - The expected Type. - The object under examination - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is an instance of a given type. - - The expected Type - The object being examined - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - The message to display in case of failure - - - - Asserts that an object is not an instance of a given type. - - The expected Type - The object being examined - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than the second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - The message to display in case of failure - - - - Verifies that the first value is greater than or equal tothe second - value. If it is not, then an - is thrown. - - The first value, expected to be greater - The second value, expected to be less - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - The message to display in case of failure - - - - Verifies that the first value is less than or equal to the second - value. If it is not, then an - is thrown. - - The first value, expected to be less - The second value, expected to be greater - - - - Asserts that an object is contained in a list. - - The expected object - The list to be examined - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Asserts that an object is contained in a list. - - The expected object - The list to be examined - The message to display in case of failure - - - - Asserts that an object is contained in a list. - - The expected object - The list to be examined - - - - Helper for Assert.AreEqual(double expected, double actual, ...) - allowing code generation to work consistently. - - The expected value - The actual value - The maximum acceptable difference between the - the expected and the actual - The message to display in case of failure - Array of objects to be used in formatting the message - - - - Gets the number of assertions executed so far and - resets the counter to zero. - - - - - AssertionHelper is an optional base class for user tests, - allowing the use of shorter names for constraints and - asserts and avoiding conflict with the definition of - , from which it inherits much of its - behavior, in certain mock object frameworks. - - - - - Helper class with properties and methods that supply - a number of constraints used in Asserts. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding only if a specified number of them succeed. - - - - - Returns a new PropertyConstraintExpression, which will either - test for the existence of the named property on the object - being tested or apply any following constraint to that property. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns a constraint that tests two items for equality - - - - - Returns a constraint that tests that two references are the same object - - - - - Returns a constraint that tests whether the - actual value is greater than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a collection containing the same elements as the - collection supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a subset of the collection supplied as an argument. - - - - - Returns a new CollectionContainsConstraint checking for the - presence of a particular object in the collection. - - - - - Returns a new CollectionContainsConstraint checking for the - presence of a particular object in the collection. - - - - - Returns a new ContainsConstraint. This constraint - will, in turn, make use of the appropriate second-level - constraint, depending on the type of the actual argument. - This overload is only used if the item sought is a string, - since any other type implies that we are looking for a - collection member. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the regular expression supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the regular expression supplied as an argument. - - - - - Returns a constraint that fails if the actual - value matches the pattern supplied as an argument. - - - - - Returns a constraint that tests whether the path provided - is the same as an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is the same path or under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is the same path or under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the actual value falls - within a specified range. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them succeed. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if at least one of them succeeds. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them fail. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Length property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Count property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Message property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the InnerException property of the object being tested. - - - - - Returns a constraint that tests for null - - - - - Returns a constraint that tests for True - - - - - Returns a constraint that tests for False - - - - - Returns a constraint that tests for a positive value - - - - - Returns a constraint that tests for a negative value - - - - - Returns a constraint that tests for NaN - - - - - Returns a constraint that tests for empty - - - - - Returns a constraint that tests whether a collection - contains all unique items. - - - - - Returns a constraint that tests whether an object graph is serializable in binary format. - - - - - Returns a constraint that tests whether an object graph is serializable in xml format. - - - - - Returns a constraint that tests whether a collection is ordered - - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. Works - identically to Assert.That. - - The actual value to test - A Constraint to be applied - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. Works - identically to Assert.That. - - The actual value to test - A Constraint to be applied - The message to be displayed in case of failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. Works - identically to Assert.That. - - The actual value to test - A Constraint to be applied - The message to be displayed in case of failure - Arguments to use in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . Works Identically to - . - - The evaluated condition - The message to display if the condition is false - Arguments to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . Works Identically to - . - - The evaluated condition - The message to display if the condition is false - - - - Asserts that a condition is true. If the condition is false the method throws - an . Works Identically to . - - The evaluated condition - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint expression to be applied - An ActualValueDelegate returning the value to be tested - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - A Constraint expression to be applied - An ActualValueDelegate returning the value to be tested - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - An ActualValueDelegate returning the value to be tested - A Constraint expression to be applied - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - The actual value to test - A Constraint to be applied - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - The actual value to test - A Constraint to be applied - The message that will be displayed on failure - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an assertion exception on failure. - - The actual value to test - A Constraint to be applied - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that the code represented by a delegate throws an exception - that satisfies the constraint provided. - - A TestDelegate to be executed - A ThrowsConstraint used in the test - - - - Returns a ListMapper based on a collection. - - The original collection - - - - - Provides static methods to express the assumptions - that must be met for a test to give a meaningful - result. If an assumption is not met, the test - should produce an inconclusive result. - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display if the condition is false - Arguments to be used in formatting the message - - - - Asserts that a condition is true. If the condition is false the method throws - an . - - The evaluated condition - The message to display if the condition is false - - - - Asserts that a condition is true. If the condition is false the - method throws an . - - The evaluated condition - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - An ActualValueDelegate returning the value to be tested - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - An ActualValueDelegate returning the value to be tested - The message that will be displayed on failure - - - - Apply a constraint to an actual value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - An ActualValueDelegate returning the value to be tested - A Constraint expression to be applied - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - The message that will be displayed on failure - - - - Apply a constraint to a referenced value, succeeding if the constraint - is satisfied and throwing an InconclusiveException on failure. - - A Constraint expression to be applied - The actual value to test - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that the code represented by a delegate throws an exception - that satisfies the constraint provided. - - A TestDelegate to be executed - A ThrowsConstraint used in the test - - - - Waits for pending asynchronous operations to complete, if appropriate, - and returns a proper result of the invocation by unwrapping task results - - The raw result of the method invocation - The unwrapped result, if necessary - - - - A set of Assert methods operationg on one or more collections - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - Asserts that all items contained in collection are of the type specified by expectedType. - - IEnumerable containing objects to be considered - System.Type that all objects in collection must be instances of - - - - Asserts that all items contained in collection are of the type specified by expectedType. - - IEnumerable containing objects to be considered - System.Type that all objects in collection must be instances of - The message that will be displayed on failure - - - - Asserts that all items contained in collection are of the type specified by expectedType. - - IEnumerable containing objects to be considered - System.Type that all objects in collection must be instances of - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that all items contained in collection are not equal to null. - - IEnumerable containing objects to be considered - - - - Asserts that all items contained in collection are not equal to null. - - IEnumerable containing objects to be considered - The message that will be displayed on failure - - - - Asserts that all items contained in collection are not equal to null. - - IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Ensures that every object contained in collection exists within the collection - once and only once. - - IEnumerable of objects to be considered - - - - Ensures that every object contained in collection exists within the collection - once and only once. - - IEnumerable of objects to be considered - The message that will be displayed on failure - - - - Ensures that every object contained in collection exists within the collection - once and only once. - - IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - The message that will be displayed on failure - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are exactly equal. The collections must have the same count, - and contain the exact same objects in the same order. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - - - - Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - - - - Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are not exactly equal. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - - - - Asserts that expected and actual are not exactly equal. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - - - - Asserts that expected and actual are not exactly equal. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - - - - Asserts that expected and actual are not exactly equal. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - The message that will be displayed on failure - - - - Asserts that expected and actual are not exactly equal. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are not exactly equal. - If comparer is not null then it will be used to compare the objects. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The IComparer to use in comparing objects from each IEnumerable - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that expected and actual are not equivalent. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - - - - Asserts that expected and actual are not equivalent. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - - - - Asserts that expected and actual are not equivalent. - - The first IEnumerable of objects to be considered - The second IEnumerable of objects to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that collection contains actual as an item. - - IEnumerable of objects to be considered - Object to be found within collection - - - - Asserts that collection contains actual as an item. - - IEnumerable of objects to be considered - Object to be found within collection - The message that will be displayed on failure - - - - Asserts that collection contains actual as an item. - - IEnumerable of objects to be considered - Object to be found within collection - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that collection does not contain actual as an item. - - IEnumerable of objects to be considered - Object that cannot exist within collection - - - - Asserts that collection does not contain actual as an item. - - IEnumerable of objects to be considered - Object that cannot exist within collection - The message that will be displayed on failure - - - - Asserts that collection does not contain actual as an item. - - IEnumerable of objects to be considered - Object that cannot exist within collection - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that the superset does not contain the subset - - The IEnumerable subset to be considered - The IEnumerable superset to be considered - - - - Asserts that the superset does not contain the subset - - The IEnumerable subset to be considered - The IEnumerable superset to be considered - The message that will be displayed on failure - - - - Asserts that the superset does not contain the subset - - The IEnumerable subset to be considered - The IEnumerable superset to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Asserts that the superset contains the subset. - - The IEnumerable subset to be considered - The IEnumerable superset to be considered - - - - Asserts that the superset contains the subset. - - The IEnumerable subset to be considered - The IEnumerable superset to be considered - The message that will be displayed on failure - - - - Asserts that the superset contains the subset. - - The IEnumerable subset to be considered - The IEnumerable superset to be considered - The message that will be displayed on failure - Arguments to be used in formatting the message - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - Arguments to be used in formatting the message - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - - - - Assert that an array,list or other collection is empty - - An array, list or other collection implementing IEnumerable - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - Arguments to be used in formatting the message - - - - Assert that an array, list or other collection is empty - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - - - - Assert that an array,list or other collection is empty - - An array, list or other collection implementing IEnumerable - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - Arguments to be used in formatting the message - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - The message to be displayed on failure - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - A custom comparer to perform the comparisons - The message to be displayed on failure - Arguments to be used in formatting the message - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - A custom comparer to perform the comparisons - The message to be displayed on failure - - - - Assert that an array, list or other collection is ordered - - An array, list or other collection implementing IEnumerable - A custom comparer to perform the comparisons - - - - Helper class with properties and methods that supply - a number of constraints used in Asserts. - - - - - Returns a new CollectionContainsConstraint checking for the - presence of a particular object in the collection. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Summary description for DirectoryAssert - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - We don't actually want any instances of this object, but some people - like to inherit from it to add other static methods. Hence, the - protected constructor disallows any instances of this object. - - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - The message to display if directories are not equal - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - The message to display if directories are not equal - - - - Verifies that two directories are equal. Two directories are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - The message to display if directories are not equal - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory containing the value that is expected - A directory containing the actual value - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - The message to display if directories are equal - Arguments to be used in formatting the message - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - The message to display if directories are equal - - - - Asserts that two directories are not equal. If they are equal - an is thrown. - - A directory path string containing the value that is expected - A directory path string containing the actual value - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - The message to display if directories are not equal - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - The message to display if directories are not equal - - - - Asserts that the directory is empty. If it is not empty - an is thrown. - - A directory to search - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - The message to display if directories are not equal - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - The message to display if directories are not equal - Arguments to be used in formatting the message - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - The message to display if directories are not equal - - - - Asserts that the directory is not empty. If it is empty - an is thrown. - - A directory to search - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - Arguments to be used in formatting the message - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - Arguments to be used in formatting the message - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - - - - Asserts that path contains actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - Arguments to be used in formatting the message - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - Arguments to be used in formatting the message - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - The message to display if directory is not within the path - - - - Asserts that path does not contain actual as a subdirectory or - an is thrown. - - A directory to search - sub-directory asserted to exist under directory - - - - Summary description for FileAssert. - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - We don't actually want any instances of this object, but some people - like to inherit from it to add other static methods. Hence, the - protected constructor disallows any instances of this object. - - - - - Verifies that two Streams are equal. Two Streams are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The expected Stream - The actual Stream - The message to display if Streams are not equal - Arguments to be used in formatting the message - - - - Verifies that two Streams are equal. Two Streams are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The expected Stream - The actual Stream - The message to display if objects are not equal - - - - Verifies that two Streams are equal. Two Streams are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The expected Stream - The actual Stream - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A file containing the value that is expected - A file containing the actual value - The message to display if Streams are not equal - Arguments to be used in formatting the message - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A file containing the value that is expected - A file containing the actual value - The message to display if objects are not equal - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - A file containing the value that is expected - A file containing the actual value - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - The message to display if Streams are not equal - Arguments to be used in formatting the message - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - The message to display if objects are not equal - - - - Verifies that two files are equal. Two files are considered - equal if both are null, or if both have the same value byte for byte. - If they are not equal an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - - - - Asserts that two Streams are not equal. If they are equal - an is thrown. - - The expected Stream - The actual Stream - The message to be displayed when the two Stream are the same. - Arguments to be used in formatting the message - - - - Asserts that two Streams are not equal. If they are equal - an is thrown. - - The expected Stream - The actual Stream - The message to be displayed when the Streams are the same. - - - - Asserts that two Streams are not equal. If they are equal - an is thrown. - - The expected Stream - The actual Stream - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - A file containing the value that is expected - A file containing the actual value - The message to display if Streams are not equal - Arguments to be used in formatting the message - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - A file containing the value that is expected - A file containing the actual value - The message to display if objects are not equal - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - A file containing the value that is expected - A file containing the actual value - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - The message to display if Streams are not equal - Arguments to be used in formatting the message - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - The message to display if objects are not equal - - - - Asserts that two files are not equal. If they are equal - an is thrown. - - The path to a file containing the value that is expected - The path to a file containing the actual value - - - - GlobalSettings is a place for setting default values used - by the framework in performing asserts. - - - - - Default tolerance for floating point equality - - - - - Class used to guard against unexpected argument values - by throwing an appropriate exception. - - - - - Throws an exception if an argument is null - - The value to be tested - The name of the argument - - - - Throws an exception if a string argument is null or empty - - The value to be tested - The name of the argument - - - - Helper class with properties and methods that supply - a number of constraints used in Asserts. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding only if a specified number of them succeed. - - - - - Returns a new PropertyConstraintExpression, which will either - test for the existence of the named property on the object - being tested or apply any following constraint to that property. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns a new CollectionContainsConstraint checking for the - presence of a particular object in the collection. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them succeed. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if at least one of them succeeds. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them fail. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Length property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Count property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Message property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the InnerException property of the object being tested. - - - - - Interface implemented by a user fixture in order to - validate any expected exceptions. It is only called - for test methods marked with the ExpectedException - attribute. - - - - - Method to handle an expected exception - - The exception to be handled - - - - Helper class with properties and methods that supply - a number of constraints used in Asserts. - - - - - Returns a constraint that tests two items for equality - - - - - Returns a constraint that tests that two references are the same object - - - - - Returns a constraint that tests whether the - actual value is greater than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a collection containing the same elements as the - collection supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a subset of the collection supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the regular expression supplied as an argument. - - - - - Returns a constraint that tests whether the path provided - is the same as an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is the same path or under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the actual value falls - within a specified range. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them succeed. - - - - - Returns a constraint that tests for null - - - - - Returns a constraint that tests for True - - - - - Returns a constraint that tests for False - - - - - Returns a constraint that tests for a positive value - - - - - Returns a constraint that tests for a negative value - - - - - Returns a constraint that tests for NaN - - - - - Returns a constraint that tests for empty - - - - - Returns a constraint that tests whether a collection - contains all unique items. - - - - - Returns a constraint that tests whether an object graph is serializable in binary format. - - - - - Returns a constraint that tests whether an object graph is serializable in xml format. - - - - - Returns a constraint that tests whether a collection is ordered - - - - - The ITestCaseData interface is implemented by a class - that is able to return complete testcases for use by - a parameterized test method. - - NOTE: This interface is used in both the framework - and the core, even though that results in two different - types. However, sharing the source code guarantees that - the various implementations will be compatible and that - the core is able to reflect successfully over the - framework implementations of ITestCaseData. - - - - - Gets the argument list to be provided to the test - - - - - Gets the expected result - - - - - Indicates whether a result has been specified. - This is necessary because the result may be - null, so it's value cannot be checked. - - - - - Gets the expected exception Type - - - - - Gets the FullName of the expected exception - - - - - Gets the name to be used for the test - - - - - Gets the description of the test - - - - - Gets a value indicating whether this is ignored. - - true if ignored; otherwise, false. - - - - Gets a value indicating whether this is explicit. - - true if explicit; otherwise, false. - - - - Gets the ignore reason. - - The ignore reason. - - - - The Iz class is a synonym for Is intended for use in VB, - which regards Is as a keyword. - - - - - The List class is a helper class with properties and methods - that supply a number of constraints used with lists and collections. - - - - - List.Map returns a ListMapper, which can be used to map - the original collection to another collection. - - - - - - - ListMapper is used to transform a collection used as an actual argument - producing another collection to be used in the assertion. - - - - - Construct a ListMapper based on a collection - - The collection to be transformed - - - - Produces a collection containing all the values of a property - - The collection of property values - - - - - Randomizer returns a set of random values in a repeatable - way, to allow re-running of tests if necessary. - - - - - Get a randomizer for a particular member, returning - one that has already been created if it exists. - This ensures that the same values are generated - each time the tests are reloaded. - - - - - Get a randomizer for a particular parameter, returning - one that has already been created if it exists. - This ensures that the same values are generated - each time the tests are reloaded. - - - - - Construct a randomizer using a random seed - - - - - Construct a randomizer using a specified seed - - - - - Return an array of random doubles between 0.0 and 1.0. - - - - - - - Return an array of random doubles with values in a specified range. - - - - - Return an array of random ints with values in a specified range. - - - - - Get a random seed for use in creating a randomizer. - - - - - The SpecialValue enum is used to represent TestCase arguments - that cannot be used as arguments to an Attribute. - - - - - Null represents a null value, which cannot be used as an - argument to an attribute under .NET 1.x - - - - - Basic Asserts on strings. - - - - - The Equals method throws an AssertionException. This is done - to make sure there is no mistake by calling this function. - - - - - - - override the default ReferenceEquals to throw an AssertionException. This - implementation makes sure there is no mistake in calling this function - as part of Assert. - - - - - - - Asserts that a string is found within another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string is found within another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string is found within another string. - - The expected string - The string to be examined - - - - Asserts that a string is not found within another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string is found within another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string is found within another string. - - The expected string - The string to be examined - - - - Asserts that a string starts with another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string starts with another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string starts with another string. - - The expected string - The string to be examined - - - - Asserts that a string does not start with another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string does not start with another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string does not start with another string. - - The expected string - The string to be examined - - - - Asserts that a string ends with another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string ends with another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string ends with another string. - - The expected string - The string to be examined - - - - Asserts that a string does not end with another string. - - The expected string - The string to be examined - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string does not end with another string. - - The expected string - The string to be examined - The message to display in case of failure - - - - Asserts that a string does not end with another string. - - The expected string - The string to be examined - - - - Asserts that two strings are equal, without regard to case. - - The expected string - The actual string - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that two strings are equal, without regard to case. - - The expected string - The actual string - The message to display in case of failure - - - - Asserts that two strings are equal, without regard to case. - - The expected string - The actual string - - - - Asserts that two strings are not equal, without regard to case. - - The expected string - The actual string - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that two strings are Notequal, without regard to case. - - The expected string - The actual string - The message to display in case of failure - - - - Asserts that two strings are not equal, without regard to case. - - The expected string - The actual string - - - - Asserts that a string matches an expected regular expression pattern. - - The regex pattern to be matched - The actual string - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string matches an expected regular expression pattern. - - The regex pattern to be matched - The actual string - The message to display in case of failure - - - - Asserts that a string matches an expected regular expression pattern. - - The regex pattern to be matched - The actual string - - - - Asserts that a string does not match an expected regular expression pattern. - - The regex pattern to be used - The actual string - The message to display in case of failure - Arguments used in formatting the message - - - - Asserts that a string does not match an expected regular expression pattern. - - The regex pattern to be used - The actual string - The message to display in case of failure - - - - Asserts that a string does not match an expected regular expression pattern. - - The regex pattern to be used - The actual string - - - - The TestCaseData class represents a set of arguments - and other parameter info to be used for a parameterized - test case. It provides a number of instance modifiers - for use in initializing the test case. - - Note: Instance modifiers are getters that return - the same instance after modifying it's state. - - - - - The argument list to be provided to the test - - - - - The expected result to be returned - - - - - Set to true if this has an expected result - - - - - The expected exception Type - - - - - The FullName of the expected exception - - - - - The name to be used for the test - - - - - The description of the test - - - - - A dictionary of properties, used to add information - to tests without requiring the class to change. - - - - - If true, indicates that the test case is to be ignored - - - - - If true, indicates that the test case is marked explicit - - - - - The reason for ignoring a test case - - - - - Initializes a new instance of the class. - - The arguments. - - - - Initializes a new instance of the class. - - The argument. - - - - Initializes a new instance of the class. - - The first argument. - The second argument. - - - - Initializes a new instance of the class. - - The first argument. - The second argument. - The third argument. - - - - Sets the expected result for the test - - The expected result - A modified TestCaseData - - - - Sets the expected exception type for the test - - Type of the expected exception. - The modified TestCaseData instance - - - - Sets the expected exception type for the test - - FullName of the expected exception. - The modified TestCaseData instance - - - - Sets the name of the test case - - The modified TestCaseData instance - - - - Sets the description for the test case - being constructed. - - The description. - The modified TestCaseData instance. - - - - Applies a category to the test - - - - - - - Applies a named property to the test - - - - - - - - Applies a named property to the test - - - - - - - - Applies a named property to the test - - - - - - - - Ignores this TestCase. - - - - - - Ignores this TestCase, specifying the reason. - - The reason. - - - - - Marks this TestCase as Explicit - - - - - - Marks this TestCase as Explicit, specifying the reason. - - The reason. - - - - - Gets the argument list to be provided to the test - - - - - Gets the expected result - - - - - Returns true if the result has been set - - - - - Gets the expected exception Type - - - - - Gets the FullName of the expected exception - - - - - Gets the name to be used for the test - - - - - Gets the description of the test - - - - - Gets a value indicating whether this is ignored. - - true if ignored; otherwise, false. - - - - Gets a value indicating whether this is explicit. - - true if explicit; otherwise, false. - - - - Gets the ignore reason. - - The ignore reason. - - - - Gets a list of categories associated with this test. - - - - - Gets the property dictionary for this test - - - - - Provide the context information of the current test - - - - - Constructs a TestContext using the provided context dictionary - - A context dictionary - - - - Get the current test context. This is created - as needed. The user may save the context for - use within a test, but it should not be used - outside the test for which it is created. - - - - - Gets a TestAdapter representing the currently executing test in this context. - - - - - Gets a ResultAdapter representing the current result for the test - executing in this context. - - - - - Gets the directory containing the current test assembly. - - - - - Gets the directory to be used for outputing files created - by this test run. - - - - - TestAdapter adapts a Test for consumption by - the user test code. - - - - - Constructs a TestAdapter for this context - - The context dictionary - - - - The name of the test. - - - - - The FullName of the test - - - - - The properties of the test. - - - - - ResultAdapter adapts a TestResult for consumption by - the user test code. - - - - - Construct a ResultAdapter for a context - - The context holding the result - - - - The TestState of current test. This maps to the ResultState - used in nunit.core and is subject to change in the future. - - - - - The TestStatus of current test. This enum will be used - in future versions of NUnit and so is to be preferred - to the TestState value. - - - - - Provides details about a test - - - - - Creates an instance of TestDetails - - The fixture that the test is a member of, if available. - The method that implements the test, if available. - The full name of the test. - A string representing the type of test, e.g. "Test Case". - Indicates if the test represents a suite of tests. - - - - The fixture that the test is a member of, if available. - - - - - The method that implements the test, if available. - - - - - The full name of the test. - - - - - A string representing the type of test, e.g. "Test Case". - - - - - Indicates if the test represents a suite of tests. - - - - - The ResultState enum indicates the result of running a test - - - - - The result is inconclusive - - - - - The test was not runnable. - - - - - The test has been skipped. - - - - - The test has been ignored. - - - - - The test succeeded - - - - - The test failed - - - - - The test encountered an unexpected exception - - - - - The test was cancelled by the user - - - - - The TestStatus enum indicates the result of running a test - - - - - The test was inconclusive - - - - - The test has skipped - - - - - The test succeeded - - - - - The test failed - - - - - Helper class with static methods used to supply constraints - that operate on strings. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that fails if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the Regex pattern supplied as an argument. - - - - - Returns a constraint that fails if the actual - value matches the pattern supplied as an argument. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them succeed. - - - - - TextMessageWriter writes constraint descriptions and messages - in displayable form as a text stream. It tailors the display - of individual message components to form the standard message - format of NUnit assertion failure messages. - - - - - MessageWriter is the abstract base for classes that write - constraint descriptions and messages in some form. The - class has separate methods for writing various components - of a message, allowing implementations to tailor the - presentation as needed. - - - - - Construct a MessageWriter given a culture - - - - - Method to write single line message with optional args, usually - written to precede the general failure message. - - The message to be written - Any arguments used in formatting the message - - - - Method to write single line message with optional args, usually - written to precede the general failure message, at a givel - indentation level. - - The indentation level of the message - The message to be written - Any arguments used in formatting the message - - - - Display Expected and Actual lines for a constraint. This - is called by MessageWriter's default implementation of - WriteMessageTo and provides the generic two-line display. - - The constraint that failed - - - - Display Expected and Actual lines for given values. This - method may be called by constraints that need more control over - the display of actual and expected values than is provided - by the default implementation. - - The expected value - The actual value causing the failure - - - - Display Expected and Actual lines for given values, including - a tolerance value on the Expected line. - - The expected value - The actual value causing the failure - The tolerance within which the test was made - - - - Display the expected and actual string values on separate lines. - If the mismatch parameter is >=0, an additional line is displayed - line containing a caret that points to the mismatch point. - - The expected string value - The actual string value - The point at which the strings don't match or -1 - If true, case is ignored in locating the point where the strings differ - If true, the strings should be clipped to fit the line - - - - Writes the text for a connector. - - The connector. - - - - Writes the text for a predicate. - - The predicate. - - - - Writes the text for an expected value. - - The expected value. - - - - Writes the text for a modifier - - The modifier. - - - - Writes the text for an actual value. - - The actual value. - - - - Writes the text for a generalized value. - - The value. - - - - Writes the text for a collection value, - starting at a particular point, to a max length - - The collection containing elements to write. - The starting point of the elements to write - The maximum number of elements to write - - - - Abstract method to get the max line length - - - - - Prefix used for the expected value line of a message - - - - - Prefix used for the actual value line of a message - - - - - Length of a message prefix - - - - - Construct a TextMessageWriter - - - - - Construct a TextMessageWriter, specifying a user message - and optional formatting arguments. - - - - - - - Method to write single line message with optional args, usually - written to precede the general failure message, at a givel - indentation level. - - The indentation level of the message - The message to be written - Any arguments used in formatting the message - - - - Display Expected and Actual lines for a constraint. This - is called by MessageWriter's default implementation of - WriteMessageTo and provides the generic two-line display. - - The constraint that failed - - - - Display Expected and Actual lines for given values. This - method may be called by constraints that need more control over - the display of actual and expected values than is provided - by the default implementation. - - The expected value - The actual value causing the failure - - - - Display Expected and Actual lines for given values, including - a tolerance value on the expected line. - - The expected value - The actual value causing the failure - The tolerance within which the test was made - - - - Display the expected and actual string values on separate lines. - If the mismatch parameter is >=0, an additional line is displayed - line containing a caret that points to the mismatch point. - - The expected string value - The actual string value - The point at which the strings don't match or -1 - If true, case is ignored in string comparisons - If true, clip the strings to fit the max line length - - - - Writes the text for a connector. - - The connector. - - - - Writes the text for a predicate. - - The predicate. - - - - Write the text for a modifier. - - The modifier. - - - - Writes the text for an expected value. - - The expected value. - - - - Writes the text for an actual value. - - The actual value. - - - - Writes the text for a generalized value. - - The value. - - - - Writes the text for a collection value, - starting at a particular point, to a max length - - The collection containing elements to write. - The starting point of the elements to write - The maximum number of elements to write - - - - Write the generic 'Expected' line for a constraint - - The constraint that failed - - - - Write the generic 'Expected' line for a given value - - The expected value - - - - Write the generic 'Expected' line for a given value - and tolerance. - - The expected value - The tolerance within which the test was made - - - - Write the generic 'Actual' line for a constraint - - The constraint for which the actual value is to be written - - - - Write the generic 'Actual' line for a given value - - The actual value causing a failure - - - - Gets or sets the maximum line length for this writer - - - - - Helper class with properties and methods that supply - constraints that operate on exceptions. - - - - - Creates a constraint specifying the exact type of exception expected - - - - - Creates a constraint specifying the exact type of exception expected - - - - - Creates a constraint specifying the type of exception expected - - - - - Creates a constraint specifying the type of exception expected - - - - - Creates a constraint specifying an expected exception - - - - - Creates a constraint specifying an exception with a given InnerException - - - - - Creates a constraint specifying an expected TargetInvocationException - - - - - Creates a constraint specifying an expected TargetInvocationException - - - - - Creates a constraint specifying an expected TargetInvocationException - - - - - Creates a constraint specifying that no exception is thrown - - - - - Attribute used to apply a category to a test - - - - - The name of the category - - - - - Construct attribute for a given category based on - a name. The name may not contain the characters ',', - '+', '-' or '!'. However, this is not checked in the - constructor since it would cause an error to arise at - as the test was loaded without giving a clear indication - of where the problem is located. The error is handled - in NUnitFramework.cs by marking the test as not - runnable. - - The name of the category - - - - Protected constructor uses the Type name as the name - of the category. - - - - - The name of the category - - - - - Used to mark a field for use as a datapoint when executing a theory - within the same fixture that requires an argument of the field's Type. - - - - - Used to mark an array as containing a set of datapoints to be used - executing a theory within the same fixture that requires an argument - of the Type of the array elements. - - - - - Attribute used to provide descriptive text about a - test case or fixture. - - - - - Construct the attribute - - Text describing the test - - - - Gets the test description - - - - - Enumeration indicating how the expected message parameter is to be used - - - - Expect an exact match - - - Expect a message containing the parameter string - - - Match the regular expression provided as a parameter - - - Expect a message that starts with the parameter string - - - - ExpectedExceptionAttribute - - - - - - Constructor for a non-specific exception - - - - - Constructor for a given type of exception - - The type of the expected exception - - - - Constructor for a given exception name - - The full name of the expected exception - - - - Gets or sets the expected exception type - - - - - Gets or sets the full Type name of the expected exception - - - - - Gets or sets the expected message text - - - - - Gets or sets the user message displayed in case of failure - - - - - Gets or sets the type of match to be performed on the expected message - - - - - Gets the name of a method to be used as an exception handler - - - - - ExplicitAttribute marks a test or test fixture so that it will - only be run if explicitly executed from the gui or command line - or if it is included by use of a filter. The test will not be - run simply because an enclosing suite is run. - - - - - Default constructor - - - - - Constructor with a reason - - The reason test is marked explicit - - - - The reason test is marked explicit - - - - - Attribute used to mark a test that is to be ignored. - Ignored tests result in a warning message when the - tests are run. - - - - - Constructs the attribute without giving a reason - for ignoring the test. - - - - - Constructs the attribute giving a reason for ignoring the test - - The reason for ignoring the test - - - - The reason for ignoring a test - - - - - Abstract base for Attributes that are used to include tests - in the test run based on environmental settings. - - - - - Constructor with no included items specified, for use - with named property syntax. - - - - - Constructor taking one or more included items - - Comma-delimited list of included items - - - - Name of the item that is needed in order for - a test to run. Multiple itemss may be given, - separated by a comma. - - - - - Name of the item to be excluded. Multiple items - may be given, separated by a comma. - - - - - The reason for including or excluding the test - - - - - PlatformAttribute is used to mark a test fixture or an - individual method as applying to a particular platform only. - - - - - Constructor with no platforms specified, for use - with named property syntax. - - - - - Constructor taking one or more platforms - - Comma-deliminted list of platforms - - - - CultureAttribute is used to mark a test fixture or an - individual method as applying to a particular Culture only. - - - - - Constructor with no cultures specified, for use - with named property syntax. - - - - - Constructor taking one or more cultures - - Comma-deliminted list of cultures - - - - Marks a test to use a combinatorial join of any argument data - provided. NUnit will create a test case for every combination of - the arguments provided. This can result in a large number of test - cases and so should be used judiciously. This is the default join - type, so the attribute need not be used except as documentation. - - - - - PropertyAttribute is used to attach information to a test as a name/value pair.. - - - - - Construct a PropertyAttribute with a name and string value - - The name of the property - The property value - - - - Construct a PropertyAttribute with a name and int value - - The name of the property - The property value - - - - Construct a PropertyAttribute with a name and double value - - The name of the property - The property value - - - - Constructor for derived classes that set the - property dictionary directly. - - - - - Constructor for use by derived classes that use the - name of the type as the property name. Derived classes - must ensure that the Type of the property value is - a standard type supported by the BCL. Any custom - types will cause a serialization Exception when - in the client. - - - - - Gets the property dictionary for this attribute - - - - - Default constructor - - - - - Marks a test to use pairwise join of any argument data provided. - NUnit will attempt too excercise every pair of argument values at - least once, using as small a number of test cases as it can. With - only two arguments, this is the same as a combinatorial join. - - - - - Default constructor - - - - - Marks a test to use a sequential join of any argument data - provided. NUnit will use arguements for each parameter in - sequence, generating test cases up to the largest number - of argument values provided and using null for any arguments - for which it runs out of values. Normally, this should be - used with the same number of arguments for each parameter. - - - - - Default constructor - - - - - Summary description for MaxTimeAttribute. - - - - - Construct a MaxTimeAttribute, given a time in milliseconds. - - The maximum elapsed time in milliseconds - - - - RandomAttribute is used to supply a set of random values - to a single parameter of a parameterized test. - - - - - ValuesAttribute is used to provide literal arguments for - an individual parameter of a test. - - - - - Abstract base class for attributes that apply to parameters - and supply data for the parameter. - - - - - Gets the data to be provided to the specified parameter - - - - - The collection of data to be returned. Must - be set by any derived attribute classes. - We use an object[] so that the individual - elements may have their type changed in GetData - if necessary. - - - - - Construct with one argument - - - - - - Construct with two arguments - - - - - - - Construct with three arguments - - - - - - - - Construct with an array of arguments - - - - - - Get the collection of values to be used as arguments - - - - - Construct a set of doubles from 0.0 to 1.0, - specifying only the count. - - - - - - Construct a set of doubles from min to max - - - - - - - - Construct a set of ints from min to max - - - - - - - - Get the collection of values to be used as arguments - - - - - RangeAttribute is used to supply a range of values to an - individual parameter of a parameterized test. - - - - - Construct a range of ints using default step of 1 - - - - - - - Construct a range of ints specifying the step size - - - - - - - - Construct a range of longs - - - - - - - - Construct a range of doubles - - - - - - - - Construct a range of floats - - - - - - - - RepeatAttribute may be applied to test case in order - to run it multiple times. - - - - - Construct a RepeatAttribute - - The number of times to run the test - - - - RequiredAddinAttribute may be used to indicate the names of any addins - that must be present in order to run some or all of the tests in an - assembly. If the addin is not loaded, the entire assembly is marked - as NotRunnable. - - - - - Initializes a new instance of the class. - - The required addin. - - - - Gets the name of required addin. - - The required addin name. - - - - Summary description for SetCultureAttribute. - - - - - Construct given the name of a culture - - - - - - Summary description for SetUICultureAttribute. - - - - - Construct given the name of a culture - - - - - - SetUpAttribute is used in a TestFixture to identify a method - that is called immediately before each test is run. It is - also used in a SetUpFixture to identify the method that is - called once, before any of the subordinate tests are run. - - - - - Attribute used to mark a class that contains one-time SetUp - and/or TearDown methods that apply to all the tests in a - namespace or an assembly. - - - - - Attribute used to mark a static (shared in VB) property - that returns a list of tests. - - - - - Attribute used in a TestFixture to identify a method that is - called immediately after each test is run. It is also used - in a SetUpFixture to identify the method that is called once, - after all subordinate tests have run. In either case, the method - is guaranteed to be called, even if an exception is thrown. - - - - - Provide actions to execute before and after tests. - - - - - When implemented by an attribute, this interface implemented to provide actions to execute before and after tests. - - - - - Executed before each test is run - - Provides details about the test that is going to be run. - - - - Executed after each test is run - - Provides details about the test that has just been run. - - - - Provides the target for the action attribute - - The target for the action attribute - - - - Method called before each test - - Info about the test to be run - - - - Method called after each test - - Info about the test that was just run - - - - Gets or sets the ActionTargets for this attribute - - - - - Adding this attribute to a method within a - class makes the method callable from the NUnit test runner. There is a property - called Description which is optional which you can provide a more detailed test - description. This class cannot be inherited. - - - - [TestFixture] - public class Fixture - { - [Test] - public void MethodToTest() - {} - - [Test(Description = "more detailed description")] - publc void TestDescriptionMethod() - {} - } - - - - - - Descriptive text for this test - - - - - TestCaseAttribute is used to mark parameterized test cases - and provide them with their arguments. - - - - - Construct a TestCaseAttribute with a list of arguments. - This constructor is not CLS-Compliant - - - - - - Construct a TestCaseAttribute with a single argument - - - - - - Construct a TestCaseAttribute with a two arguments - - - - - - - Construct a TestCaseAttribute with a three arguments - - - - - - - - Gets the list of arguments to a test case - - - - - Gets or sets the expected result. Use - ExpectedResult by preference. - - The result. - - - - Gets or sets the expected result. - - The result. - - - - Gets a flag indicating whether an expected - result has been set. - - - - - Gets a list of categories associated with this test; - - - - - Gets or sets the category associated with this test. - May be a single category or a comma-separated list. - - - - - Gets or sets the expected exception. - - The expected exception. - - - - Gets or sets the name the expected exception. - - The expected name of the exception. - - - - Gets or sets the expected message of the expected exception - - The expected message of the exception. - - - - Gets or sets the type of match to be performed on the expected message - - - - - Gets or sets the description. - - The description. - - - - Gets or sets the name of the test. - - The name of the test. - - - - Gets or sets the ignored status of the test - - - - - Gets or sets the ignored status of the test - - - - - Gets or sets the explicit status of the test - - - - - Gets or sets the reason for not running the test - - - - - Gets or sets the reason for not running the test. - Set has the side effect of marking the test as ignored. - - The ignore reason. - - - - FactoryAttribute indicates the source to be used to - provide test cases for a test method. - - - - - Construct with the name of the data source, which must - be a property, field or method of the test class itself. - - An array of the names of the factories that will provide data - - - - Construct with a Type, which must implement IEnumerable - - The Type that will provide data - - - - Construct with a Type and name. - that don't support params arrays. - - The Type that will provide data - The name of the method, property or field that will provide data - - - - The name of a the method, property or fiend to be used as a source - - - - - A Type to be used as a source - - - - - Gets or sets the category associated with this test. - May be a single category or a comma-separated list. - - - - - [TestFixture] - public class ExampleClass - {} - - - - - Default constructor - - - - - Construct with a object[] representing a set of arguments. - In .NET 2.0, the arguments may later be separated into - type arguments and constructor arguments. - - - - - - Descriptive text for this fixture - - - - - Gets and sets the category for this fixture. - May be a comma-separated list of categories. - - - - - Gets a list of categories for this fixture - - - - - The arguments originally provided to the attribute - - - - - Gets or sets a value indicating whether this should be ignored. - - true if ignore; otherwise, false. - - - - Gets or sets the ignore reason. May set Ignored as a side effect. - - The ignore reason. - - - - Get or set the type arguments. If not set - explicitly, any leading arguments that are - Types are taken as type arguments. - - - - - Attribute used to identify a method that is - called before any tests in a fixture are run. - - - - - Attribute used to identify a method that is called after - all the tests in a fixture have run. The method is - guaranteed to be called, even if an exception is thrown. - - - - - Adding this attribute to a method within a - class makes the method callable from the NUnit test runner. There is a property - called Description which is optional which you can provide a more detailed test - description. This class cannot be inherited. - - - - [TestFixture] - public class Fixture - { - [Test] - public void MethodToTest() - {} - - [Test(Description = "more detailed description")] - publc void TestDescriptionMethod() - {} - } - - - - - - Used on a method, marks the test with a timeout value in milliseconds. - The test will be run in a separate thread and is cancelled if the timeout - is exceeded. Used on a method or assembly, sets the default timeout - for all contained test methods. - - - - - Construct a TimeoutAttribute given a time in milliseconds - - The timeout value in milliseconds - - - - Marks a test that must run in the STA, causing it - to run in a separate thread if necessary. - - On methods, you may also use STAThreadAttribute - to serve the same purpose. - - - - - Construct a RequiresSTAAttribute - - - - - Marks a test that must run in the MTA, causing it - to run in a separate thread if necessary. - - On methods, you may also use MTAThreadAttribute - to serve the same purpose. - - - - - Construct a RequiresMTAAttribute - - - - - Marks a test that must run on a separate thread. - - - - - Construct a RequiresThreadAttribute - - - - - Construct a RequiresThreadAttribute, specifying the apartment - - - - - ValueSourceAttribute indicates the source to be used to - provide data for one parameter of a test method. - - - - - Construct with the name of the factory - for use with languages - that don't support params arrays. - - The name of the data source to be used - - - - Construct with a Type and name - for use with languages - that don't support params arrays. - - The Type that will provide data - The name of the method, property or field that will provide data - - - - The name of a the method, property or fiend to be used as a source - - - - - A Type to be used as a source - - - - - AllItemsConstraint applies another constraint to each - item in a collection, succeeding if they all succeed. - - - - - Abstract base class used for prefixes - - - - - The Constraint class is the base of all built-in constraints - within NUnit. It provides the operator overloads used to combine - constraints. - - - - - The IConstraintExpression interface is implemented by all - complete and resolvable constraints and expressions. - - - - - Return the top-level constraint for this expression - - - - - - Static UnsetObject used to detect derived constraints - failing to set the actual value. - - - - - The actual value being tested against a constraint - - - - - The display name of this Constraint for use by ToString() - - - - - Argument fields used by ToString(); - - - - - The builder holding this constraint - - - - - Construct a constraint with no arguments - - - - - Construct a constraint with one argument - - - - - Construct a constraint with two arguments - - - - - Sets the ConstraintBuilder holding this constraint - - - - - Write the failure message to the MessageWriter provided - as an argument. The default implementation simply passes - the constraint and the actual value to the writer, which - then displays the constraint description and the value. - - Constraints that need to provide additional details, - such as where the error occured can override this. - - The MessageWriter on which to display the message - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Test whether the constraint is satisfied by an - ActualValueDelegate that returns the value to be tested. - The default implementation simply evaluates the delegate - but derived classes may override it to provide for delayed - processing. - - An - True for success, false for failure - - - - Test whether the constraint is satisfied by a given reference. - The default implementation simply dereferences the value but - derived classes may override it to provide for delayed processing. - - A reference to the value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - Default override of ToString returns the constraint DisplayName - followed by any arguments within angle brackets. - - - - - - Returns the string representation of this constraint - - - - - This operator creates a constraint that is satisfied only if both - argument constraints are satisfied. - - - - - This operator creates a constraint that is satisfied if either - of the argument constraints is satisfied. - - - - - This operator creates a constraint that is satisfied if the - argument constraint is not satisfied. - - - - - Returns a DelayedConstraint with the specified delay time. - - The delay in milliseconds. - - - - - Returns a DelayedConstraint with the specified delay time - and polling interval. - - The delay in milliseconds. - The interval at which to test the constraint. - - - - - The display name of this Constraint for use by ToString(). - The default value is the name of the constraint with - trailing "Constraint" removed. Derived classes may set - this to another name in their constructors. - - - - - Returns a ConstraintExpression by appending And - to the current constraint. - - - - - Returns a ConstraintExpression by appending And - to the current constraint. - - - - - Returns a ConstraintExpression by appending Or - to the current constraint. - - - - - Class used to detect any derived constraints - that fail to set the actual value in their - Matches override. - - - - - The base constraint - - - - - Construct given a base constraint - - - - - - Construct an AllItemsConstraint on top of an existing constraint - - - - - - Apply the item constraint to each item in the collection, - failing if any item fails. - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - AndConstraint succeeds only if both members succeed. - - - - - BinaryConstraint is the abstract base of all constraints - that combine two other constraints in some fashion. - - - - - The first constraint being combined - - - - - The second constraint being combined - - - - - Construct a BinaryConstraint from two other constraints - - The first constraint - The second constraint - - - - Create an AndConstraint from two other constraints - - The first constraint - The second constraint - - - - Apply both member constraints to an actual value, succeeding - succeeding only if both of them succeed. - - The actual value - True if the constraints both succeeded - - - - Write a description for this contraint to a MessageWriter - - The MessageWriter to receive the description - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - AssignableFromConstraint is used to test that an object - can be assigned from a given Type. - - - - - TypeConstraint is the abstract base for constraints - that take a Type as their expected value. - - - - - The expected Type used by the constraint - - - - - Construct a TypeConstraint for a given Type - - - - - - Write the actual value for a failing constraint test to a - MessageWriter. TypeConstraints override this method to write - the name of the type. - - The writer on which the actual value is displayed - - - - Construct an AssignableFromConstraint for the type provided - - - - - - Test whether an object can be assigned from the specified type - - The object to be tested - True if the object can be assigned a value of the expected Type, otherwise false. - - - - Write a description of this constraint to a MessageWriter - - The MessageWriter to use - - - - AssignableToConstraint is used to test that an object - can be assigned to a given Type. - - - - - Construct an AssignableToConstraint for the type provided - - - - - - Test whether an object can be assigned to the specified type - - The object to be tested - True if the object can be assigned a value of the expected Type, otherwise false. - - - - Write a description of this constraint to a MessageWriter - - The MessageWriter to use - - - - AttributeConstraint tests that a specified attribute is present - on a Type or other provider and that the value of the attribute - satisfies some other constraint. - - - - - Constructs an AttributeConstraint for a specified attriute - Type and base constraint. - - - - - - - Determines whether the Type or other provider has the - expected attribute and if its value matches the - additional constraint specified. - - - - - Writes a description of the attribute to the specified writer. - - - - - Writes the actual value supplied to the specified writer. - - - - - Returns a string representation of the constraint. - - - - - AttributeExistsConstraint tests for the presence of a - specified attribute on a Type. - - - - - Constructs an AttributeExistsConstraint for a specific attribute Type - - - - - - Tests whether the object provides the expected attribute. - - A Type, MethodInfo, or other ICustomAttributeProvider - True if the expected attribute is present, otherwise false - - - - Writes the description of the constraint to the specified writer - - - - - BasicConstraint is the abstract base for constraints that - perform a simple comparison to a constant value. - - - - - Initializes a new instance of the class. - - The expected. - The description. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - BinarySerializableConstraint tests whether - an object is serializable in binary format. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - Returns the string representation - - - - - CollectionConstraint is the abstract base class for - constraints that operate on collections. - - - - - Construct an empty CollectionConstraint - - - - - Construct a CollectionConstraint - - - - - - Determines whether the specified enumerable is empty. - - The enumerable. - - true if the specified enumerable is empty; otherwise, false. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Protected method to be implemented by derived classes - - - - - - - CollectionContainsConstraint is used to test whether a collection - contains an expected object as a member. - - - - - CollectionItemsEqualConstraint is the abstract base class for all - collection constraints that apply some notion of item equality - as a part of their operation. - - - - - Construct an empty CollectionConstraint - - - - - Construct a CollectionConstraint - - - - - - Flag the constraint to use the supplied EqualityAdapter. - NOTE: For internal use only. - - The EqualityAdapter to use. - Self. - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied Comparison object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Compares two collection members for equality - - - - - Return a new CollectionTally for use in making tests - - The collection to be included in the tally - - - - Flag the constraint to ignore case and return self. - - - - - Construct a CollectionContainsConstraint - - - - - - Test whether the expected item is contained in the collection - - - - - - - Write a descripton of the constraint to a MessageWriter - - - - - - CollectionEquivalentCOnstraint is used to determine whether two - collections are equivalent. - - - - - Construct a CollectionEquivalentConstraint - - - - - - Test whether two collections are equivalent - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - CollectionOrderedConstraint is used to test whether a collection is ordered. - - - - - Construct a CollectionOrderedConstraint - - - - - Modifies the constraint to use an IComparer and returns self. - - - - - Modifies the constraint to use an IComparer<T> and returns self. - - - - - Modifies the constraint to use a Comparison<T> and returns self. - - - - - Modifies the constraint to test ordering by the value of - a specified property and returns self. - - - - - Test whether the collection is ordered - - - - - - - Write a description of the constraint to a MessageWriter - - - - - - Returns the string representation of the constraint. - - - - - - If used performs a reverse comparison - - - - - CollectionSubsetConstraint is used to determine whether - one collection is a subset of another - - - - - Construct a CollectionSubsetConstraint - - The collection that the actual value is expected to be a subset of - - - - Test whether the actual collection is a subset of - the expected collection provided. - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - CollectionTally counts (tallies) the number of - occurences of each object in one or more enumerations. - - - - - Construct a CollectionTally object from a comparer and a collection - - - - - Try to remove an object from the tally - - The object to remove - True if successful, false if the object was not found - - - - Try to remove a set of objects from the tally - - The objects to remove - True if successful, false if any object was not found - - - - The number of objects remaining in the tally - - - - - ComparisonAdapter class centralizes all comparisons of - values in NUnit, adapting to the use of any provided - IComparer, IComparer<T> or Comparison<T> - - - - - Returns a ComparisonAdapter that wraps an IComparer - - - - - Returns a ComparisonAdapter that wraps an IComparer<T> - - - - - Returns a ComparisonAdapter that wraps a Comparison<T> - - - - - Compares two objects - - - - - Gets the default ComparisonAdapter, which wraps an - NUnitComparer object. - - - - - Construct a ComparisonAdapter for an IComparer - - - - - Compares two objects - - - - - - - - Construct a default ComparisonAdapter - - - - - ComparisonAdapter<T> extends ComparisonAdapter and - allows use of an IComparer<T> or Comparison<T> - to actually perform the comparison. - - - - - Construct a ComparisonAdapter for an IComparer<T> - - - - - Compare a Type T to an object - - - - - Construct a ComparisonAdapter for a Comparison<T> - - - - - Compare a Type T to an object - - - - - Abstract base class for constraints that compare values to - determine if one is greater than, equal to or less than - the other. This class supplies the Using modifiers. - - - - - ComparisonAdapter to be used in making the comparison - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Modifies the constraint to use an IComparer and returns self - - - - - Modifies the constraint to use an IComparer<T> and returns self - - - - - Modifies the constraint to use a Comparison<T> and returns self - - - - - Delegate used to delay evaluation of the actual value - to be used in evaluating a constraint - - - - - ConstraintBuilder maintains the stacks that are used in - processing a ConstraintExpression. An OperatorStack - is used to hold operators that are waiting for their - operands to be reognized. a ConstraintStack holds - input constraints as well as the results of each - operator applied. - - - - - Initializes a new instance of the class. - - - - - Appends the specified operator to the expression by first - reducing the operator stack and then pushing the new - operator on the stack. - - The operator to push. - - - - Appends the specified constraint to the expresson by pushing - it on the constraint stack. - - The constraint to push. - - - - Sets the top operator right context. - - The right context. - - - - Reduces the operator stack until the topmost item - precedence is greater than or equal to the target precedence. - - The target precedence. - - - - Resolves this instance, returning a Constraint. If the builder - is not currently in a resolvable state, an exception is thrown. - - The resolved constraint - - - - Gets a value indicating whether this instance is resolvable. - - - true if this instance is resolvable; otherwise, false. - - - - - OperatorStack is a type-safe stack for holding ConstraintOperators - - - - - Initializes a new instance of the class. - - The builder. - - - - Pushes the specified operator onto the stack. - - The op. - - - - Pops the topmost operator from the stack. - - - - - - Gets a value indicating whether this is empty. - - true if empty; otherwise, false. - - - - Gets the topmost operator without modifying the stack. - - The top. - - - - ConstraintStack is a type-safe stack for holding Constraints - - - - - Initializes a new instance of the class. - - The builder. - - - - Pushes the specified constraint. As a side effect, - the constraint's builder field is set to the - ConstraintBuilder owning this stack. - - The constraint. - - - - Pops this topmost constrait from the stack. - As a side effect, the constraint's builder - field is set to null. - - - - - - Gets a value indicating whether this is empty. - - true if empty; otherwise, false. - - - - Gets the topmost constraint without modifying the stack. - - The topmost constraint - - - - ConstraintExpression represents a compound constraint in the - process of being constructed from a series of syntactic elements. - - Individual elements are appended to the expression as they are - reognized. Once an actual Constraint is appended, the expression - returns a resolvable Constraint. - - - - - ConstraintExpressionBase is the abstract base class for the - ConstraintExpression class, which represents a - compound constraint in the process of being constructed - from a series of syntactic elements. - - NOTE: ConstraintExpressionBase is separate because the - ConstraintExpression class was generated in earlier - versions of NUnit. The two classes may be combined - in a future version. - - - - - The ConstraintBuilder holding the elements recognized so far - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the - class passing in a ConstraintBuilder, which may be pre-populated. - - The builder. - - - - Returns a string representation of the expression as it - currently stands. This should only be used for testing, - since it has the side-effect of resolving the expression. - - - - - - Appends an operator to the expression and returns the - resulting expression itself. - - - - - Appends a self-resolving operator to the expression and - returns a new ResolvableConstraintExpression. - - - - - Appends a constraint to the expression and returns that - constraint, which is associated with the current state - of the expression being built. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the - class passing in a ConstraintBuilder, which may be pre-populated. - - The builder. - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding only if a specified number of them succeed. - - - - - Returns a new PropertyConstraintExpression, which will either - test for the existence of the named property on the object - being tested or apply any following constraint to that property. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns a new AttributeConstraint checking for the - presence of a particular attribute on an object. - - - - - Returns the constraint provided as an argument - used to allow custom - custom constraints to easily participate in the syntax. - - - - - Returns the constraint provided as an argument - used to allow custom - custom constraints to easily participate in the syntax. - - - - - Returns a constraint that tests two items for equality - - - - - Returns a constraint that tests that two references are the same object - - - - - Returns a constraint that tests whether the - actual value is greater than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is greater than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the - actual value is less than or equal to the suppled argument - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual - value is of the exact type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is of the type supplied as an argument or a derived type. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is assignable from the type supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a collection containing the same elements as the - collection supplied as an argument. - - - - - Returns a constraint that tests whether the actual value - is a subset of the collection supplied as an argument. - - - - - Returns a new CollectionContainsConstraint checking for the - presence of a particular object in the collection. - - - - - Returns a new CollectionContainsConstraint checking for the - presence of a particular object in the collection. - - - - - Returns a new ContainsConstraint. This constraint - will, in turn, make use of the appropriate second-level - constraint, depending on the type of the actual argument. - This overload is only used if the item sought is a string, - since any other type implies that we are looking for a - collection member. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value contains the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value starts with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value ends with the substring supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the regular expression supplied as an argument. - - - - - Returns a constraint that succeeds if the actual - value matches the regular expression supplied as an argument. - - - - - Returns a constraint that tests whether the path provided - is the same as an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is the same path or under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the path provided - is the same path or under an expected path after canonicalization. - - - - - Returns a constraint that tests whether the actual value falls - within a specified range. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression that negates any - following constraint. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them succeed. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if at least one of them succeeds. - - - - - Returns a ConstraintExpression, which will apply - the following constraint to all members of a collection, - succeeding if all of them fail. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Length property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Count property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the Message property of the object being tested. - - - - - Returns a new ConstraintExpression, which will apply the following - constraint to the InnerException property of the object being tested. - - - - - With is currently a NOP - reserved for future use. - - - - - Returns a constraint that tests for null - - - - - Returns a constraint that tests for True - - - - - Returns a constraint that tests for False - - - - - Returns a constraint that tests for a positive value - - - - - Returns a constraint that tests for a negative value - - - - - Returns a constraint that tests for NaN - - - - - Returns a constraint that tests for empty - - - - - Returns a constraint that tests whether a collection - contains all unique items. - - - - - Returns a constraint that tests whether an object graph is serializable in binary format. - - - - - Returns a constraint that tests whether an object graph is serializable in xml format. - - - - - Returns a constraint that tests whether a collection is ordered - - - - - ContainsConstraint tests a whether a string contains a substring - or a collection contains an object. It postpones the decision of - which test to use until the type of the actual argument is known. - This allows testing whether a string is contained in a collection - or as a substring of another string using the same syntax. - - - - - Initializes a new instance of the class. - - The expected. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied Comparison object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to ignore case and return self. - - - - - Applies a delay to the match so that a match can be evaluated in the future. - - - - - Creates a new DelayedConstraint - - The inner constraint two decorate - The time interval after which the match is performed - If the value of is less than 0 - - - - Creates a new DelayedConstraint - - The inner constraint two decorate - The time interval after which the match is performed - The time interval used for polling - If the value of is less than 0 - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for if the base constraint fails, false if it succeeds - - - - Test whether the constraint is satisfied by a delegate - - The delegate whose value is to be tested - True for if the base constraint fails, false if it succeeds - - - - Test whether the constraint is satisfied by a given reference. - Overridden to wait for the specified delay period before - calling the base constraint with the dereferenced value. - - A reference to the value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a MessageWriter. - - The writer on which the actual value is displayed - - - - Returns the string representation of the constraint. - - - - - EmptyCollectionConstraint tests whether a collection is empty. - - - - - Check that the collection is empty - - - - - - - Write the constraint description to a MessageWriter - - - - - - EmptyConstraint tests a whether a string or collection is empty, - postponing the decision about which test is applied until the - type of the actual argument is known. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - EmptyDirectoryConstraint is used to test that a directory is empty - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - EmptyStringConstraint tests whether a string is empty. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - EndsWithConstraint can test whether a string ends - with an expected substring. - - - - - StringConstraint is the abstract base for constraints - that operate on strings. It supports the IgnoreCase - modifier for string operations. - - - - - The expected value - - - - - Indicates whether tests should be case-insensitive - - - - - Constructs a StringConstraint given an expected value - - The expected value - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Test whether the constraint is satisfied by a given string - - The string to be tested - True for success, false for failure - - - - Modify the constraint to ignore case in matching. - - - - - Initializes a new instance of the class. - - The expected string - - - - Test whether the constraint is matched by the actual value. - This is a template method, which calls the IsMatch method - of the derived class. - - - - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - EqualConstraint is able to compare an actual value with the - expected value provided in its constructor. Two objects are - considered equal if both are null, or if both have the same - value. NUnit has special semantics for some object types. - - - - - If true, strings in error messages will be clipped - - - - - NUnitEqualityComparer used to test equality. - - - - - Initializes a new instance of the class. - - The expected value. - - - - Flag the constraint to use a tolerance when determining equality. - - Tolerance value to be used - Self. - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied Comparison object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Flag the constraint to use the supplied IEqualityComparer object. - - The IComparer object to use. - Self. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write a failure message. Overridden to provide custom - failure messages for EqualConstraint. - - The MessageWriter to write to - - - - Write description of this constraint - - The MessageWriter to write to - - - - Display the failure information for two collections that did not match. - - The MessageWriter on which to display - The expected collection. - The actual collection - The depth of this failure in a set of nested collections - - - - Displays a single line showing the types and sizes of the expected - and actual enumerations, collections or arrays. If both are identical, - the value is only shown once. - - The MessageWriter on which to display - The expected collection or array - The actual collection or array - The indentation level for the message line - - - - Displays a single line showing the point in the expected and actual - arrays at which the comparison failed. If the arrays have different - structures or dimensions, both values are shown. - - The MessageWriter on which to display - The expected array - The actual array - Index of the failure point in the underlying collections - The indentation level for the message line - - - - Display the failure information for two IEnumerables that did not match. - - The MessageWriter on which to display - The expected enumeration. - The actual enumeration - The depth of this failure in a set of nested collections - - - - Flag the constraint to ignore case and return self. - - - - - Flag the constraint to suppress string clipping - and return self. - - - - - Flag the constraint to compare arrays as collections - and return self. - - - - - Switches the .Within() modifier to interpret its tolerance as - a distance in representable values (see remarks). - - Self. - - Ulp stands for "unit in the last place" and describes the minimum - amount a given value can change. For any integers, an ulp is 1 whole - digit. For floating point values, the accuracy of which is better - for smaller numbers and worse for larger numbers, an ulp depends - on the size of the number. Using ulps for comparison of floating - point results instead of fixed tolerances is safer because it will - automatically compensate for the added inaccuracy of larger numbers. - - - - - Switches the .Within() modifier to interpret its tolerance as - a percentage that the actual values is allowed to deviate from - the expected value. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in days. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in hours. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in minutes. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in seconds. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in milliseconds. - - Self - - - - Causes the tolerance to be interpreted as a TimeSpan in clock ticks. - - Self - - - - EqualityAdapter class handles all equality comparisons - that use an IEqualityComparer, IEqualityComparer<T> - or a ComparisonAdapter. - - - - - Compares two objects, returning true if they are equal - - - - - Returns true if the two objects can be compared by this adapter. - The base adapter cannot handle IEnumerables except for strings. - - - - - Returns an EqualityAdapter that wraps an IComparer. - - - - - Returns an EqualityAdapter that wraps an IEqualityComparer. - - - - - Returns an EqualityAdapter that wraps an IEqualityComparer<T>. - - - - - Returns an EqualityAdapter that wraps an IComparer<T>. - - - - - Returns an EqualityAdapter that wraps a Comparison<T>. - - - - - EqualityAdapter that wraps an IComparer. - - - - - Returns true if the two objects can be compared by this adapter. - Generic adapter requires objects of the specified type. - - - - - EqualityAdapter that wraps an IComparer. - - - - - EqualityAdapterList represents a list of EqualityAdapters - in a common class across platforms. - - - - - ExactCountConstraint applies another constraint to each - item in a collection, succeeding only if a specified - number of items succeed. - - - - - Construct an ExactCountConstraint on top of an existing constraint - - - - - - - Apply the item constraint to each item in the collection, - succeeding only if the expected number of items pass. - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - ExactTypeConstraint is used to test that an object - is of the exact type provided in the constructor - - - - - Construct an ExactTypeConstraint for a given Type - - The expected Type. - - - - Test that an object is of the exact type specified - - The actual value. - True if the tested object is of the exact type provided, otherwise false. - - - - Write the description of this constraint to a MessageWriter - - The MessageWriter to use - - - - ExceptionTypeConstraint is a special version of ExactTypeConstraint - used to provided detailed info about the exception thrown in - an error message. - - - - - Constructs an ExceptionTypeConstraint - - - - - Write the actual value for a failing constraint test to a - MessageWriter. Overriden to write additional information - in the case of an Exception. - - The MessageWriter to use - - - - FailurePoint class represents one point of failure - in an equality test. - - - - - The location of the failure - - - - - The expected value - - - - - The actual value - - - - - Indicates whether the expected value is valid - - - - - Indicates whether the actual value is valid - - - - - FailurePointList represents a set of FailurePoints - in a cross-platform way. - - - - - FalseConstraint tests that the actual value is false - - - - - Initializes a new instance of the class. - - - - Helper routines for working with floating point numbers - - - The floating point comparison code is based on this excellent article: - http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm - - - "ULP" means Unit in the Last Place and in the context of this library refers to - the distance between two adjacent floating point numbers. IEEE floating point - numbers can only represent a finite subset of natural numbers, with greater - accuracy for smaller numbers and lower accuracy for very large numbers. - - - If a comparison is allowed "2 ulps" of deviation, that means the values are - allowed to deviate by up to 2 adjacent floating point values, which might be - as low as 0.0000001 for small numbers or as high as 10.0 for large numbers. - - - - - Compares two floating point values for equality - First floating point value to be compared - Second floating point value t be compared - - Maximum number of representable floating point values that are allowed to - be between the left and the right floating point values - - True if both numbers are equal or close to being equal - - - Floating point values can only represent a finite subset of natural numbers. - For example, the values 2.00000000 and 2.00000024 can be stored in a float, - but nothing inbetween them. - - - This comparison will count how many possible floating point values are between - the left and the right number. If the number of possible values between both - numbers is less than or equal to maxUlps, then the numbers are considered as - being equal. - - - Implementation partially follows the code outlined here: - http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ - - - - - Compares two double precision floating point values for equality - First double precision floating point value to be compared - Second double precision floating point value t be compared - - Maximum number of representable double precision floating point values that are - allowed to be between the left and the right double precision floating point values - - True if both numbers are equal or close to being equal - - - Double precision floating point values can only represent a limited series of - natural numbers. For example, the values 2.0000000000000000 and 2.0000000000000004 - can be stored in a double, but nothing inbetween them. - - - This comparison will count how many possible double precision floating point - values are between the left and the right number. If the number of possible - values between both numbers is less than or equal to maxUlps, then the numbers - are considered as being equal. - - - Implementation partially follows the code outlined here: - http://www.anttirt.net/2007/08/19/proper-floating-point-comparisons/ - - - - - - Reinterprets the memory contents of a floating point value as an integer value - - - Floating point value whose memory contents to reinterpret - - - The memory contents of the floating point value interpreted as an integer - - - - - Reinterprets the memory contents of a double precision floating point - value as an integer value - - - Double precision floating point value whose memory contents to reinterpret - - - The memory contents of the double precision floating point value - interpreted as an integer - - - - - Reinterprets the memory contents of an integer as a floating point value - - Integer value whose memory contents to reinterpret - - The memory contents of the integer value interpreted as a floating point value - - - - - Reinterprets the memory contents of an integer value as a double precision - floating point value - - Integer whose memory contents to reinterpret - - The memory contents of the integer interpreted as a double precision - floating point value - - - - Union of a floating point variable and an integer - - - The union's value as a floating point variable - - - The union's value as an integer - - - The union's value as an unsigned integer - - - Union of a double precision floating point variable and a long - - - The union's value as a double precision floating point variable - - - The union's value as a long - - - The union's value as an unsigned long - - - - Tests whether a value is greater than the value supplied to its constructor - - - - - The value against which a comparison is to be made - - - - - Initializes a new instance of the class. - - The expected value. - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Tests whether a value is greater than or equal to the value supplied to its constructor - - - - - The value against which a comparison is to be made - - - - - Initializes a new instance of the class. - - The expected value. - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - InstanceOfTypeConstraint is used to test that an object - is of the same type provided or derived from it. - - - - - Construct an InstanceOfTypeConstraint for the type provided - - The expected Type - - - - Test whether an object is of the specified type or a derived type - - The object to be tested - True if the object is of the provided type or derives from it, otherwise false. - - - - Write a description of this constraint to a MessageWriter - - The MessageWriter to use - - - - Tests whether a value is less than the value supplied to its constructor - - - - - The value against which a comparison is to be made - - - - - Initializes a new instance of the class. - - The expected value. - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Tests whether a value is less than or equal to the value supplied to its constructor - - - - - The value against which a comparison is to be made - - - - - Initializes a new instance of the class. - - The expected value. - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Static methods used in creating messages - - - - - Static string used when strings are clipped - - - - - Returns the representation of a type as used in NUnitLite. - This is the same as Type.ToString() except for arrays, - which are displayed with their declared sizes. - - - - - - - Converts any control characters in a string - to their escaped representation. - - The string to be converted - The converted string - - - - Return the a string representation for a set of indices into an array - - Array of indices for which a string is needed - - - - Get an array of indices representing the point in a enumerable, - collection or array corresponding to a single int index into the - collection. - - The collection to which the indices apply - Index in the collection - Array of indices - - - - Clip a string to a given length, starting at a particular offset, returning the clipped - string with ellipses representing the removed parts - - The string to be clipped - The maximum permitted length of the result string - The point at which to start clipping - The clipped string - - - - Clip the expected and actual strings in a coordinated fashion, - so that they may be displayed together. - - - - - - - - - Shows the position two strings start to differ. Comparison - starts at the start index. - - The expected string - The actual string - The index in the strings at which comparison should start - Boolean indicating whether case should be ignored - -1 if no mismatch found, or the index where mismatch found - - - - NaNConstraint tests that the actual value is a double or float NaN - - - - - Test that the actual value is an NaN - - - - - - - Write the constraint description to a specified writer - - - - - - NoItemConstraint applies another constraint to each - item in a collection, failing if any of them succeeds. - - - - - Construct a NoItemConstraint on top of an existing constraint - - - - - - Apply the item constraint to each item in the collection, - failing if any item fails. - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - NotConstraint negates the effect of some other constraint - - - - - Initializes a new instance of the class. - - The base constraint to be negated. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for if the base constraint fails, false if it succeeds - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a MessageWriter. - - The writer on which the actual value is displayed - - - - NullConstraint tests that the actual value is null - - - - - Initializes a new instance of the class. - - - - - NullEmptyStringConstraint tests whether a string is either null or empty. - - - - - Constructs a new NullOrEmptyStringConstraint - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - The Numerics class contains common operations on numeric values. - - - - - Checks the type of the object, returning true if - the object is a numeric type. - - The object to check - true if the object is a numeric type - - - - Checks the type of the object, returning true if - the object is a floating point numeric type. - - The object to check - true if the object is a floating point numeric type - - - - Checks the type of the object, returning true if - the object is a fixed point numeric type. - - The object to check - true if the object is a fixed point numeric type - - - - Test two numeric values for equality, performing the usual numeric - conversions and using a provided or default tolerance. If the tolerance - provided is Empty, this method may set it to a default tolerance. - - The expected value - The actual value - A reference to the tolerance in effect - True if the values are equal - - - - Compare two numeric values, performing the usual numeric conversions. - - The expected value - The actual value - The relationship of the values to each other - - - - NUnitComparer encapsulates NUnit's default behavior - in comparing two objects. - - - - - Compares two objects - - - - - - - - Returns the default NUnitComparer. - - - - - Generic version of NUnitComparer - - - - - - Compare two objects of the same type - - - - - NUnitEqualityComparer encapsulates NUnit's handling of - equality tests between objects. - - - - - - - - - - Compares two objects for equality within a tolerance - - The first object to compare - The second object to compare - The tolerance to use in the comparison - - - - - If true, all string comparisons will ignore case - - - - - If true, arrays will be treated as collections, allowing - those of different dimensions to be compared - - - - - Comparison objects used in comparisons for some constraints. - - - - - List of points at which a failure occured. - - - - - RecursionDetector used to check for recursion when - evaluating self-referencing enumerables. - - - - - Compares two objects for equality within a tolerance, setting - the tolerance to the actual tolerance used if an empty - tolerance is supplied. - - - - - Helper method to compare two arrays - - - - - Method to compare two DirectoryInfo objects - - first directory to compare - second directory to compare - true if equivalent, false if not - - - - Returns the default NUnitEqualityComparer - - - - - Gets and sets a flag indicating whether case should - be ignored in determining equality. - - - - - Gets and sets a flag indicating that arrays should be - compared as collections, without regard to their shape. - - - - - Gets the list of external comparers to be used to - test for equality. They are applied to members of - collections, in place of NUnit's own logic. - - - - - Gets the list of failure points for the last Match performed. - The list consists of objects to be interpreted by the caller. - This generally means that the caller may only make use of - objects it has placed on the list at a particular depthy. - - - - - RecursionDetector detects when a comparison - between two enumerables has reached a point - where the same objects that were previously - compared are again being compared. This allows - the caller to stop the comparison if desired. - - - - - Check whether two objects have previously - been compared, returning true if they have. - The two objects are remembered, so that a - second call will always return true. - - - - - OrConstraint succeeds if either member succeeds - - - - - Create an OrConstraint from two other constraints - - The first constraint - The second constraint - - - - Apply the member constraints to an actual value, succeeding - succeeding as soon as one of them succeeds. - - The actual value - True if either constraint succeeded - - - - Write a description for this contraint to a MessageWriter - - The MessageWriter to receive the description - - - - PathConstraint serves as the abstract base of constraints - that operate on paths and provides several helper methods. - - - - - The expected path used in the constraint - - - - - Flag indicating whether a caseInsensitive comparison should be made - - - - - Construct a PathConstraint for a give expected path - - The expected path - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Returns true if the expected path and actual path match - - - - - Returns the string representation of this constraint - - - - - Transform the provided path to its canonical form so that it - may be more easily be compared with other paths. - - The original path - The path in canonical form - - - - Test whether one path in canonical form is under another. - - The first path - supposed to be the parent path - The second path - supposed to be the child path - Indicates whether case should be ignored - - - - - Modifies the current instance to be case-insensitve - and returns it. - - - - - Modifies the current instance to be case-sensitve - and returns it. - - - - - Predicate constraint wraps a Predicate in a constraint, - returning success if the predicate is true. - - - - - Construct a PredicateConstraint from a predicate - - - - - Determines whether the predicate succeeds when applied - to the actual value. - - - - - Writes the description to a MessageWriter - - - - - PropertyConstraint extracts a named property and uses - its value as the actual value for a chained constraint. - - - - - Initializes a new instance of the class. - - The name. - The constraint to apply to the property. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - Returns the string representation of the constraint. - - - - - - PropertyExistsConstraint tests that a named property - exists on the object provided through Match. - - Originally, PropertyConstraint provided this feature - in addition to making optional tests on the vaue - of the property. The two constraints are now separate. - - - - - Initializes a new instance of the class. - - The name of the property. - - - - Test whether the property exists for a given object - - The object to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. - - The writer on which the actual value is displayed - - - - Returns the string representation of the constraint. - - - - - - RangeConstraint tests whether two values are within a - specified range. - - - - - Initializes a new instance of the class. - - From. - To. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - RegexConstraint can test whether a string matches - the pattern provided. - - - - - Initializes a new instance of the class. - - The pattern. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - ResolvableConstraintExpression is used to represent a compound - constraint being constructed at a point where the last operator - may either terminate the expression or may have additional - qualifying constraints added to it. - - It is used, for example, for a Property element or for - an Exception element, either of which may be optionally - followed by constraints that apply to the property or - exception. - - - - - Create a new instance of ResolvableConstraintExpression - - - - - Create a new instance of ResolvableConstraintExpression, - passing in a pre-populated ConstraintBuilder. - - - - - Resolve the current expression to a Constraint - - - - - This operator creates a constraint that is satisfied only if both - argument constraints are satisfied. - - - - - This operator creates a constraint that is satisfied only if both - argument constraints are satisfied. - - - - - This operator creates a constraint that is satisfied only if both - argument constraints are satisfied. - - - - - This operator creates a constraint that is satisfied if either - of the argument constraints is satisfied. - - - - - This operator creates a constraint that is satisfied if either - of the argument constraints is satisfied. - - - - - This operator creates a constraint that is satisfied if either - of the argument constraints is satisfied. - - - - - This operator creates a constraint that is satisfied if the - argument constraint is not satisfied. - - - - - Appends an And Operator to the expression - - - - - Appends an Or operator to the expression. - - - - - ReusableConstraint wraps a constraint expression after - resolving it so that it can be reused consistently. - - - - - Construct a ReusableConstraint from a constraint expression - - The expression to be resolved and reused - - - - Converts a constraint to a ReusableConstraint - - The constraint to be converted - A ReusableConstraint - - - - Returns the string representation of the constraint. - - A string representing the constraint - - - - Resolves the ReusableConstraint by returning the constraint - that it originally wrapped. - - A resolved constraint - - - - SameAsConstraint tests whether an object is identical to - the object passed to its constructor - - - - - Initializes a new instance of the class. - - The expected object. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Summary description for SamePathConstraint. - - - - - Initializes a new instance of the class. - - The expected path - - - - Test whether the constraint is satisfied by a given value - - The expected path - The actual path - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - SamePathOrUnderConstraint tests that one path is under another - - - - - Initializes a new instance of the class. - - The expected path - - - - Test whether the constraint is satisfied by a given value - - The expected path - The actual path - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - SomeItemsConstraint applies another constraint to each - item in a collection, succeeding if any of them succeeds. - - - - - Construct a SomeItemsConstraint on top of an existing constraint - - - - - - Apply the item constraint to each item in the collection, - succeeding if any item succeeds. - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - StartsWithConstraint can test whether a string starts - with an expected substring. - - - - - Initializes a new instance of the class. - - The expected string - - - - Test whether the constraint is matched by the actual value. - This is a template method, which calls the IsMatch method - of the derived class. - - - - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - SubPathConstraint tests that the actual path is under the expected path - - - - - Initializes a new instance of the class. - - The expected path - - - - Test whether the constraint is satisfied by a given value - - The expected path - The actual path - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - SubstringConstraint can test whether a string contains - the expected substring. - - - - - Initializes a new instance of the class. - - The expected. - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - ThrowsConstraint is used to test the exception thrown by - a delegate by applying a constraint to it. - - - - - Initializes a new instance of the class, - using a constraint to be applied to the exception. - - A constraint to apply to the caught exception. - - - - Executes the code of the delegate and captures any exception. - If a non-null base constraint was provided, it applies that - constraint to the exception. - - A delegate representing the code to be tested - True if an exception is thrown and the constraint succeeds, otherwise false - - - - Converts an ActualValueDelegate to a TestDelegate - before calling the primary overload. - - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - Returns the string representation of this constraint - - - - - Get the actual exception thrown - used by Assert.Throws. - - - - - ThrowsNothingConstraint tests that a delegate does not - throw an exception. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True if no exception is thrown, otherwise false - - - - Test whether the constraint is satisfied by a given delegate - - Delegate returning the value to be tested - True if no exception is thrown, otherwise false - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. Overridden in ThrowsNothingConstraint to write - information about the exception that was actually caught. - - The writer on which the actual value is displayed - - - - The Tolerance class generalizes the notion of a tolerance - within which an equality test succeeds. Normally, it is - used with numeric types, but it can be used with any - type that supports taking a difference between two - objects and comparing that difference to a value. - - - - - Constructs a linear tolerance of a specdified amount - - - - - Constructs a tolerance given an amount and ToleranceMode - - - - - Tests that the current Tolerance is linear with a - numeric value, throwing an exception if it is not. - - - - - Returns an empty Tolerance object, equivalent to - specifying no tolerance. In most cases, it results - in an exact match but for floats and doubles a - default tolerance may be used. - - - - - Returns a zero Tolerance object, equivalent to - specifying an exact match. - - - - - Gets the ToleranceMode for the current Tolerance - - - - - Gets the value of the current Tolerance instance. - - - - - Returns a new tolerance, using the current amount as a percentage. - - - - - Returns a new tolerance, using the current amount in Ulps. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of days. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of hours. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of minutes. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of seconds. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of milliseconds. - - - - - Returns a new tolerance with a TimeSpan as the amount, using - the current amount as a number of clock ticks. - - - - - Returns true if the current tolerance is empty. - - - - - Modes in which the tolerance value for a comparison can be interpreted. - - - - - The tolerance was created with a value, without specifying - how the value would be used. This is used to prevent setting - the mode more than once and is generally changed to Linear - upon execution of the test. - - - - - The tolerance is used as a numeric range within which - two compared values are considered to be equal. - - - - - Interprets the tolerance as the percentage by which - the two compared values my deviate from each other. - - - - - Compares two values based in their distance in - representable numbers. - - - - - TrueConstraint tests that the actual value is true - - - - - Initializes a new instance of the class. - - - - - UniqueItemsConstraint tests whether all the items in a - collection are unique. - - - - - Check that all items are unique. - - - - - - - Write a description of this constraint to a MessageWriter - - - - - - XmlSerializableConstraint tests whether - an object is serializable in XML format. - - - - - Test whether the constraint is satisfied by a given value - - The value to be tested - True for success, false for failure - - - - Write the constraint description to a MessageWriter - - The writer on which the description is displayed - - - - Write the actual value for a failing constraint test to a - MessageWriter. The default implementation simply writes - the raw value of actual, leaving it to the writer to - perform any formatting. - - The writer on which the actual value is displayed - - - - Returns the string representation of this constraint - - - - - Represents a constraint that succeeds if all the - members of a collection match a base constraint. - - - - - Abstract base for operators that indicate how to - apply a constraint to items in a collection. - - - - - PrefixOperator takes a single constraint and modifies - it's action in some way. - - - - - The ConstraintOperator class is used internally by a - ConstraintBuilder to represent an operator that - modifies or combines constraints. - - Constraint operators use left and right precedence - values to determine whether the top operator on the - stack should be reduced before pushing a new operator. - - - - - The precedence value used when the operator - is about to be pushed to the stack. - - - - - The precedence value used when the operator - is on the top of the stack. - - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - - The syntax element preceding this operator - - - - - The syntax element folowing this operator - - - - - The precedence value used when the operator - is about to be pushed to the stack. - - - - - The precedence value used when the operator - is on the top of the stack. - - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - - Returns the constraint created by applying this - prefix to another constraint. - - - - - - - Constructs a CollectionOperator - - - - - Returns a constraint that will apply the argument - to the members of a collection, succeeding if - they all succeed. - - - - - Operator that requires both it's arguments to succeed - - - - - Abstract base class for all binary operators - - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - - Abstract method that produces a constraint by applying - the operator to its left and right constraint arguments. - - - - - Gets the left precedence of the operator - - - - - Gets the right precedence of the operator - - - - - Construct an AndOperator - - - - - Apply the operator to produce an AndConstraint - - - - - Operator that tests for the presence of a particular attribute - on a type and optionally applies further tests to the attribute. - - - - - Abstract base class for operators that are able to reduce to a - constraint whether or not another syntactic element follows. - - - - - Construct an AttributeOperator for a particular Type - - The Type of attribute tested - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - Represents a constraint that succeeds if the specified - count of members of a collection match a base constraint. - - - - - Construct an ExactCountOperator for a specified count - - The expected count - - - - Returns a constraint that will apply the argument - to the members of a collection, succeeding if - none of them succeed. - - - - - Represents a constraint that succeeds if none of the - members of a collection match a base constraint. - - - - - Returns a constraint that will apply the argument - to the members of a collection, succeeding if - none of them succeed. - - - - - Negates the test of the constraint it wraps. - - - - - Constructs a new NotOperator - - - - - Returns a NotConstraint applied to its argument. - - - - - Operator that requires at least one of it's arguments to succeed - - - - - Construct an OrOperator - - - - - Apply the operator to produce an OrConstraint - - - - - Operator used to test for the presence of a named Property - on an object and optionally apply further tests to the - value of that property. - - - - - Constructs a PropOperator for a particular named property - - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - - Gets the name of the property to which the operator applies - - - - - Represents a constraint that succeeds if any of the - members of a collection match a base constraint. - - - - - Returns a constraint that will apply the argument - to the members of a collection, succeeding if - any of them succeed. - - - - - Operator that tests that an exception is thrown and - optionally applies further tests to the exception. - - - - - Construct a ThrowsOperator - - - - - Reduce produces a constraint from the operator and - any arguments. It takes the arguments from the constraint - stack and pushes the resulting constraint on it. - - - - - Represents a constraint that simply wraps the - constraint provided as an argument, without any - further functionality, but which modifes the - order of evaluation because of its precedence. - - - - - Constructor for the WithOperator - - - - - Returns a constraint that wraps its argument - - - - - Thrown when an assertion failed. - - - - The error message that explains - the reason for the exception - - - The error message that explains - the reason for the exception - The exception that caused the - current exception - - - - Serialization Constructor - - - - - Thrown when an assertion failed. - - - - - - - The error message that explains - the reason for the exception - The exception that caused the - current exception - - - - Serialization Constructor - - - - - Thrown when a test executes inconclusively. - - - - The error message that explains - the reason for the exception - - - The error message that explains - the reason for the exception - The exception that caused the - current exception - - - - Serialization Constructor - - - - - Thrown when an assertion failed. - - - - - - - The error message that explains - the reason for the exception - The exception that caused the - current exception - - - - Serialization Constructor - - - - - - - - - - - Compares two objects of a given Type for equality within a tolerance - - The first object to compare - The second object to compare - The tolerance to use in the comparison - - - - diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/license.txt b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/license.txt deleted file mode 100644 index def2bb8..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnit.2.6.4/license.txt +++ /dev/null @@ -1,15 +0,0 @@ -Copyright 2002-2014 Charlie Poole -Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov -Copyright 2000-2002 Philip A. Craig - -This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. - -Portions Copyright 2002-2014 Charlie Poole or Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright 2000-2002 Philip A. Craig - -2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source distribution. diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/NUnit.VisualStudio.TestAdapter.dll b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/NUnit.VisualStudio.TestAdapter.dll deleted file mode 100644 index efff3e1..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/NUnit.VisualStudio.TestAdapter.dll and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/nunit.core.dll b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/nunit.core.dll deleted file mode 100644 index b306fae..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/nunit.core.dll and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/nunit.core.interfaces.dll b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/nunit.core.interfaces.dll deleted file mode 100644 index 4053b0d..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/nunit.core.interfaces.dll and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/nunit.util.dll b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/nunit.util.dll deleted file mode 100644 index 122eff4..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.Tests/Resources/NUnitTestAdapter.1.2/lib/nunit.util.dll and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.dll b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.dll deleted file mode 100644 index 1261dc4..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.dll and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.sln b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.sln deleted file mode 100644 index 72ac477..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.sln +++ /dev/null @@ -1,110 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MadMilkman.Ini", "MadMilkman.Ini\MadMilkman.Ini.csproj", "{BEF9735D-C3CC-41E6-AAC6-18C5985D3107}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MadMilkman.Ini.Tests", "MadMilkman.Ini.Tests\MadMilkman.Ini.Tests.csproj", "{BDD080C9-016F-4869-95DE-61171E2AB746}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MadMilkman.Ini.Samples.CS", "MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.CS\MadMilkman.Ini.Samples.CS.csproj", "{67F5741B-F6B2-4A4B-8E83-E0FD108086B1}" -EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MadMilkman.Ini.Samples.VB", "MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.VB\MadMilkman.Ini.Samples.VB.vbproj", "{4FEA3A29-874B-4E1B-A60C-584E703FEA11}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MadMilkman.Ini.Samples.Files", "MadMilkman.Ini.Samples.Files", "{AEF2490D-0F64-453B-9DCA-C1286517E311}" - ProjectSection(SolutionItems) = preProject - MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Compress Example.ini = MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Compress Example.ini - MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Custom Example Input.ini = MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Custom Example Input.ini - MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Custom Example Output.ini = MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Custom Example Output.ini - MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Encrypt Example.ini = MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Encrypt Example.ini - MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Load Example.ini = MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Load Example.ini - MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Save Example.ini = MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.Files\Save Example.ini - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MadMilkman.Ini.Samples.CPP", "MadMilkman.Ini.Samples\MadMilkman.Ini.Samples.CPP\MadMilkman.Ini.Samples.CPP.vcxproj", "{097C11FE-8D4B-48D8-884E-0747454E43DB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MadMilkman.Ini.Samples", "MadMilkman.Ini.Samples", "{861D28E8-3AF2-48AF-B212-9C998BB8B200}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Debug|Win32.ActiveCfg = Debug|Any CPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Debug|x86.ActiveCfg = Debug|Any CPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Release|Any CPU.Build.0 = Release|Any CPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Release|Win32.ActiveCfg = Release|Any CPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107}.Release|x86.ActiveCfg = Release|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Debug|Win32.ActiveCfg = Debug|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Debug|x86.ActiveCfg = Debug|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Release|Any CPU.Build.0 = Release|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Release|Win32.ActiveCfg = Release|Any CPU - {BDD080C9-016F-4869-95DE-61171E2AB746}.Release|x86.ActiveCfg = Release|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Debug|Win32.ActiveCfg = Debug|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Debug|x86.ActiveCfg = Debug|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Release|Any CPU.Build.0 = Release|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Release|Win32.ActiveCfg = Release|Any CPU - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1}.Release|x86.ActiveCfg = Release|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Debug|Win32.ActiveCfg = Debug|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Debug|x86.ActiveCfg = Debug|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Release|Any CPU.Build.0 = Release|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Release|Win32.ActiveCfg = Release|Any CPU - {4FEA3A29-874B-4E1B-A60C-584E703FEA11}.Release|x86.ActiveCfg = Release|Any CPU - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Debug|Win32.ActiveCfg = Debug|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Debug|Win32.Build.0 = Debug|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Debug|x86.ActiveCfg = Debug|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Debug|x86.Build.0 = Debug|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Release|Any CPU.ActiveCfg = Release|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Release|Mixed Platforms.Build.0 = Release|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Release|Win32.ActiveCfg = Release|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Release|Win32.Build.0 = Release|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Release|x86.ActiveCfg = Release|Win32 - {097C11FE-8D4B-48D8-884E-0747454E43DB}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {4FEA3A29-874B-4E1B-A60C-584E703FEA11} = {861D28E8-3AF2-48AF-B212-9C998BB8B200} - {AEF2490D-0F64-453B-9DCA-C1286517E311} = {861D28E8-3AF2-48AF-B212-9C998BB8B200} - {097C11FE-8D4B-48D8-884E-0747454E43DB} = {861D28E8-3AF2-48AF-B212-9C998BB8B200} - {67F5741B-F6B2-4A4B-8E83-E0FD108086B1} = {861D28E8-3AF2-48AF-B212-9C998BB8B200} - EndGlobalSection -EndGlobal diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.xml b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.xml deleted file mode 100644 index 1179801..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.xml +++ /dev/null @@ -1,755 +0,0 @@ - - - - MadMilkman.Ini - - - - - Represents a comment object used by objects, and . - - - - - Gets or sets the amount of empty lines before this comment's text. - - - - - Gets or sets the amount of whitespace characters before this comment's text. - - - - - Gets or sets a text of this instance. - - - - - Defines comment's starting character. - - - - - Use ';' as comment's starting character. - - - - - Use '#' as comment's starting character. - - - - - Defines a behaviour for duplicate occurences. - - - - - Allow duplicate names in . - - - - - Disallow duplicate names in . - - - - - Ignore duplicate names. - - - - - In-memory representation of an INI file. - - - - - Initializes a new instance of class. - - - - - Initializes a new instance of class. - - - object that defines INI file's format, settings for both Load and Save methods. - - - - Loads a file from a stream. - - Stream from which to load a file. - - - - Loads a file from a reader. - - Reader from which to load a file. - - - - Loads a file from a path. - - Path from which to load a file. - - - - Saves a file to a stream. - - Stream to which to save a file. - - - - Saves a file to a writer. - - Writer to which to save a file. - - - - Saves a file to a path. - - Path to which to save a file. - - - - Gets file's sections. - - - - - Gets the object that exposes binding operations, which are executed with methods. - - - - - Gets the mappings of s and their results, used in methods. - - - - - Represents a base class for INI content items, and . - - - - - Gets the object that represents a comment that follows this on the same line. - - - - - Gets or sets the amount of whitespace characters before this item's name. - - - - - Gets and sets the name of the current . - - - - - Gets the to which this belongs to. - - - - - Gets the object that represents a comments that occur before this . - - - - - Represents a base generic class for INI content item collections, and . - - - derived type. - - - - Adds an item to the end of this collection. - - Item to add to this collection. - - - - Removes all items from this collection. - - - - - Determines whether an item is in this collection. - - Name of the item to locate in this collection. - - if the item with specified name is in the collection. - - - - Determines whether an item is in this collection. - - Item to locate in this collection. - - if the specified item is in the collection. - - - - Shallow copies the items of this collection to an array. - - One-dimensional array that is the destination of the items copied from this collection. - Zero-based index in array at which copying begins. - - - - Gets the number of items in this collection. - - - - - Returns an enumerator that iterates through the collection. - - - object that can be used to iterate through the collection. - - - - Searches for the specified item and returns the zero-based index of the first occurrence within this collection. - - Name of the item to locate in this collection. - Index of the first occurrence of the item with specified name in the collection. - - - - Searches for the specified item and returns the zero-based index of the first occurrence within this collection. - - Item to locate in this collection. - Index of the first occurrence of specified item in the collection. - - - - Inserts an item to this collection at the specified index. - - Zero-based index at which item should be inserted. - Item to insert to this collection. - - - - Gets or sets the item at the specified index. - - Zero-based index of the item to get or set. - - - - Gets the first item of the specified name. - - Name of the item to get. - - - - Gets the first items of the specified names. - - Names of the items to get. - - - - Removes the first occurrence of specific item from this collection. - - Name of the item to remove from this collection. - - if the item with specified name is removed from the collection. - - - - Removes the first occurrence of specific item from this collection. - - Item to remove from this collection. - - if the specified item is removed from the collection. - - - - Removes an item at the specified index from this collection. - - Zero-based index at which item should be inserted. - - - - Represents a key item of the INI file with name and value content. - - - - - Initializes a new instance of the class. - - The owner file. - The key's data, pair of key's name and key's value. - - - - Initializes a new instance of the class. - - The owner file. - The key's name. - - - - Initializes a new instance of the class. - - The owner file. - The key's name. - The key's value. - - - - Copies this instance. - - Copied . - - - - Copies this instance and sets copied instance's ParentFile. - - Copied key's parent file. - Copied that belongs to a specified . - - - - Indicates whether the can be converted to specified type. - - Type of the object to convert the to. - - if the specified type is supported. - - - - Gets the to which this belongs to. - - - - - Gets the to which this belongs to. - - - - - Converts the to a list of the specified type. - - Uninitialized list of a specific type which will hold the converted values if the conversion succeeds. - Type of the objects in list to convert the to. - Value that indicates whether the conversion succeeded. - - - - Converts the to an instance of the specified type. - - Uninitialized instance of a specific type which will hold the converted value if the conversion succeeds. - Type of the object to convert the to. - Value that indicates whether the conversion succeeded. - - - - Converts the to an array of the specified type. - - Uninitialized array of a specific type which will hold the converted values if the conversion succeeds. - Type of the objects in array to convert the to. - Value that indicates whether the conversion succeeded. - - - - Gets and sets value. - - - - - Represents a collection of items. - - - - - Adds an item to the end of this collection. - - The key's data, pair of key's name and key's value, to add to this collection. - - that was added to this collection. - - - - Adds an item to the end of this collection. - - Name of the to add to this collection. - - that was added to this collection. - - - - Adds an item to the end of this collection. - - Name of the to add to this collection. - Value of the to add to this collection. - - that was added to this collection. - - - - Inserts an item to this collection at the specified index. - - Zero-based index at which item should be inserted. - The key's data, pair of key's name and key's value, to insert to this collection. - - that was inserted to this collection. - - - - Inserts an item to this collection at the specified index. - - Zero-based index at which item should be inserted. - Name of the to insert to this collection. - - that was inserted to this collection. - - - - Inserts an item to this collection at the specified index. - - Zero-based index at which item should be inserted. - Name of the to insert to this collection. - Value of the to insert to this collection. - - that was inserted to this collection. - - - - Defines key's name and value delimiter character. - - - - - Use '=' as key's name and value delimiter character. - - - - - Use ':' as key's name and value delimiter character. - - - - - Represents a class that defines INI file's format, stores properties used for both reading and writing a file. - - - - - Initializes a new instance of the class. - - - - - Gets or sets comments starting character. - - - - - Gets or sets a value indicating if file's size is reduced. - If file is decompressed on Load and compressed on Save. - - - - - Gets or sets encoding for reading and writing an INI file. - - - - - Gets or sets an INI file's protection password. - File is decrypted on Load and encrypted on Save if a password is not or . - - - - - Gets or sets keys name and value delimiter character. - - - - - Gets or sets a value indicating whether keys with same name are allowed, disallowed or ignored. - - - - - Gets or sets a value indicating whether keys name are case sensitive. - - - - - Gets or sets a value indicating whether space is written around the keys delimiter. - - - - - Gets or sets a value indicating whether sections with same name are allowed, disallowed or ignored. - - - - - Gets or sets a value indicating whether sections name are case sensitive. - - - - - Gets or sets wrapper characters of sections name. - - - - - Represents a section item of the INI file with name and keys content. - - - - - Initializes a new instance of the class. - - The owner file. - The section's name. - - - - Initializes a new instance of the class. - - The owner file. - The section's name. - The section's keys. - - - - Initializes a new instance of the class. - - The owner file. - The section's name. - The section's keys. - - - - Initializes a new instance of the class. - - The owner file. - The section's name. - The section's keys data, pairs of key's name and key's value. - - - - Copies this instance. - - Copied . - - - - Copies this instance and sets copied instance's ParentFile. - - Copied section's parent file. - Copied that belongs to a specified . - - - - Deserializes this into an object of specified type. - - The type of deserialized object. - The object being deserialized. - - - - Represents a section name which is used to define a global section, used for storing first keys series that don't belong to any section. - - - - - Gets the section's key collection. - - - - - Gets the to which this belongs to. - - - - - Serializes the specified object into this . - - The object to serialize. - The type of serialized object. - - - - Represents a collection of items. - - - - - Adds an item to the end of this collection. - - Name of the to add to this collection. - - that was added to this collection. - - - - Adds an item to the end of this collection. - - Name of the to add to this collection. - The section's keys data, pairs of key's name and key's value, to add to this collection. - - that was added to this collection. - - - - Inserts an item to this collection at the specified index. - - Zero-based index at which item should be inserted. - Name of the to insert to this collection. - - that was inserted to this collection. - - - - Inserts an item to this collection at the specified index. - - Zero-based index at which item should be inserted. - Name of the to insert to this collection. - The section's keys data, pairs of key's name and key's value, to insert to this collection. - - that was inserted to this collection. - - - - Defines section's wrapper characters around its name. - - - - - Use '[' and ']' as section's wrapper characters. - - - - - Use '<' and '>' as section's wrapper characters. - - - - - Use '{' and '}' as section's wrapper characters. - - - - - Use '(' and ')' as section's wrapper characters. - - - - - Indicates the behavior of public property when serializing or deserializing the object that contains it. - - - - - Initializes a new instance of the IniSerializationAttribute class and specifies if serialization is ignored. - - The value indicating whether serialization is ignored. - - - - Initializes a new instance of the IniSerializationAttribute class and specifies the 's name. - - The name of the generated . - - - - Gets the name of serialized the property. - - - - - Gets the value indicating whether serialization is ignored. - - - - - Represents a class that is used for binding operations, an operation in which the placeholder keys values are replaced with an internal or external data. - - - - - Executes a binding operation with internal data source. - - - - - Executes a binding operation with external data source. - - The binding data source. - - - - Executes a binding operation with external data source, only on specified section. - - The binding data source. - The 's name. - - - - Occurs when a placeholder is binding with data source value and can be used to customize the binding operation. - - - - - Provides data for event. - - - - - Gets a value indicating whether value was found in the data source. - - - - - Gets the placeholder's . - - - - - Gets the placeholder's name. - - - - - Gets or sets the data source value that will replace the placeholder. - - - - - Represents a class of mapped s and their results, used in methods. - - - - - Adds a new mapping of to resulting object of parse methods. - - The key's value. - The object that represents parsed . - Type of the object that represents parsed . - - - - Determines whether the collection contains a mapping for a specified key's value. - - The key's value to locate in the collection. - - if the collection contains a mapping for a specified key's value. - - - - Removes a mapping for a specified key's value in the collection. - - The key's value to remove in the collection. - - if a mapping for a specified key's value is successfully found and removed. - - - \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.zip b/MadMilkman.Ini-1.0.6/MadMilkman.Ini.zip deleted file mode 100644 index 36e253f..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini.zip and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniCommentStarter.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniCommentStarter.cs deleted file mode 100644 index a220584..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniCommentStarter.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace MadMilkman.Ini -{ - /// - /// Defines comment's starting character. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", - Justification = "I'm defining and using enum values with specific characters and null character, aka '\0', has no purpose here.")] - public enum IniCommentStarter - { - /// - /// Use ';' as comment's starting character. - /// - Semicolon = ';', - /// - /// Use '#' as comment's starting character. - /// - Hash = '#' - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniCommentType.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniCommentType.cs deleted file mode 100644 index 55ad338..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniCommentType.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace MadMilkman.Ini -{ - internal enum IniCommentType - { - Leading = 0, - Trailing - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniDuplication.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniDuplication.cs deleted file mode 100644 index 9058cd3..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniDuplication.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace MadMilkman.Ini -{ - /// - /// Defines a behaviour for duplicate occurences. - /// - public enum IniDuplication - { - /// - /// Allow duplicate names in . - /// - Allowed = 0, - /// - /// Disallow duplicate names in . - /// - /// - /// is thrown on duplicate name occurence. - /// - Disallowed, - /// - /// Ignore duplicate names. - /// - /// - /// Prevents adding or inserting an if its name already exists in . - /// - Ignored - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniKeyDelimiter.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniKeyDelimiter.cs deleted file mode 100644 index 72e8803..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniKeyDelimiter.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace MadMilkman.Ini -{ - /// - /// Defines key's name and value delimiter character. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", - Justification = "I'm defining and using enum values with specific characters and null character, aka '\0', has no purpose here.")] - public enum IniKeyDelimiter - { - /// - /// Use '=' as key's name and value delimiter character. - /// - Equal = '=', - /// - /// Use ':' as key's name and value delimiter character. - /// - Colon = ':' - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniSectionWrapper.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniSectionWrapper.cs deleted file mode 100644 index 8d0a86d..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniEnums/IniSectionWrapper.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace MadMilkman.Ini -{ - /// - /// Defines section's wrapper characters around its name. - /// - public enum IniSectionWrapper - { - /// - /// Use '[' and ']' as section's wrapper characters. - /// - SquareBrackets = 0, - /// - /// Use '<' and '>' as section's wrapper characters. - /// - AngleBrackets, - /// - /// Use '{' and '}' as section's wrapper characters. - /// - CurlyBrackets, - /// - /// Use '(' and ')' as section's wrapper characters. - /// - Parentheses - } -} - diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniFile.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniFile.cs deleted file mode 100644 index c8ba91b..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniFile.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using System.IO; -using System.Diagnostics; - -namespace MadMilkman.Ini -{ - /// - /// In-memory representation of an INI file. - /// - /// - /// is a central class of MadMilkman.Ini component. - /// To define an INI file's format use object. - /// To load (read) an INI file from a file's path or a stream use IniFile.Load methods. - /// To save (write) an INI file to a file's path or a stream use IniFile.Save methods. - /// To view INI file's structure representation see IniFile's Content Hierarchy Diagram. - /// - /// Overview - /// INI file format on Wikipedia. - public sealed class IniFile - { - internal readonly IniOptions options; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly IniSectionCollection sections; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private IniValueMappings valueMappings; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private IniValueBinding valueBinding; - - /// - /// Initializes a new instance of class. - /// - public IniFile() : this(new IniOptions()) { } - - /// - /// Initializes a new instance of class. - /// - /// object that defines INI file's format, settings for both Load and Save methods. - public IniFile(IniOptions options) - { - if (options == null) - throw new ArgumentNullException("options"); - - this.options = new IniOptions(options); - this.sections = new IniSectionCollection(this, options.SectionDuplicate, options.SectionNameCaseSensitive); - } - - /// - /// Gets file's sections. - /// - public IniSectionCollection Sections { get { return this.sections; } } - - /// - /// Gets the mappings of s and their results, used in methods. - /// - public IniValueMappings ValueMappings - { - get - { - if (this.valueMappings == null) - this.valueMappings = new IniValueMappings(); - return this.valueMappings; - } - } - - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - internal bool HasValueMappings { get { return this.valueMappings != null; } } - - /// - /// Gets the object that exposes binding operations, which are executed with methods. - /// - public IniValueBinding ValueBinding - { - get - { - if (this.valueBinding == null) - this.valueBinding = new IniValueBinding(this); - return this.valueBinding; - } - } - - /// - /// Loads a file from a path. - /// - /// Path from which to load a file. - public void Load(string filePath) - { - if (filePath == null) - throw new ArgumentNullException("filePath"); - - using (Stream fileStream = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) - this.Load(fileStream); - } - - /// - /// Loads a file from a stream. - /// - /// Stream from which to load a file. - public void Load(Stream fileStream) - { - if (fileStream == null) - throw new ArgumentNullException("fileStream"); - - this.Load(new StreamReader(fileStream, this.options.Encoding)); - - if (fileStream.CanSeek) - fileStream.Seek(0, SeekOrigin.Begin); - } - - /// - /// Loads a file from a reader. - /// - /// Reader from which to load a file. - public void Load(TextReader fileReader) - { - if (fileReader == null) - throw new ArgumentNullException("fileReader"); - - new IniReader(this.options).Read(this, fileReader); - } - - /// - /// Saves a file to a path. - /// - /// Path to which to save a file. - public void Save(string filePath) - { - if (filePath == null) - throw new ArgumentNullException("filePath"); - - using (Stream fileStream = File.Create(filePath)) - this.Save(fileStream); - } - - /// - /// Saves a file to a stream. - /// - /// Stream to which to save a file. - public void Save(Stream fileStream) - { - if (fileStream == null) - throw new ArgumentNullException("fileStream"); - - this.Save(new StreamWriter(fileStream, this.options.Encoding)); - - if (fileStream.CanSeek) - fileStream.Seek(0, SeekOrigin.Begin); - } - - /// - /// Saves a file to a writer. - /// - /// Writer to which to save a file. - public void Save(TextWriter fileWriter) - { - if (fileWriter == null) - throw new ArgumentNullException("fileWriter"); - - new IniWriter(this.options).Write(this, fileWriter); - } - } -} \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/DebugCollectionViewer.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/DebugCollectionViewer.cs deleted file mode 100644 index 216c17e..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/DebugCollectionViewer.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Diagnostics; -using System.Collections.Generic; - -namespace MadMilkman.Ini -{ - internal sealed class DebugCollectionViewer - { - private readonly IEnumerable sequence; - - public DebugCollectionViewer(IEnumerable sequence) - { - if (sequence == null) - throw new System.ArgumentNullException("sequence"); - this.sequence = sequence; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public T[] Items - { - get - { - var collection = this.sequence as ICollection ?? new List(this.sequence); - var array = new T[collection.Count]; - collection.CopyTo(array, 0); - return array; - } - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/GlobalSuppressions.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/GlobalSuppressions.cs deleted file mode 100644 index bdd9ba5..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/GlobalSuppressions.cs and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/IItemNameVerifier.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/IItemNameVerifier.cs deleted file mode 100644 index deb4a61..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/IItemNameVerifier.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace MadMilkman.Ini -{ - internal interface IItemNameVerifier { bool VerifyItemName(string name); } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/SharedDocumentationComments.xml b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/SharedDocumentationComments.xml deleted file mode 100644 index 61e4e4a..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniInternal/SharedDocumentationComments.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not added. - - - - - If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not inserted. - - - - - For supported types see the remarks of method. - Mapped value results in have priority over parsing the value. - - IniKey's Value Parsing - - \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniComment.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniComment.cs deleted file mode 100644 index 1b61f41..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniComment.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Diagnostics; - -namespace MadMilkman.Ini -{ - /// - /// Represents a comment object used by objects, and . - /// - [DebuggerDisplay("Text = {Text}")] - public sealed class IniComment - { - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private string text; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly IniCommentType type; - - /// - /// Gets or sets the amount of empty lines before this comment's text. - /// - public int EmptyLinesBefore { get; set; } - - /// - /// Gets or sets the amount of whitespace characters before this comment's text. - /// - public int LeftIndentation { get; set; } - - /// - /// Gets or sets a text of this instance. - /// - /// - /// For LeadingComment text should not contain new line characters. - /// If it does, they will be replaced with a space characters. - /// - public string Text - { - get { return this.text; } - set - { - if (value != null && this.type == IniCommentType.Leading) - this.text = value.Replace("\r\n", " ") - .Replace("\n", " ") - .Replace("\r", " "); - else - this.text = value; - } - } - - internal IniComment(IniCommentType type) { this.type = type; } - - // Deep copy constructor. - internal IniComment(IniComment source) - { - this.text = source.text; - this.type = source.type; - this.EmptyLinesBefore = source.EmptyLinesBefore; - this.LeftIndentation = source.LeftIndentation; - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniItem.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniItem.cs deleted file mode 100644 index 99b7930..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniItem.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Diagnostics; - -namespace MadMilkman.Ini -{ - /// - /// Represents a base class for INI content items, and . - /// - /// - /// All INI items share the same content like , and . - /// These properties are defined on an class, a base class for INI content items. - /// - [DebuggerDisplay("Name = {Name}")] - public abstract class IniItem - { - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private string name; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly IniFile parentFile; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private IniComment leadingComment; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private IniComment trailingComment; - - /// - /// Gets and sets the name of the current . - /// - /// - /// When setting the value is verified by the item's rule. - /// - public string Name - { - get { return this.name; } - set - { - if (this.ParentCollectionCore == null || ((IItemNameVerifier)this.ParentCollectionCore).VerifyItemName(value)) - this.name = value; - } - } - - /// - /// Gets or sets the amount of whitespace characters before this item's name. - /// - public int LeftIndentation { get; set; } - - /// - /// Gets the object that represents a comment that follows this on the same line. - /// - public IniComment LeadingComment - { - get - { - if (this.leadingComment == null) - this.leadingComment = new IniComment(IniCommentType.Leading); - return this.leadingComment; - } - } - - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - internal bool HasLeadingComment { get { return this.leadingComment != null; } } - - /// - /// Gets the object that represents a comments that occur before this . - /// - public IniComment TrailingComment - { - get - { - if (this.trailingComment == null) - this.trailingComment = new IniComment(IniCommentType.Trailing); - return this.trailingComment; - } - } - - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - internal bool HasTrailingComment { get { return this.trailingComment != null; } } - - /// - /// Gets the to which this belongs to. - /// - public IniFile ParentFile { get { return this.parentFile; } } - - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - internal object ParentCollectionCore { get; set; } - - internal IniItem(IniFile parentFile, string name, IniComment trailingComment = null) - { - if (name == null) - throw new ArgumentNullException("name"); - if (parentFile == null) - throw new ArgumentNullException("parentFile"); - - this.name = name; - this.parentFile = parentFile; - this.trailingComment = trailingComment; - } - - // Deep copy constructor. - internal IniItem(IniFile parentFile, IniItem sourceItem) - { - if (parentFile == null) - throw new ArgumentNullException("parentFile"); - - this.name = sourceItem.name; - this.parentFile = parentFile; - if (sourceItem.HasLeadingComment) - this.leadingComment = new IniComment(sourceItem.leadingComment); - if (sourceItem.HasTrailingComment) - this.trailingComment = new IniComment(sourceItem.trailingComment); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniKey.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniKey.cs deleted file mode 100644 index 13fa87b..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniKey.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System; -using System.Diagnostics; -using System.Collections.Generic; - -namespace MadMilkman.Ini -{ - /// - /// Represents a key item of the INI file with name and value content. - /// - public sealed class IniKey : IniItem - { - /// - /// Gets and sets value. - /// - /// IniKey's Value Parsing - /// IniKey's Value Binding - public string Value { get; set; } - - /// - /// Gets the to which this belongs to. - /// - public IniKeyCollection ParentCollection { get { return (IniKeyCollection)this.ParentCollectionCore; } } - - /// - /// Gets the to which this belongs to. - /// - public IniSection ParentSection { get { return (IniSection)((this.ParentCollectionCore != null) ? this.ParentCollection.Owner : null); } } - - internal bool IsValueArray - { - get - { - return !string.IsNullOrEmpty(this.Value) && - this.Value[0] == '{' && - this.Value[this.Value.Length - 1] == '}'; - } - } - - internal string[] Values - { - get - { - var values = this.Value.Substring(1, this.Value.Length - 2).Split(','); - for (int i = 0; i < values.Length; i++) - values[i] = values[i].Trim(); - return values; - } - set - { - this.Value = "{" + string.Join(",", value) + "}"; - } - } - - /// - /// Initializes a new instance of the class. - /// - /// The owner file. - /// The key's name. - public IniKey(IniFile parentFile, string name) : this(parentFile, name, (string)null) { } - - /// - /// Initializes a new instance of the class. - /// - /// The owner file. - /// The key's name. - /// The key's value. - public IniKey(IniFile parentFile, string name, string value) : base(parentFile, name) { this.Value = value; } - - /// - /// Initializes a new instance of the class. - /// - /// The owner file. - /// The key's data, pair of key's name and key's value. - public IniKey(IniFile parentFile, KeyValuePair nameValuePair) : base(parentFile, nameValuePair.Key) { this.Value = nameValuePair.Value; } - - // Constructor used by IniReader. - internal IniKey(IniFile parentFile, string name, IniComment trailingComment) - : base(parentFile, name, trailingComment) { } - - // Deep copy constructor. - internal IniKey(IniFile destinationFile, IniKey sourceKey) - : base(destinationFile, sourceKey) { this.Value = sourceKey.Value; } - - /// - /// Copies this instance. - /// - /// Copied . - /// IniItem's Copying - public IniKey Copy() { return this.Copy(this.ParentFile); } - - /// - /// Copies this instance and sets copied instance's ParentFile. - /// - /// Copied key's parent file. - /// Copied that belongs to a specified . - /// IniItem's Copying - public IniKey Copy(IniFile destinationFile) { return new IniKey(destinationFile, this); } - - /// - /// Indicates whether the can be converted to specified type. - /// - /// Type of the object to convert the to. - /// if the specified type is supported. - /// - /// Currently supported types are: - /// - /// System.Boolean - /// System.Byte - /// System.SByte - /// System.Int16 - /// System.UInt16 - /// System.Int32 - /// System.UInt32 - /// System.Int64 - /// System.UInt64 - /// System.Char - /// System.Single - /// System.Double - /// System.Decimal - /// System.DateTime - /// System.TimeSpan - /// System.Enum - /// System.String - /// - /// Additionally both Array and List of the above types are supported. - /// - public static bool IsSupportedValueType(Type type) - { - if (type == null) - throw new ArgumentNullException("type"); - - return type.IsPrimitive || - type.IsEnum || - type == typeof(String) || - type == typeof(Decimal) || - type == typeof(DateTime) || - type == typeof(TimeSpan) || - (type.IsArray && IsSupportedValueType(type.GetElementType())) || - (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(List<>) && IsSupportedValueType(type.GetGenericArguments()[0])); - } - - /// - /// Converts the to an instance of the specified type. - /// - /// Uninitialized instance of a specific type which will hold the converted value if the conversion succeeds. - /// Type of the object to convert the to. - /// Value that indicates whether the conversion succeeded. - /// - public bool TryParseValue(out T result) - { - if (this.ParentFile.HasValueMappings && this.ParentFile.ValueMappings.TryGetResult(this.Value, out result)) - return true; - else - return IniValueParser.TryParse(this.Value, out result); - } - - /// - /// Converts the to an array of the specified type. - /// - /// Uninitialized array of a specific type which will hold the converted values if the conversion succeeds. - /// Type of the objects in array to convert the to. - /// Value that indicates whether the conversion succeeded. - /// - public bool TryParseValue(out T[] results) - { - List listResults; - if (this.TryParseValue(out listResults)) - { - results = listResults.ToArray(); - return true; - } - - results = null; - return false; - } - - /// - /// Converts the to a list of the specified type. - /// - /// Uninitialized list of a specific type which will hold the converted values if the conversion succeeds. - /// Type of the objects in list to convert the to. - /// Value that indicates whether the conversion succeeded. - /// - public bool TryParseValue(out List results) - { - if (this.IsValueArray) - { - var listResults = new List(); - foreach (var value in this.Values) - { - T result; - if (this.ParentFile.HasValueMappings && this.ParentFile.ValueMappings.TryGetResult(value, out result)) - listResults.Add(result); - else if (IniValueParser.TryParse(value, out result)) - listResults.Add(result); - else - { - results = null; - return false; - } - } - - results = listResults; - return true; - } - - results = null; - return false; - } - } -} \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniSection.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniSection.cs deleted file mode 100644 index 6a75879..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItems/IniSection.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System.Diagnostics; -using System.Collections.Generic; - -namespace MadMilkman.Ini -{ - /// - /// Represents a section item of the INI file with name and keys content. - /// - public sealed class IniSection : IniItem - { - /// - /// Represents a section name which is used to define a global section, used for storing first keys series that don't belong to any section. - /// - /// - /// - /// If a section with this name is located as a first file's section then its name and comments are ignored. - /// If a section with this name isn't located as first file's section then it will be written with MADMILKMAN_INI_FILE_GLOBAL_SECTION name. - /// - /// - public const string GlobalSectionName = "MADMILKMAN_INI_FILE_GLOBAL_SECTION"; - - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly IniKeyCollection keys; - - /// - /// Gets the section's key collection. - /// - public IniKeyCollection Keys { get { return this.keys; } } - - /// - /// Gets the to which this belongs to. - /// - public IniSectionCollection ParentCollection { get { return (IniSectionCollection)this.ParentCollectionCore; } } - - /// - /// Initializes a new instance of the class. - /// - /// The owner file. - /// The section's name. - public IniSection(IniFile parentFile, string name) : this(parentFile, name, (IEnumerable)null) { } - - /// - /// Initializes a new instance of the class. - /// - /// The owner file. - /// The section's name. - /// The section's keys. - public IniSection(IniFile parentFile, string name, params IniKey[] keys) : this(parentFile, name, (IEnumerable)keys) { } - - /// - /// Initializes a new instance of the class. - /// - /// The owner file. - /// The section's name. - /// The section's keys data, pairs of key's name and key's value. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", - Justification = "I don't want to use IDictionary, there is no need for such a contract because IEnumerable> is enough.")] - public IniSection(IniFile parentFile, string name, IEnumerable> nameValuePairs) - : this(parentFile, name, GetIniKeysFromKeyValuePairs(parentFile, nameValuePairs)) { } - - /// - /// Initializes a new instance of the class. - /// - /// The owner file. - /// The section's name. - /// The section's keys. - public IniSection(IniFile parentFile, string name, IEnumerable keys) - : base(parentFile, name) - { - this.keys = new IniKeyCollection(parentFile, this, parentFile.options.KeyDuplicate, parentFile.options.KeyNameCaseSensitive); - - if (keys != null) - foreach (IniKey key in keys) - this.keys.Add(key); - } - - // Constructor used by IniReader. - internal IniSection(IniFile parentFile, string name, IniComment trailingComment) - : base(parentFile, name, trailingComment) - { - this.keys = new IniKeyCollection(parentFile, this, parentFile.options.KeyDuplicate, parentFile.options.KeyNameCaseSensitive); - } - - // Deep copy constructor. - internal IniSection(IniFile destinationFile, IniSection sourceSection) - : base(destinationFile, sourceSection) - { - this.keys = new IniKeyCollection(destinationFile, this, destinationFile.options.KeyDuplicate, destinationFile.options.KeyNameCaseSensitive); - - foreach (var key in sourceSection.keys) - this.keys.Add(key.Copy(destinationFile)); - } - - /// - /// Copies this instance. - /// - /// Copied . - /// IniItem's Copying - public IniSection Copy() { return this.Copy(this.ParentFile); } - - /// - /// Copies this instance and sets copied instance's ParentFile. - /// - /// Copied section's parent file. - /// Copied that belongs to a specified . - /// IniItem's Copying - public IniSection Copy(IniFile destinationFile) { return new IniSection(destinationFile, this); } - - /// - /// Serializes the specified object into this . - /// - /// The type of serialized object. - /// The object to serialize. - /// IniSection's Object Serialization - public void Serialize(T source) where T : class, new() { IniSerializer.Serialize(source, this); } - - /// - /// Deserializes this into an object of specified type. - /// - /// The type of deserialized object. - /// The object being deserialized. - /// IniSection's Object Serialization - public T Deserialize() where T : class, new() { return IniSerializer.Deserialize(this); } - - private static IEnumerable GetIniKeysFromKeyValuePairs(IniFile parentFile, IEnumerable> nameValuePairs) - { - if (nameValuePairs != null) - foreach (var pair in nameValuePairs) - yield return new IniKey(parentFile, pair); - } - } -} \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItemsCollection/IniItemCollection.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItemsCollection/IniItemCollection.cs deleted file mode 100644 index 5cbe2bc..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItemsCollection/IniItemCollection.cs +++ /dev/null @@ -1,291 +0,0 @@ -using System; -using System.Diagnostics; -using System.Collections; -using System.Collections.Generic; - -namespace MadMilkman.Ini -{ - /// - /// Represents a base generic class for INI content item collections, and . - /// - /// derived type. - /// - [DebuggerDisplay("Count = {Count}"), DebuggerTypeProxy(typeof(DebugCollectionViewer<>))] - public abstract class IniItemCollection : IItemNameVerifier, IList where T : IniItem - { - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly bool caseSensitive; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly IniDuplication duplication; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly IList items; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly IniFile parentFile; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly IniItem owner; - - /// - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - protected IniFile ParentFile { get { return this.parentFile; } } - - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - internal IniItem Owner { get { return this.owner; } } - - /// - /// - /// Gets the number of items in this collection. - /// - public int Count { get { return this.items.Count; } } - - internal IniItemCollection(IniFile parentFile, IniItem owner, IniDuplication duplication, bool caseSensitive) - { - this.caseSensitive = caseSensitive; - this.duplication = duplication; - this.parentFile = parentFile; - this.owner = owner; - this.items = new List(); - } - - /// - /// Adds an item to the end of this collection. - /// - /// Item to add to this collection. - /// - public void Add(T item) - { - if (this.VerifyItem(item)) - this.items.Add(item); - } - - /// - /// Removes all items from this collection. - /// - public void Clear() - { - foreach (var item in this.items) - item.ParentCollectionCore = null; - this.items.Clear(); - } - - /// - /// Determines whether an item is in this collection. - /// - /// Item to locate in this collection. - /// if the specified item is in the collection. - public bool Contains(T item) { return this.items.Contains(item); } - - /// - /// Determines whether an item is in this collection. - /// - /// Name of the item to locate in this collection. - /// if the item with specified name is in the collection. - public bool Contains(string name) { return this.GetItemIndexByName(name) != -1; } - - /// - /// Shallow copies the items of this collection to an array. - /// - /// One-dimensional array that is the destination of the items copied from this collection. - /// Zero-based index in array at which copying begins. - public void CopyTo(T[] array, int arrayIndex) { this.items.CopyTo(array, arrayIndex); } - - /// - /// Searches for the specified item and returns the zero-based index of the first occurrence within this collection. - /// - /// Item to locate in this collection. - /// Index of the first occurrence of specified item in the collection. - public int IndexOf(T item) { return this.items.IndexOf(item); } - - /// - /// Searches for the specified item and returns the zero-based index of the first occurrence within this collection. - /// - /// Name of the item to locate in this collection. - /// Index of the first occurrence of the item with specified name in the collection. - public int IndexOf(string name) { return this.GetItemIndexByName(name); } - - /// - /// Inserts an item to this collection at the specified index. - /// - /// Zero-based index at which item should be inserted. - /// Item to insert to this collection. - /// - public void Insert(int index, T item) - { - if (this.VerifyItem(item)) - this.items.Insert(index, item); - } - - /// - /// Removes the first occurrence of specific item from this collection. - /// - /// Item to remove from this collection. - /// if the specified item is removed from the collection. - public bool Remove(T item) - { - if (!this.items.Remove(item)) - return false; - - item.ParentCollectionCore = null; - return true; - } - - /// - /// Removes the first occurrence of specific item from this collection. - /// - /// Name of the item to remove from this collection. - /// if the item with specified name is removed from the collection. - public bool Remove(string name) - { - int index = this.GetItemIndexByName(name); - - if (index == -1) - return false; - - this.items.RemoveAt(index); - return true; - } - - /// - /// Removes an item at the specified index from this collection. - /// - /// Zero-based index at which item should be inserted. - public void RemoveAt(int index) - { - this.items[index].ParentCollectionCore = null; - this.items.RemoveAt(index); - } - - /// - /// Gets or sets the item at the specified index. - /// - /// Zero-based index of the item to get or set. - /// - /// If item duplicates are ignored and value is a duplicate item, has an existing name in this collection, then this value is ignored. - /// - public T this[int index] - { - get { return this.items[index]; } - set - { - if (this.VerifyItem(value)) - { - this.items[index].ParentCollectionCore = null; - this.items[index] = value; - } - } - } - - /// - /// Gets the first item of the specified name. - /// - /// Name of the item to get. - /// If item with the specified name doesn't exist a value is returned. - public T this[string name] - { - get - { - int index = this.GetItemIndexByName(name); - return (index != -1) ? this.items[index] : null; - } - } - - /// - /// Gets the first items of the specified names. - /// - /// Names of the items to get. - /// If item with any specified name doesn't exist a value is returned in its place. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers", - Justification = "I believe that this non-standard indexer can provide some useful data store access.")] - public IEnumerable this[params string[] names] - { - get - { - var returnedNames = new Dictionary(); - int index; - - for (int i = 0; i < names.Length; i++) - { - string name = names[i]; - - if (returnedNames.TryGetValue(name, out index)) - { - if (index != -1) - { - index = GetItemIndexByName(name, index + 1); - returnedNames[name] = index; - } - } - else - { - index = GetItemIndexByName(name); - returnedNames.Add(name, index); - } - - yield return (index != -1) ? this.items[index] : null; - } - } - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// object that can be used to iterate through the collection. - public IEnumerator GetEnumerator() { return this.items.GetEnumerator(); } - - private int GetItemIndexByName(string name, int startIndex = 0) - { - var iniItems = (IEnumerable)this.items; - int index = 0; - - foreach (var item in iniItems) - { - if (index >= startIndex && - item.Name.Equals(name, (this.caseSensitive) ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase)) - return index; - else - index++; - } - - return -1; - } - - private bool VerifyItem(IniItem item) - { - if (item == null) - throw new ArgumentNullException("item"); - - if (item.ParentFile != this.parentFile) - throw new InvalidOperationException(); - - if (item.ParentCollectionCore != null) - throw new InvalidOperationException(); - - if (!this.VerifyItemName(item.Name)) - return false; - - item.ParentCollectionCore = this; - return true; - } - - private bool VerifyItemName(string name) { return ((IItemNameVerifier)this).VerifyItemName(name); } - - bool IItemNameVerifier.VerifyItemName(string name) - { - if (this.duplication != IniDuplication.Allowed && this.Contains(name)) - { - if (this.duplication == IniDuplication.Disallowed) - throw new InvalidOperationException(); - - return false; - } - - return true; - } - - /// - IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); } - - /// - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - bool ICollection.IsReadOnly { get { return false; } } - } -} \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItemsCollection/IniKeyCollection.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItemsCollection/IniKeyCollection.cs deleted file mode 100644 index 7c0b05d..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItemsCollection/IniKeyCollection.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.Collections.Generic; - -namespace MadMilkman.Ini -{ - /// - /// Represents a collection of items. - /// - /// - public sealed class IniKeyCollection : IniItemCollection - { - internal IniKeyCollection(IniFile parentFile, IniSection parentSection, IniDuplication duplication, bool caseSensitive) - : base(parentFile, parentSection, duplication, caseSensitive) { } - - /// - /// Adds an item to the end of this collection. - /// - /// Name of the to add to this collection. - /// that was added to this collection. - /// - public IniKey Add(string name) { return this.Add(name, null); } - - /// - /// Adds an item to the end of this collection. - /// - /// The key's data, pair of key's name and key's value, to add to this collection. - /// that was added to this collection. - /// - public IniKey Add(KeyValuePair nameValuePair) { return this.Add(nameValuePair.Key, nameValuePair.Value); } - - /// - /// Adds an item to the end of this collection. - /// - /// Name of the to add to this collection. - /// Value of the to add to this collection. - /// that was added to this collection. - /// - public IniKey Add(string name, string value) - { - var key = new IniKey(this.ParentFile, name, value); - this.Add(key); - return key; - } - - /// - /// Inserts an item to this collection at the specified index. - /// - /// Zero-based index at which item should be inserted. - /// Name of the to insert to this collection. - /// that was inserted to this collection. - /// - public IniKey Insert(int index, string name) { return this.Insert(index, name, null); } - - /// - /// Inserts an item to this collection at the specified index. - /// - /// Zero-based index at which item should be inserted. - /// The key's data, pair of key's name and key's value, to insert to this collection. - /// that was inserted to this collection. - /// - public IniKey Insert(int index, KeyValuePair nameValuePair){ return this.Insert(index, nameValuePair.Key, nameValuePair.Value); } - - /// - /// Inserts an item to this collection at the specified index. - /// - /// Zero-based index at which item should be inserted. - /// Name of the to insert to this collection. - /// Value of the to insert to this collection. - /// that was inserted to this collection. - /// - public IniKey Insert(int index, string name, string value) - { - var key = new IniKey(this.ParentFile, name, value); - this.Insert(index, key); - return key; - } - } -} \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItemsCollection/IniSectionCollection.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItemsCollection/IniSectionCollection.cs deleted file mode 100644 index 97386b5..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniItemsCollection/IniSectionCollection.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Collections.Generic; - -namespace MadMilkman.Ini -{ - /// - /// Represents a collection of items. - /// - /// - public sealed class IniSectionCollection : IniItemCollection - { - internal IniSectionCollection(IniFile parentFile, IniDuplication duplication, bool caseSensitive) - : base(parentFile, null, duplication, caseSensitive) { } - - /// - /// Adds an item to the end of this collection. - /// - /// Name of the to add to this collection. - /// that was added to this collection. - /// - public IniSection Add(string name) { return this.Add(name, null); } - - /// - /// Adds an item to the end of this collection. - /// - /// Name of the to add to this collection. - /// The section's keys data, pairs of key's name and key's value, to add to this collection. - /// that was added to this collection. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", - Justification = "I don't want to use IDictionary, there is no need for such a contract because IEnumerable> is enough.")] - public IniSection Add(string name, IEnumerable> nameValuePairs) - { - var section = new IniSection(this.ParentFile, name, nameValuePairs); - this.Add(section); - return section; - } - - /// - /// Inserts an item to this collection at the specified index. - /// - /// Zero-based index at which item should be inserted. - /// Name of the to insert to this collection. - /// that was inserted to this collection. - /// - public IniSection Insert(int index, string name) { return this.Insert(index, name, null); } - - /// - /// Inserts an item to this collection at the specified index. - /// - /// Zero-based index at which item should be inserted. - /// Name of the to insert to this collection. - /// The section's keys data, pairs of key's name and key's value, to insert to this collection. - /// that was inserted to this collection. - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", - Justification = "I don't want to use IDictionary, there is no need for such a contract because IEnumerable> is enough.")] - public IniSection Insert(int index, string name, IEnumerable> nameValuePairs) - { - var section = new IniSection(this.ParentFile, name, nameValuePairs); - this.Insert(index, section); - return section; - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniOptions.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniOptions.cs deleted file mode 100644 index 08d7a00..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniOptions.cs +++ /dev/null @@ -1,213 +0,0 @@ -using System.Text; -using System.Diagnostics; - -namespace MadMilkman.Ini -{ - /// - /// Represents a class that defines INI file's format, stores properties used for both reading and writing a file. - /// - /// - /// After an instance of this class is passed to an constructor, further changes on that instance's properties will have no effect. - /// - /// - /// Property - /// Default Value - /// - /// - /// CommentStarter - /// - /// - /// - /// Compression - /// - /// - /// - /// EncryptionPassword - /// - /// - /// - /// Encoding - /// Encoding.ASCII - /// - /// - /// KeyDelimiter - /// - /// - /// - /// KeyDuplicate - /// - /// - /// - /// KeyNameCaseSensitive - /// - /// - /// - /// KeySpaceAroundDelimiter - /// - /// - /// - /// SectionDuplicate - /// - /// - /// - /// SectionNameCaseSensitive - /// - /// - /// - /// SectionWrapper - /// - /// - /// - /// - public sealed class IniOptions - { - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private Encoding encoding; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private IniSectionWrapper sectionWrapper; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - internal char sectionWrapperStart; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - internal char sectionWrapperEnd; - - /// - /// Gets or sets encoding for reading and writing an INI file. - /// - /// - /// Value should not be , if it is then a default Encoding.ASCII value will be used. - /// - public Encoding Encoding - { - get { return this.encoding; } - set - { - if (value == null) - this.encoding = Encoding.ASCII; - this.encoding = value; - } - } - - /// - /// Gets or sets comments starting character. - /// - public IniCommentStarter CommentStarter { get; set; } - - /// - /// Gets or sets a value indicating if file's size is reduced. - /// If file is decompressed on Load and compressed on Save. - /// - public bool Compression { get; set; } - - /// - /// Gets or sets an INI file's protection password. - /// File is decrypted on Load and encrypted on Save if a password is not or . - /// - public string EncryptionPassword { get; set; } - - /// - /// Gets or sets keys name and value delimiter character. - /// - public IniKeyDelimiter KeyDelimiter { get; set; } - - /// - /// Gets or sets a value indicating whether keys with same name are allowed, disallowed or ignored. - /// - public IniDuplication KeyDuplicate { get; set; } - - /// - /// Gets or sets a value indicating whether keys name are case sensitive. - /// - public bool KeyNameCaseSensitive { get; set; } - - /// - /// Gets or sets a value indicating whether space is written around the keys delimiter. - /// - public bool KeySpaceAroundDelimiter { get; set; } - - /// - /// Gets or sets a value indicating whether sections with same name are allowed, disallowed or ignored. - /// - public IniDuplication SectionDuplicate { get; set; } - - /// - /// Gets or sets a value indicating whether sections name are case sensitive. - /// - public bool SectionNameCaseSensitive { get; set; } - - /// - /// Gets or sets wrapper characters of sections name. - /// - public IniSectionWrapper SectionWrapper - { - get { return this.sectionWrapper; } - set - { - this.sectionWrapper = value; - this.SectionWrapperToCharacters(out this.sectionWrapperStart, out this.sectionWrapperEnd); - } - } - - /// - /// Initializes a new instance of the class. - /// - public IniOptions() - { - this.encoding = Encoding.ASCII; - this.CommentStarter = IniCommentStarter.Semicolon; - this.Compression = false; - this.EncryptionPassword = null; - this.KeyDelimiter = IniKeyDelimiter.Equal; - this.KeyDuplicate = IniDuplication.Allowed; - this.KeyNameCaseSensitive = false; - this.KeySpaceAroundDelimiter = false; - this.SectionDuplicate = IniDuplication.Allowed; - this.SectionNameCaseSensitive = false; - this.SectionWrapper = IniSectionWrapper.SquareBrackets; - } - - // Deep copy constructor. - internal IniOptions(IniOptions options) - { - this.encoding = options.encoding; - this.CommentStarter = options.CommentStarter; - this.Compression = options.Compression; - this.EncryptionPassword = options.EncryptionPassword; - this.KeyDelimiter = options.KeyDelimiter; - this.KeyDuplicate = options.KeyDuplicate; - this.KeyNameCaseSensitive = options.KeyNameCaseSensitive; - this.KeySpaceAroundDelimiter = options.KeySpaceAroundDelimiter; - this.SectionDuplicate = options.SectionDuplicate; - this.SectionNameCaseSensitive = options.SectionNameCaseSensitive; - this.SectionWrapper = options.SectionWrapper; - } - - /* REMARKS: ToChar(bool) extension method on IniSectionWrapper would be nice, but in order to define - * an extension method in .NET 2.0 we need to declare ExtensionAttribute our self. - * - * Changing SectionWrapperToCharacters method's return type to Tuple would be nice, - * but writing our own Tuple implementation for .NET 2.0 is an unnecessary overhead. */ - - private void SectionWrapperToCharacters(out char startCharacter, out char endCharacte) - { - switch (this.sectionWrapper) - { - case IniSectionWrapper.AngleBrackets: - startCharacter = '<'; - endCharacte = '>'; - break; - case IniSectionWrapper.CurlyBrackets: - startCharacter = '{'; - endCharacte = '}'; - break; - case IniSectionWrapper.Parentheses: - startCharacter = '('; - endCharacte = ')'; - break; - default: - startCharacter = '['; - endCharacte = ']'; - break; - } - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniCompressor.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniCompressor.cs deleted file mode 100644 index 4e706f0..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniCompressor.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Text; -using System.IO; -using System.IO.Compression; - -namespace MadMilkman.Ini -{ - internal static class IniCompressor - { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", - Justification = "MemoryStream doesn't have unmanaged resources.")] - public static string Compress(string text, Encoding encoding) - { - byte[] content = encoding.GetBytes(text); - var stream = new MemoryStream(); - - using (var compressor = new GZipStream(stream, CompressionMode.Compress, true)) - compressor.Write(content, 0, content.Length); - - byte[] compressedContent = new byte[stream.Length + 4]; - stream.Position = 0; - stream.Read(compressedContent, 4, compressedContent.Length - 4); - - Buffer.BlockCopy(BitConverter.GetBytes(content.Length), 0, compressedContent, 0, 4); - return Convert.ToBase64String(compressedContent); - } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", - Justification = "MemoryStream doesn't have unmanaged resources.")] - public static string Decompress(string text, Encoding encoding) - { - byte[] compressedContent = Convert.FromBase64String(text); - var stream = new MemoryStream(compressedContent, 4, compressedContent.Length - 4); - byte[] content = new byte[BitConverter.ToInt32(compressedContent, 0)]; - - stream.Position = 0; - using (var decompressor = new GZipStream(stream, CompressionMode.Decompress, false)) - decompressor.Read(content, 0, content.Length); - - return encoding.GetString(content); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniEncryptor.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniEncryptor.cs deleted file mode 100644 index c74fdf7..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniEncryptor.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Text; -using System.IO; -using System.Security.Cryptography; - -namespace MadMilkman.Ini -{ - internal static class IniEncryptor - { - /* REMARKS: RijndaelManaged - * - KeySize - BlockSize - * DEFAULT = 256 DEFAULT = 128 - * MIN = 128 MIN = 128 - * MAX = 256 MAX = 256 - * - * - InitializationVector.Length - * MUST = RijndaelManaged.BlockSize / 8 - * - * - key.Length - * MUST = RijndaelManaged.KeySize / 8 */ - - private static readonly byte[] InitializationVector = { 77, 52, 225, 184, 143, 77, 49, 225, 184, 187, 107, 77, 52, 225, 185, 137 }; - private static readonly byte[] Salt = { 49, 110, 49, 102, 49, 108, 51, 39, 53, 95, 53, 52, 108, 55, 95, 118, 52, 108, 117, 51 }; - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", - Justification = "MemoryStream doesn't have unmanaged resources.")] - public static string Encrypt(string text, string passwordPhrase, Encoding encoding) - { - byte[] content = encoding.GetBytes(text); - byte[] key = new Rfc2898DeriveBytes(passwordPhrase, IniEncryptor.Salt, 1000).GetBytes(32); - var stream = new MemoryStream(); - - using (var rijndaelAlgorithm = new RijndaelManaged()) - using (var encryptor = rijndaelAlgorithm.CreateEncryptor(key, IniEncryptor.InitializationVector)) - using (var cryptoStream = new CryptoStream(stream, encryptor, CryptoStreamMode.Write)) - cryptoStream.Write(content, 0, content.Length); - - return Convert.ToBase64String(stream.ToArray()); - } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", - Justification = "MemoryStream doesn't have unmanaged resources.")] - public static string Decrypt(string text, string passwordPhrase, Encoding encoding) - { - byte[] encryptedContent = Convert.FromBase64String(text); - byte[] key = new Rfc2898DeriveBytes(passwordPhrase, IniEncryptor.Salt, 1000).GetBytes(32); - byte[] content = new byte[encryptedContent.Length]; - int contentCount; - - using (var rijndaelAlgorithm = new RijndaelManaged()) - using (var decryptor = rijndaelAlgorithm.CreateDecryptor(key, IniEncryptor.InitializationVector)) - using (var cryptoStream = new CryptoStream(new MemoryStream(encryptedContent), decryptor, CryptoStreamMode.Read)) - contentCount = cryptoStream.Read(content, 0, content.Length); - - return encoding.GetString(content, 0, contentCount); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniReader.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniReader.cs deleted file mode 100644 index 30db329..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniReader.cs +++ /dev/null @@ -1,197 +0,0 @@ -using System; -using System.IO; - -namespace MadMilkman.Ini -{ - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable", - Justification = "StringReader doesn't have unmanaged resources.")] - internal sealed class IniReader - { - private readonly IniOptions options; - private TextReader reader; - - private int currentEmptyLinesBefore; - private IniComment currentTrailingComment; - private IniSection currentSection; - - public IniReader(IniOptions options) - { - this.options = options; - this.currentEmptyLinesBefore = 0; - this.currentTrailingComment = null; - this.currentSection = null; - } - - public void Read(IniFile iniFile, TextReader textReader) - { - this.reader = new StringReader(this.DecompressAndDecryptText(textReader.ReadToEnd())); - - string line; - while ((line = this.reader.ReadLine()) != null) - { - if (line.Trim().Length == 0) - this.currentEmptyLinesBefore++; - else - this.ReadLine(line, iniFile); - } - } - - private string DecompressAndDecryptText(string fileContent) - { - if (this.options.Compression) - fileContent = IniCompressor.Decompress(fileContent, this.options.Encoding); - - if (!string.IsNullOrEmpty(this.options.EncryptionPassword)) - fileContent = IniEncryptor.Decrypt(fileContent, this.options.EncryptionPassword, this.options.Encoding); - - return fileContent; - } - - private void ReadLine(string line, IniFile file) - { - /* REMARKS: All 'whitespace' and 'tab' characters increase the LeftIndention by 1. - * - * CONSIDER: Implement different processing of 'tab' characters. They are often represented as 4 spaces, - * or they can stretch to a next 'tab stop' position which occurs each 8 characters: - * 0 8 16 - * |.......|.......|... */ - - // Index of first non 'whitespace' character. - int startIndex = Array.FindIndex(line.ToCharArray(), c => !(char.IsWhiteSpace(c) || c == '\t')); - char startCharacter = line[startIndex]; - - if (startCharacter == (char)this.options.CommentStarter) - this.ReadTrailingComment(startIndex, line.Substring(++startIndex)); - - else if (startCharacter == this.options.sectionWrapperStart) - this.ReadSection(startIndex, line, file); - - else - this.ReadKey(startIndex, line, file); - - this.currentEmptyLinesBefore = 0; - } - - private void ReadTrailingComment(int leftIndention, string text) - { - if (this.currentTrailingComment == null) - this.currentTrailingComment = new IniComment(IniCommentType.Trailing) - { - EmptyLinesBefore = this.currentEmptyLinesBefore, - LeftIndentation = leftIndention, - Text = text - }; - else - this.currentTrailingComment.Text += Environment.NewLine + text; - } - - /* MZ(2015-08-29): Added support for section names that may contain end wrapper or comment starter characters. */ - private void ReadSection(int leftIndention, string line, IniFile file) - { - int sectionEndIndex = -1, potentialCommentIndex, tempIndex = leftIndention; - while (tempIndex != -1 && ++tempIndex <= line.Length) - { - potentialCommentIndex = line.IndexOf((char)this.options.CommentStarter, tempIndex); - - if (potentialCommentIndex != -1) - sectionEndIndex = line.LastIndexOf(this.options.sectionWrapperEnd, potentialCommentIndex - 1, potentialCommentIndex - tempIndex); - else - sectionEndIndex = line.LastIndexOf(this.options.sectionWrapperEnd, line.Length - 1, line.Length - tempIndex); - - if (sectionEndIndex != -1) - break; - else - tempIndex = potentialCommentIndex; - } - - if (sectionEndIndex != -1) - { - this.currentSection = new IniSection(file, - line.Substring(leftIndention + 1, sectionEndIndex - leftIndention - 1), - this.currentTrailingComment) - { - LeftIndentation = leftIndention, - LeadingComment = { EmptyLinesBefore = this.currentEmptyLinesBefore } - }; - file.Sections.Add(this.currentSection); - - if (++sectionEndIndex < line.Length) - this.ReadSectionLeadingComment(line.Substring(sectionEndIndex)); - } - - this.currentTrailingComment = null; - } - - private void ReadSectionLeadingComment(string lineLeftover) - { - // Index of first non 'whitespace' character. - int leftIndention = Array.FindIndex(lineLeftover.ToCharArray(), c => !(char.IsWhiteSpace(c) || c == '\t')); - if (leftIndention != -1 && lineLeftover[leftIndention] == (char)this.options.CommentStarter) - { - var leadingComment = this.currentSection.LeadingComment; - leadingComment.Text = lineLeftover.Substring(leftIndention + 1); - leadingComment.LeftIndentation = leftIndention; - } - } - - private void ReadKey(int leftIndention, string line, IniFile file) - { - int keyDelimiterIndex = line.IndexOf((char)this.options.KeyDelimiter, leftIndention); - if (keyDelimiterIndex != -1) - { - if (this.currentSection == null) - this.currentSection = file.Sections.Add(IniSection.GlobalSectionName); - - var currentKey = new IniKey(file, - line.Substring(leftIndention, keyDelimiterIndex - leftIndention).TrimEnd(), - this.currentTrailingComment) - { - LeftIndentation = leftIndention, - LeadingComment = { EmptyLinesBefore = this.currentEmptyLinesBefore } - }; - - this.currentSection.Keys.Add(currentKey); - - this.ReadValue(line.Substring(++keyDelimiterIndex).TrimStart(), currentKey); - } - - this.currentTrailingComment = null; - } - - private void ReadValue(string lineLeftover, IniKey key) - { - int valueEndIndex = lineLeftover.IndexOf((char)this.options.CommentStarter); - - if (valueEndIndex == -1) - key.Value = lineLeftover.TrimEnd(); - else if (valueEndIndex == 0) - key.Value = key.LeadingComment.Text = string.Empty; - else - this.ReadValueLeadingComment(lineLeftover, valueEndIndex, key); - } - - /* MZ(2016-02-23): Added support for quoted values which can contain comment's starting characters. */ - private void ReadValueLeadingComment(string lineLeftover, int potentialCommentIndex, IniKey key) - { - int quoteEndIndex = lineLeftover.IndexOf('"', 1); - if (lineLeftover[0] == '"' && quoteEndIndex != -1) - while (quoteEndIndex > potentialCommentIndex && potentialCommentIndex != -1) - potentialCommentIndex = lineLeftover.IndexOf((char)this.options.CommentStarter, ++potentialCommentIndex); - - if (potentialCommentIndex == -1) - key.Value = lineLeftover.TrimEnd(); - else - { - key.LeadingComment.Text = lineLeftover.Substring(potentialCommentIndex + 1); - - // The amount of 'whitespace' characters between key's value and comment's starting character. - int leftIndention = 0; - while (lineLeftover[--potentialCommentIndex] == ' ' || lineLeftover[potentialCommentIndex] == '\t') - leftIndention++; - - key.LeadingComment.LeftIndentation = leftIndention; - key.Value = lineLeftover.Substring(0, ++potentialCommentIndex); - } - } - } -} \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniWriter.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniWriter.cs deleted file mode 100644 index ebb4b94..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniReaderWriter/IniWriter.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.IO; - -namespace MadMilkman.Ini -{ - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable", - Justification = "StringWriter doesn't have unmanaged resources.")] - internal sealed class IniWriter - { - private static readonly string[] NewLines = { "\r\n", "\n", "\r" }; - private readonly IniOptions options; - private TextWriter writer; - - public IniWriter(IniOptions options) { this.options = options; } - - public void Write(IniFile iniFile, TextWriter textWriter) - { - this.writer = new StringWriter(System.Globalization.CultureInfo.InvariantCulture); - this.WriteSections(iniFile.Sections); - - textWriter.Write(this.EncryptAndCompressText(this.writer.ToString())); - textWriter.Flush(); - } - - private string EncryptAndCompressText(string fileContent) - { - if (!string.IsNullOrEmpty(this.options.EncryptionPassword)) - fileContent = IniEncryptor.Encrypt(fileContent, this.options.EncryptionPassword, this.options.Encoding); - - if (this.options.Compression) - fileContent = IniCompressor.Compress(fileContent, this.options.Encoding); - - return fileContent; - } - - private void WriteSections(IniSectionCollection sections) - { - if (sections.Count == 0) - return; - - this.WriteFirstSection(sections[0]); - - for (int i = 1; i < sections.Count; i++) - this.WriteSection(sections[i]); - } - - private void WriteFirstSection(IniSection section) - { - if (section.Name.Equals(IniSection.GlobalSectionName)) - this.WriteKeys(section.Keys); - else - this.WriteSection(section); - } - - private void WriteSection(IniSection section) - { - this.WriteItem(section, - // E.g. " [SectionName]" - new String(' ', section.LeftIndentation) + - this.options.sectionWrapperStart + - section.Name + - this.options.sectionWrapperEnd); - - this.WriteKeys(section.Keys); - } - - private void WriteKeys(IniKeyCollection keys) - { - foreach (IniKey key in keys) - this.WriteItem(key, - // E.g. " KeyName = KeyValue" - new String(' ', key.LeftIndentation) + - key.Name + - ((this.options.KeySpaceAroundDelimiter) ? " " : string.Empty) + - (char)this.options.KeyDelimiter + - ((this.options.KeySpaceAroundDelimiter) ? " " : string.Empty) + - key.Value); - } - - private void WriteItem(IniItem item, string itemContent) - { - if (item.HasTrailingComment) - this.WriteTrailingComment(item.TrailingComment); - - if (item.HasLeadingComment) - this.WriteEmptyLines(item.LeadingComment.EmptyLinesBefore); - - this.writer.Write(itemContent); - - if (item.HasLeadingComment) - this.WriteLeadingComment(item.LeadingComment); - else - this.writer.WriteLine(); - } - - private void WriteTrailingComment(IniComment trailingComment) - { - this.WriteEmptyLines(trailingComment.EmptyLinesBefore); - - // E.g. " ;CommentText - // ;CommentText" - if (trailingComment.Text != null) - foreach (string commentLine in trailingComment.Text.Split(IniWriter.NewLines, StringSplitOptions.None)) - this.writer.WriteLine( - new String(' ', trailingComment.LeftIndentation) + - (char)this.options.CommentStarter + - commentLine); - } - - private void WriteLeadingComment(IniComment leadingComment) - { - // E.g. " ;CommentText" - if (leadingComment.Text != null) - this.writer.WriteLine( - new String(' ', leadingComment.LeftIndentation) + - (char)this.options.CommentStarter + - leadingComment.Text); - else - this.writer.WriteLine(); - } - - private void WriteEmptyLines(int count) - { - for (int i = 0; i < count; i++) - this.writer.WriteLine(); - } - } -} \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniSerializationAttribute.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniSerializationAttribute.cs deleted file mode 100644 index 6552519..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniSerializationAttribute.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; - -namespace MadMilkman.Ini -{ - /// - /// Indicates the behavior of public property when serializing or deserializing the object that contains it. - /// - [AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)] - public sealed class IniSerializationAttribute : Attribute - { - /// - /// Gets the name of serialized the property. - /// - public string Alias { get; private set; } - - /// - /// Gets the value indicating whether serialization is ignored. - /// - public bool Ignore { get; private set; } - - /// - /// Initializes a new instance of the IniSerializationAttribute class and specifies the 's name. - /// - /// The name of the generated . - public IniSerializationAttribute(string alias) { this.Alias = alias; } - - /// - /// Initializes a new instance of the IniSerializationAttribute class and specifies if serialization is ignored. - /// - /// The value indicating whether serialization is ignored. - public IniSerializationAttribute(bool ignore) { this.Ignore = ignore; } - - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniSerializer.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniSerializer.cs deleted file mode 100644 index 2abf83d..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniSerializer.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Reflection; - -namespace MadMilkman.Ini -{ - internal static class IniSerializer - { - private static readonly Predicate PropertyTypeVerifier = IniKey.IsSupportedValueType; - - public static void Serialize(T source, IniSection section) where T : class, new() - { - foreach (var propertyPair in GetPropertyPairs(typeof(T))) - { - var key = section.Keys.Add(propertyPair.Key); - if (key.ParentCollectionCore != null) - SetKeyValue(propertyPair.Value, source, key); - } - } - - public static T Deserialize(IniSection section) where T : class, new() - { - T destination = new T(); - - foreach (var propertyPair in GetPropertyPairs(typeof(T))) - { - var key = section.Keys[propertyPair.Key]; - if (key != null) - SetPropertyValue(propertyPair.Value, destination, key); - } - - return destination; - } - - private static IEnumerable> GetPropertyPairs(Type type) - { - foreach (var property in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) - { - if (!IniSerializer.PropertyTypeVerifier(property.PropertyType)) - continue; - - string propertyName = null; - var attributes = property.GetCustomAttributes(typeof(IniSerializationAttribute), false); - - if (attributes.Length > 0) - { - var attribute = (IniSerializationAttribute)attributes[0]; - if (attribute.Ignore) - continue; - - propertyName = attribute.Alias; - } - - yield return new KeyValuePair((propertyName) ?? property.Name, property); - } - } - - private static void SetKeyValue(PropertyInfo property, object source, IniKey key) - { - object propertyValue = property.GetValue(source, null); - - if (propertyValue == null) - return; - - if (property.PropertyType.IsArray || property.PropertyType.GetInterface(typeof(IList).Name) != null) - { - var values = new List(); - - /* MZ(2016-01-02): Fixed issue with null items in array and list. */ - foreach (var item in (IEnumerable)propertyValue) - values.Add(item != null ? item.ToString() : null); - - key.Values = values.ToArray(); - } - else - key.Value = propertyValue.ToString(); - } - - private static void SetPropertyValue(PropertyInfo property, object destination, IniKey key) - { - var propertyType = property.PropertyType; - - if (propertyType.IsArray) - { - /* MZ(2016-01-02): Fixed issue with null array and list. */ - if (!key.IsValueArray) - return; - - var values = key.Values; - var itemType = propertyType.GetElementType(); - var array = Array.CreateInstance(itemType, values.Length); - - for (int i = 0; i < values.Length; i++) - array.SetValue( - TypeDescriptor.GetConverter(itemType).ConvertFromInvariantString(values[i]), - i); - - property.SetValue(destination, array, null); - } - - else if (propertyType.GetInterface(typeof(IList).Name) != null) - { - /* MZ(2016-01-02): Fixed issue with null array and list. */ - if (!key.IsValueArray) - return; - - var itemType = propertyType.GetGenericArguments()[0]; - var list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(itemType)); - - var values = key.Values; - if (!(values.Length == 1 && string.IsNullOrEmpty(values[0]))) - foreach (var value in values) - list.Add( - TypeDescriptor.GetConverter(itemType).ConvertFromInvariantString(value)); - - property.SetValue(destination, list, null); - } - - else - property.SetValue( - destination, - TypeDescriptor.GetConverter(propertyType).ConvertFromInvariantString(key.Value), - null); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueBinding.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueBinding.cs deleted file mode 100644 index a79cbb7..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueBinding.cs +++ /dev/null @@ -1,194 +0,0 @@ -using System; -using System.Diagnostics; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace MadMilkman.Ini -{ - /// - /// Represents a class that is used for binding operations, an operation in which the placeholder keys values are replaced with an internal or external data. - /// - /// - /// can be accessed through property. - /// Binding can be executed with internal data source or with a provided external data source. - /// For more information see IniKey's Value Binding. - /// - /// IniKey's Value Binding - public sealed class IniValueBinding - { - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly IniValueBindingEventArgs args; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private readonly IniFile iniFile; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private static readonly Regex placeholderPattern = new Regex(@"@\{[\w\s|]+\}", RegexOptions.Compiled | RegexOptions.CultureInvariant); - - /// - /// Occurs when a placeholder is binding with data source value and can be used to customize the binding operation. - /// - public event EventHandler Binding; - - internal IniValueBinding(IniFile iniFile) - { - if (iniFile == null) - throw new ArgumentNullException("iniFile"); - - this.iniFile = iniFile; - this.args = new IniValueBindingEventArgs(); - } - - /// - /// Executes a binding operation with internal data source. - /// - /// IniKey's Value Binding - public void Bind() - { - foreach (var placeholderPair in this.GetPlaceholderPairs(null)) - { - IniKey placeholderKey = placeholderPair.Key; - string placeholder = placeholderPair.Value; - string placeholderName = placeholder.Substring(2, placeholder.Length - 3); - string targetedValue; - - int separator = placeholder.IndexOf('|'); - if (separator != -1) - { - var targetedSection = this.iniFile.Sections[placeholder.Substring(2, separator - 2)]; - if (targetedSection == null) - continue; - - targetedValue = GetTargetedValue( - targetedSection, - placeholder.Substring(separator + 1, placeholder.Length - separator - 2)); - } - else - targetedValue = GetTargetedValue( - placeholderKey.ParentSection, - placeholderName); - - this.ExecuteBinding(placeholder, placeholderName, placeholderKey, targetedValue); - } - } - - /// - /// Executes a binding operation with external data source. - /// - /// The binding data source. - /// IniKey's Value Binding - public void Bind(object dataSource) { this.Bind(dataSource, null); } - - /// - /// Executes a binding operation with external data source, only on specified section. - /// - /// The binding data source. - /// The 's name. - /// IniKey's Value Binding - public void Bind(object dataSource, string sectionName) - { - if (dataSource == null) - throw new ArgumentNullException("dataSource"); - - var dataSourceDictionary = CreateDataSourceDictionary(dataSource); - if (dataSourceDictionary == null) - return; - - foreach (var placeholderPair in this.GetPlaceholderPairs(this.iniFile.Sections[sectionName])) - { - IniKey placeholderKey = placeholderPair.Key; - string placeholder = placeholderPair.Value; - string placeholderName = placeholder.Substring(2, placeholder.Length - 3); - string targetedValue; - - dataSourceDictionary.TryGetValue(placeholderName, out targetedValue); - - this.ExecuteBinding(placeholder, placeholderName, placeholderKey, targetedValue); - } - } - - private void ExecuteBinding(string placeholder, string placeholderName, IniKey placeholderKey, string targetedValue) - { - this.args.Initialize(placeholderName, placeholderKey, targetedValue, targetedValue != null); - - if (this.Binding != null) - this.Binding(this, this.args); - - if (this.args.Value != null) - placeholderKey.Value = placeholderKey.Value.Replace(placeholder, this.args.Value); - - this.args.Reset(); - } - - // Returns placeholder pairs as KeyValuePair: - // Key = IniKey in which value's the placeholder resides - // Value = Placeholder, e.g. @{Placeholder} - private IEnumerable> GetPlaceholderPairs(IniSection section) - { - if (section != null) - { - foreach (IniKey key in section.Keys) - if (key.Value != null) - { - int matchStartat = key.Value.IndexOf("@{"); - if (matchStartat != -1) - foreach (Match match in placeholderPattern.Matches(key.Value, matchStartat)) - yield return new KeyValuePair(key, match.Value); - } - } - else - { - foreach (IniSection iniSection in this.iniFile.Sections) - foreach (var placeholderPair in this.GetPlaceholderPairs(iniSection)) - yield return placeholderPair; - } - } - - private static string GetTargetedValue(IniSection targetedSection, string targetedKeyName) - { - IniKey targetedKey = targetedSection.Keys[targetedKeyName]; - return targetedKey != null ? targetedKey.Value : null; - } - - /* REMARKS: TODO re-factor this, use providers ... - * - * CONSIDER: Implement support for any custom (including anonymous) types, use reflation ... */ - private static IDictionary CreateDataSourceDictionary(object dataSource) - { - var dictionary = dataSource as IDictionary; - if (dictionary != null) - return dictionary; - - var collection = dataSource as ICollection>; - if (collection != null) - { - dictionary = new Dictionary(collection.Count); - - foreach (var dataSourceItem in collection) - if (!dictionary.ContainsKey(dataSourceItem.Key)) - dictionary.Add(dataSourceItem); - - return dictionary; - } - - var enumerator = dataSource as IEnumerable>; - if (enumerator != null) - { - dictionary = new Dictionary(); - - foreach (var dataSourceItem in enumerator) - if (!dictionary.ContainsKey(dataSourceItem.Key)) - dictionary.Add(dataSourceItem); - - return dictionary; - } - - if (dataSource is KeyValuePair) - { - dictionary = new Dictionary(1); - dictionary.Add((KeyValuePair)dataSource); - return dictionary; - } - - return null; - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueBindingEventArgs.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueBindingEventArgs.cs deleted file mode 100644 index 1d4c623..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueBindingEventArgs.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Diagnostics; - -namespace MadMilkman.Ini -{ - /// - /// Provides data for event. - /// - public sealed class IniValueBindingEventArgs : EventArgs - { - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private string placeholderName; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private IniKey placeholderKey; - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private bool isValueFound; - - /// - /// Gets the placeholder's name. - /// - public string PlaceholderName { get { return this.placeholderName; } } - - /// - /// Gets the placeholder's . - /// - public IniKey PlaceholderKey { get { return this.placeholderKey; } } - - /// - /// Gets or sets the data source value that will replace the placeholder. - /// - /// - /// The data source value that will replace the placeholder, if it's not . - /// - public string Value { get; set; } - - /// - /// Gets a value indicating whether value was found in the data source. - /// - /// - /// if value was found in the data source. - /// - public bool IsValueFound { get { return this.isValueFound; } } - - internal IniValueBindingEventArgs() { } - - internal void Initialize(string placeholderName, IniKey placeholderKey, string value, bool isValueFound) - { - this.placeholderName = placeholderName; - this.placeholderKey = placeholderKey; - this.Value = value; - this.isValueFound = isValueFound; - } - - internal void Reset() { this.Initialize(null, null, null, false); } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueMappings.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueMappings.cs deleted file mode 100644 index 8df4c64..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueMappings.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Diagnostics; -using System.Collections.Generic; - -namespace MadMilkman.Ini -{ - /// - /// Represents a class of mapped s and their results, used in methods. - /// - /// - /// can be accessed through property. - /// Mapped value results have priority over parsing the value. - /// For more information see IniKey's Value Parsing. - /// - /// IniKey's Value Parsing - public sealed class IniValueMappings - { - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private static readonly Predicate MappedTypeVerifier = IniKey.IsSupportedValueType; - - private readonly IDictionary mappings; - - internal IniValueMappings() { this.mappings = new Dictionary(StringComparer.OrdinalIgnoreCase); } - - /// - /// Adds a new mapping of to resulting object of parse methods. - /// - /// The key's value. - /// The object that represents parsed . - /// Type of the object that represents parsed . - /// - /// The key's value cannot be . - /// The mapped result's type must be one of the supported types for parsing, see the remarks of method. - /// Collection cannot contain multiple entries of same key's value, value comparison is case-insensitive. - /// - public void Add(string value, T mappedResult) - { - if (value == null) - throw new ArgumentNullException("value"); - - if (this.Contains(value) || !IniValueMappings.MappedTypeVerifier(typeof(T))) - throw new InvalidOperationException(); - - this.mappings.Add(value, mappedResult); - } - - /// - /// Determines whether the collection contains a mapping for a specified key's value. - /// - /// The key's value to locate in the collection. - /// if the collection contains a mapping for a specified key's value. - public bool Contains(string value) { return this.mappings.ContainsKey(value); } - - /// - /// Removes a mapping for a specified key's value in the collection. - /// - /// The key's value to remove in the collection. - /// if a mapping for a specified key's value is successfully found and removed. - public bool Remove(string value) { return this.mappings.Remove(value); } - - internal bool TryGetResult(string value, out T result) - { - if (!string.IsNullOrEmpty(value)) - { - object mappedResult; - if (this.mappings.TryGetValue(value, out mappedResult) && - mappedResult.GetType() == typeof(T)) - { - result = (T)mappedResult; - return true; - } - } - result = default(T); - return false; - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueParser.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueParser.cs deleted file mode 100644 index 598ebac..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/IniUtilities/IniValueParser.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; - -namespace MadMilkman.Ini -{ - delegate bool TryParseDelegate(string value, out TDelegate result); - - internal static class IniValueParser - { - private static TryParseDelegate parser; - - static IniValueParser() { InitializeParser(typeof(T)); } - - private static void InitializeParser(Type type) - { - if (type.IsEnum) SetParser(EnumTryParse); - else if (type == typeof(TimeSpan)) SetParser(TimeSpan.TryParse); - else - switch (Type.GetTypeCode(type)) - { - case TypeCode.Boolean: SetParser(bool.TryParse); break; - case TypeCode.Byte: SetParser(byte.TryParse); break; - case TypeCode.SByte: SetParser(sbyte.TryParse); break; - case TypeCode.Int16: SetParser(short.TryParse); break; - case TypeCode.UInt16: SetParser(ushort.TryParse); break; - case TypeCode.Int32: SetParser(int.TryParse); break; - case TypeCode.UInt32: SetParser(uint.TryParse); break; - case TypeCode.Int64: SetParser(long.TryParse); break; - case TypeCode.UInt64: SetParser(ulong.TryParse); break; - case TypeCode.Single: SetParser(float.TryParse); break; - case TypeCode.Double: SetParser(double.TryParse); break; - case TypeCode.Decimal: SetParser(decimal.TryParse); break; - case TypeCode.Char: SetParser(char.TryParse); break; - case TypeCode.DateTime: SetParser(DateTime.TryParse); break; - case TypeCode.String: SetParser((string value, out string result) => { result = value; return true; }); break; - } - } - - private static void SetParser(TryParseDelegate parser) - { - IniValueParser.parser = parser; - } - - private static bool EnumTryParse(string value, out TEnum result) - { - /* REMARKS: To support case insensitivity instead of Enum.IsDefined use Enum.GetNames - * to achieve case insensitive string comparison between enum's names and value. */ - - Type type = typeof(TEnum); - if (Enum.IsDefined((type), value)) - { - result = (TEnum)Enum.Parse(type, value); - return true; - } - - result = default(TEnum); - return false; - } - - public static bool TryParse(string value, out T result) - { - if (parser == null) - throw new NotSupportedException(); - - return parser(value, out result); - } - } -} diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/MadMilkman.Ini.csproj b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/MadMilkman.Ini.csproj deleted file mode 100644 index 2803d9b..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/MadMilkman.Ini.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - - Debug - AnyCPU - {BEF9735D-C3CC-41E6-AAC6-18C5985D3107} - Library - Properties - MadMilkman.Ini - MadMilkman.Ini - v2.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - bin\Debug\MadMilkman.Ini.xml - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\MadMilkman.Ini.xml - AllRules.ruleset - - - true - - - Properties\MadMilkman.Ini.StrongNameKey.snk - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/Properties/AssemblyInfo.cs b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/Properties/AssemblyInfo.cs deleted file mode 100644 index fb143e7..0000000 --- a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Security; -using System.Resources; - -[assembly: AssemblyTitle("MadMilkman.Ini")] -[assembly: AssemblyDescription("INI file's reader and writer for .NET framework.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("MadMilkman")] -[assembly: AssemblyProduct("MadMilkman.Ini")] -[assembly: AssemblyCopyright("Copyright © MadMilkman")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -[assembly: ComVisible(false)] -[assembly: Guid("aa0460b5-031d-49f3-a71b-2eb353055941")] -[assembly: AllowPartiallyTrustedCallers] -[assembly: CLSCompliant(true)] - -[assembly: AssemblyVersion("1.0.6.0")] -[assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/Properties/MadMilkman.Ini.StrongNameKey.snk b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/Properties/MadMilkman.Ini.StrongNameKey.snk deleted file mode 100644 index 70e1b49..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/Properties/MadMilkman.Ini.StrongNameKey.snk and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/Properties/MadMilkman.Ini.png b/MadMilkman.Ini-1.0.6/MadMilkman.Ini/Properties/MadMilkman.Ini.png deleted file mode 100644 index 61a3bbc..0000000 Binary files a/MadMilkman.Ini-1.0.6/MadMilkman.Ini/Properties/MadMilkman.Ini.png and /dev/null differ diff --git a/MadMilkman.Ini-1.0.6/README.md b/MadMilkman.Ini-1.0.6/README.md deleted file mode 100644 index e0930b5..0000000 --- a/MadMilkman.Ini-1.0.6/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# ![MadMilkman.Ini component's icon](../master/MadMilkman.Ini/Properties/MadMilkman.Ini.png) MadMilkman.Ini -**MadMilkman.Ini** is a .NET component which simplifies processing of INI files and requires only a minimum **.NET Framework version 2.0**. -It is 100% managed code (C#), **compatible with Mono framework**, which provides an easy to use programming interface. - -## Advantages: -* Enables reading and writing of various INI file formats. -* Enables easy manipulation of INI file's content. -* Enables copying and merging multiple INI file's contents. -* Enables encrypting and decrypting INI files. -* Enables compressing and decompressing INI files. -* Enables serializing and deserializing custom types into an INI content. - -## Installation: -You can use this component in any way that suits you: -* As _private assembly_ by adding [MadMilkman.Ini.dll](https://github.com/MarioZ/MadMilkman.Ini/raw/master/MadMilkman.Ini.zip) inside your project. -* As _shared assembly_ by installing [MadMilkman.Ini.Setup.msi](https://github.com/MarioZ/MadMilkman.Ini/raw/master/MadMilkman.Ini.Setup.msi). -* As _package_ via [NuGet](http://www.nuget.org/packages/MadMilkman.Ini): -```powershell -PM> Install-Package MadMilkman.Ini -``` - -## First steps: -1. Create new .NET project. -2. Add new reference to MadMilkman.Ini.dll. -3. Add MadMilkman.Ini namespace. - * C# - `using MadMilkman.Ini;` - * VB.NET - `Import MadMilkman.Ini` - * C++/CLI - `using namespace MadMilkman::Ini;` -4. Write some INI files processing code. - * Use code samples located in MadMilkman.Ini.Samples, written in C#, VB.NET and C++/CLI as starting point. - * Read [MadMilkman.Ini.Documentation.chm](https://github.com/MarioZ/MadMilkman.Ini/raw/master/MadMilkman.Ini.Documentation.chm) to learn more about the component and its API references. - -> If you are experiencing difficulties with viewing the CHM file's content after downloading it, right-click on CHM file, select "Properties" and under the "General" tab click "Unblock". - -## Feedback & Support: -Please feel free to contact me with any questions, suggestions or issues regarding the MadMilkman.Ini component, I will be more than happy to provide a help. -Also if you found the component useful or useless I would be interested in hearing about it. - -## Overview -MadMilkman.Ini provides a simple and intuitive programming interface which makes it very easy to create new or process existing INI files. Because INI file format is loosely defined and has no real standard, different files can have different format. By default MadMilkman.Ini processes the following format (however it is possible to define a custom formatting via IniOptions class): - -```cfg -;Section trailing comment -[Section name] -Key name = Key value ;Key leading comment -``` - -### C# # -```csharp -// Create new file with a default formatting. -IniFile file = new IniFile(); - -// Add new section. -IniSection section = file.Sections.Add("Section name"); -// Add trailing comment. -section.TrailingComment.Text = "Section trailing comment"; - -// Add new key and its value. -IniKey key = section.Keys.Add("Key name", "Key value "); -// Add leading comment. -key.LeadingComment.Text = "Key leading comment"; - -// Save file. -file.Save("Sample.ini"); -``` - -### VB.NET -```vb.net -' Create new file with a default formatting. -Dim file As New IniFile() - -' Add new section. -Dim section As IniSection = file.Sections.Add("Section name") -' Add trailing comment. -section.TrailingComment.Text = "Section trailing comment" - -' Add new key and its value. -Dim key As IniKey = section.Keys.Add("Key name", "Key value ") -' Add leading comment. -key.LeadingComment.Text = "Key leading comment" - -' Save file. -file.Save("Sample.ini") -``` - -### C++/CLI -```cpp -// Create new file with a default formatting. -IniFile^ file = gcnew IniFile(); - -// Add new section. -IniSection^ section = file->Sections->Add("Section name"); -// Add trailing comment. -section->TrailingComment->Text = "Section trailing comment"; - -// Add new key and its value. -IniKey^ key = section->Keys->Add("Key name", "Key value "); -// Add leading comment. -key->LeadingComment->Text = "Key leading comment"; - -// Save file. -file->Save("Sample.ini"); -``` - -**Compression** feature enables you to reduce INI file's size. - -**Encryption** feature enables you to protect INI file by providing an encryption password. - -**Parsing** feature enables you to retrieve the key's value as an instance of a specific type via key's TryParseValue method, all currently supported types are listed in key's IsSupportedValueType method remarks. - -**Binding** feature enables you to define placeholders inside a key's value which can be binded (replaced) with an internal or external data source via Bind() method. - -**Serialization** feature enables you to serialize an object into section's keys. - -More details can be found in [MadMilkman.Ini.Documentation.chm](https://github.com/MarioZ/MadMilkman.Ini/raw/master/MadMilkman.Ini.Documentation.chm). \ No newline at end of file diff --git a/MadMilkman.Ini-1.0.6/RELEASENOTES b/MadMilkman.Ini-1.0.6/RELEASENOTES deleted file mode 100644 index fffc89e..0000000 --- a/MadMilkman.Ini-1.0.6/RELEASENOTES +++ /dev/null @@ -1,38 +0,0 @@ -[1.0.6.0] NEW RELEASE -[1.0.5.2] Added support for quoted values which can contain comment's starting characters. -[1.0.5.1] Fixed issue with NULL array and list when deserializing object. - -[1.0.5.0] NEW RELEASE -[1.0.4.3] Added support for section names that may contain end wrapper or comment starter characters. -[1.0.4.1] Fixed issue with SerializeDeserializeAttributeTest. - Improved string array indexer in IniItemCollection. - -[1.0.4.0] NEW RELEASE -[1.0.3.3] Added support for serializing and deserializing objects into an INI content. - Added support for string array indexer in IniItemCollection. -[1.0.3.2] Added support for customizing binding operations via Binding event. -[1.0.3.1] Added support for reducing INI file via compression and decompression. - Added support for protecting INI file via encryption and decryption. - -[1.0.3.0] NEW RELEASE -[1.0.2.3] Added support for defining placeholders in IniKey.Value and binding them with internal or external data source. -[1.0.2.2] Added support for IniKey.ParentSection property. -[1.0.2.1] Switched from MS tests to NUnit tests. - -[1.0.2.0] NEW RELEASE -[1.0.1.4] Reduced memory footprint. -[1.0.1.3] Fixed issue with using IniItemCollection.Clear and then adding any of previous IniItems to IniItemCollection. -[1.0.1.2] Added support for mapping specific IniKey.Value to specific result object with IniFile.ValueMappings. - Mapped results have priority over parsing the value when using IniKey.TryParseValue methods. - Fixed issue with parsing key's value to enum. -[1.0.1.1] Added support for enums, decimals, arrays and lists in TryParseValue. - Performance improvements on TryParseValue methods. - -[1.0.1.0] NEW RELEASE -[1.0.0.4] Added support for converting IniKey.Value via IniKey.TryParseValue(out T). - Type's support can be checked by IniKey.IsSupportedValueType(Type) or read its remarks in documentation. -[1.0.0.3] Small performance improvement on reading and writing an INI file. -[1.0.0.2] Added support for creating IniSection's Keys from Dictionary and creating IniKey from KeyValuePair. -[1.0.0.1] Added support for loading file via TextReader and saving file via TextWriter. - -[1.0.0.0] INITIAL RELEASE \ No newline at end of file