Getting Started

MadMilkman.Ini.Documentation
Getting Started

MadMilkman.Ini is a .NET component which simplifies processing of INI files and requires only a minimum .NET Framework version 2.0.

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.

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] Import MadMilkman.Ini

  • [C++] using namespace MadMilkman::Ini;

4. Write some INI files processing code, use code samples as starting point.

Feedback:

Please feel free to contact me on zorica.mario@rocketmail.com 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.

Send comments on this topic to zorica.mario@rocketmail.com


Overview

Overview

MadMilkman.Ini provides a simple and intuitive programming interface which makes it very easy to programmatically create new or process existing INI files.

MadMilkman.Ini provides an in-memory representation of INI file through a few strongly-typed collections which makes it very easy to learn to use and very hard to misuse.

The main class of MadMilkman.Ini component is IniFile and when creating an instance of this class you can provide an IniOptions object with whom you can specify various format customizations.

  • IniFile's Content Hierarchy Diagram
  • IniItem's Copying
  • IniKey's Value Parsing
  • IniKey's Value Binding
  • IniSection's Object Serialization
IniFile's Content Hierarchy Diagram

The following diagram shows the relationship between the INI file's items.

Navigate to IniComment.Text PropertyNavigate to IniKey.TrailingComment PropertyNavigate to IniKey.LeadingComment PropertyNavigate to IniSection.TrailingComment PropertyNavigate to IniSection.LeadingComment PropertyNavigate to IniComment ClassNavigate to IniKey.Value PropertyNavigate to IniKey ClassNavigate to IniSection.Keys PropertyNavigate to IniSection ClassNavigate to IniFile.Sections PropertyNavigate to IniFile Class MadMilkman.Ini Content Diagram

Both IniSectionCollection and IniKeyCollection are derived from abstract IniItemCollectionT class.

Both IniSection and IniKey are derived from abstract IniItem class.

IniItem's Copying
Important note Important

Every IniItem instance can exist only in one place in the IniFile.

If you want to duplicate file's item and add or insert it into the same file, then use Copy() method on concrete IniItem derivatives to create a copied item which can be added or inserted.

If you want to duplicate file's item and add or insert it into another file, then use Copy(IniFile) method on concrete IniItem derivatives to create a copied item for another file which can be added or inserted.

By default both section and key duplicates are allowed, in case you want to change that you can specify the required IniDuplication setting in IniOptions.

See Copy example.

IniKey's Value Parsing

Value is the main information provider in INI file format. Often that information represents a numeric, date, time, etc. data.

Because of this MadMilkman.Ini provides a way for you to retrieve the value as an instance of a specific type rather than just as a plain text. You can also retrieve the value as an array or a list of specified type's instances.

Important note Important

Value that represents multiple instances is defined with '{' start character, '}' end character and ',' separators.

Additionally you can map a certain value to a specific type's instance via IniValueMappings.

Currently supported types are listed in IsSupportedValueType(Type) method's remarks.

See Parse example.

IniKey's Value Binding

Binding enables you to define placeholders inside a Value which can be binded (replaced) with a data source later on by calling Bind method.

Important note Important

Placeholder is defined as a part of a value which starts with '@{', ends with '}' and contains only letters, numbers, '_' or '|' in between.

There are two types of data sources:

  • internal

  • external

Internal data source comes from the IniFile content itself. The placeholders target a specific key's value by the corresponding name. For example

Key 1 = @{Key 2} - targets the value of a key that has a 'Key 2' name and is located in the same section as a placeholder's key, 'Key 1'.

Key 1 = @{Section 2|Key 2} - targets the value of a key that has a 'Key 2' name and is located in the section that has a 'Section 2' name.

See Bind internal data example.

External data source is provided at the execution time. The data source can consist of a single or multiple KeyValuePair<string, string> instances.

The key part corresponds to the placeholder's targeted key and the value part is the data that will be binded (replaced) with the placeholder. For example:

Key 1 = @{Foo} - can be binded with KeyValuePair<string, string>("Foo", "Hello World") data source.

See Bind external data example.

You can also customize the binding operation to your requirements by handling Binding event that intercepts every placeholder's binding.

See Bind customization example.

IniSection's Object Serialization

Serialization enables you to serialize a class object into section's keys. Each object's public property of a supported type is serialized as a key with a name equal to property's name and value equal to property's value.

Currently supported property types are listed in IsSupportedValueType(Type) method's remarks.

Additionally you can mark object's properties with IniSerializationAttribute in order to indicate that a specific object's property should not be serialized or to define a different key's name which will be used instead of the property's name.

Important note Important

Class must have a default (parameterless) constructor in order to be serialized into section's keys.

See Serialize example.


Code Samples

Code Samples

MadMilkman.Ini code samples:

  • Hello World example
  • Creating example
  • Loading example
  • Styling example
  • Saving example
  • Encrypt example
  • Compress example
  • Custom formatting example
  • Copy example
  • Parse example
  • Bind internal data example
  • Bind external data example
  • Bind customization example
  • Serialize example
Hello World example
C#
VB
C++
Copy
// 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);
' 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)
// 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);
Creating example
C#
VB
C++
Copy
// 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<string, string>()
        {
            {"Key 4.1", "Value 4.1"},
            {"Key 4.2", "Value 4.2"}
        }));
' 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"}
        }))
// 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<String^, String^>^ collection = gcnew Dictionary<String^, String^>();
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));
Loading example
C#
VB
C++
Copy
IniOptions options = new IniOptions();
IniFile iniFile = new IniFile(options);

// Load file from path.
iniFile.Load("Load Example.ini");

// Load file from stream.
using (Stream stream = File.OpenRead("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));
Dim options As New IniOptions()
Dim iniFile As New IniFile(options)

' Load file from path.
iniFile.Load("Load Example.ini")

' Load file from stream.
Using stream As Stream = File.OpenRead("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))
IniOptions^ options = gcnew IniOptions();
IniFile^ iniFile = gcnew IniFile(options);

// Load file from path.
iniFile->Load("Load Example.ini");

// Load file from stream.
Stream^ fileStream = File::OpenRead("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));
Styling example
C#
VB
C++
Copy
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;
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
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;
Saving example
C#
VB
C++
Copy
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("Save Example.ini");

// Save file to stream.
using (Stream stream = File.Create("Save Example.ini"))
    iniFile.Save(stream);

// Save file's content to string.
StringWriter contentWriter = new StringWriter();
iniFile.Save(contentWriter);
string iniContent = contentWriter.ToString();
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("Save Example.ini")

' Save file to stream.
Using stream As Stream = File.Create("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()
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("Save Example.ini");

// Save file to stream.
Stream^ fileStream = File::Create("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();
Encrypt example
C#
VB
C++
Copy
// 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("Encrypt Example.ini");

file.Sections.Clear();

// Load and dencrypt the file.
file.Load("Encrypt Example.ini");
' 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("Encrypt Example.ini")

file.Sections.Clear()

' Load and dencrypt the file.
file.Load("Encrypt Example.ini")
// 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("Encrypt Example.ini");

file->Sections->Clear();

// Load and dencrypt the file.
file->Load("Encrypt Example.ini");
Compress example
C#
VB
C++
Copy
// 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("Compress Example.ini");

file.Sections.Clear();

// Load and decompress the file.
file.Load("Compress Example.ini");
' 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("Compress Example.ini")

file.Sections.Clear()

' Load and decompress the file.
file.Load("Compress Example.ini")
// 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("Compress Example.ini");

file->Sections->Clear();

// Load and decompress the file.
file->Load("Compress Example.ini");
Custom formatting example
C#
VB
C++
Copy
// 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("Custom Example Input.ini");

// Change first section's fourth key's value.
file.Sections[0].Keys[3].Value = "NEW VALUE";

// Save file.
file.Save("Custom Example Output.ini");
' 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("Custom Example Input.ini")

' Change first section's fourth key's value.
file.Sections(0).Keys(3).Value = "NEW VALUE"

' Save file.
file.Save("Custom Example Output.ini")
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("Custom Example Input.ini");

// Change first section's fourth key's value.
file->Sections[0]->Keys[3]->Value = "NEW VALUE";

// Save file.
file->Save("Custom Example Output.ini");
Copy example
C#
VB
C++
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));
' 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))
// 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));
Parse example
C#
VB
C++
Copy
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";
using (Stream stream = new MemoryStream(Encoding.ASCII.GetBytes(content)))
    file.Load(stream);

// 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);
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"
Using stream As Stream = New MemoryStream(Encoding.ASCII.GetBytes(content))
    file.Load(stream)
End Using

' 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)
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";
Stream^ contentStream = gcnew MemoryStream(Encoding::ASCII->GetBytes(content));
try { file->Load(contentStream); }
finally { delete contentStream; }

// 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);
Bind internal data example
C#
VB
C++
Copy
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";
using (Stream stream = new MemoryStream(Encoding.ASCII.GetBytes(content)))
    file.Load(stream);

// 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;
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"
Using stream As Stream = New MemoryStream(Encoding.ASCII.GetBytes(content))
    file.Load(stream)
End Using

' 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
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";
Stream^ stream = gcnew MemoryStream(Encoding::ASCII->GetBytes(content));
try { file->Load(stream); }
finally { delete stream; }

// 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;
Bind external data example
C#
VB
C++
Copy
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}";
using (Stream stream = new MemoryStream(Encoding.ASCII.GetBytes(content)))
    file.Load(stream);

// Bind placeholders with user's data, external information.
file.ValueBinding.Bind(
    new Dictionary<string, string>
    {
        {"User Alias", "Johny"},
        {"User Name", "John"},
        {"User Surname", "Doe"}
    });

// Bind 'Homepage' placeholder with 'www.example.com' value.
file.ValueBinding.Bind(
    new KeyValuePair<string, string>("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;
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}"
Using stream As Stream = New MemoryStream(Encoding.ASCII.GetBytes(content))
    file.Load(stream)
End Using

' 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
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}";
Stream^ stream = gcnew MemoryStream(Encoding::ASCII->GetBytes(content));
try { file->Load(stream); }
finally { delete stream; }

// Bind placeholders with user's data, external information.
Dictionary<String^, String^>^ userData = gcnew Dictionary<String^, String^>();
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<String^, String^>("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;
Bind customization example
C#
VB
C++
Copy
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<string, string>
    {
        {"Name", "John"},
        {"Age", "20"},
        {"Rank", "1"}
    });
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"}
})
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<IniValueBindingEventArgs^>(this, &BindingCustomizationSample::CustomEventHandler);

        // Execute binding operation.
        Dictionary<String^, String^>^ dataSource = gcnew Dictionary<String^, String^>();
        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;
        }
    }
};
Serialize example
C#
VB
C++
Copy
// 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; }
}
' 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.
    <IniSerialization("Sword")>
    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.
    <IniSerialization("Shield")>
    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.
    <IniSerialization(True)>
    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 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;
    }
};
C#
VB
C++
Copy
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<GameCharacter>();
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)()
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<GameCharacter^>();


MadMilkman.Ini Namespace

MadMilkman.Ini Namespace
Contains types which represent INI file's content.
Classes
 | Class | Description
Public class | IniComment | Represents a comment object used by IniItem objects, IniSection and IniKey.
Public class | IniFile | In-memory representation of an INI file.
Public class | IniItem | Represents a base class for INI content items, IniSection and IniKey.
Public class | IniItemCollectionT | Represents a base generic class for INI content item collections, IniSectionCollection and IniKeyCollection.
Public class | IniKey | Represents a key item of the INI file with name and value content.
Public class | IniKeyCollection | Represents a collection of IniKey items.
Public class | IniOptions | Represents a class that defines INI file's format, stores properties used for both reading and writing a file.
Public class | IniSection | Represents a section item of the INI file with name and keys content.
Public class | IniSectionCollection | Represents a collection of IniSection items.
Public class | IniSerializationAttribute | Indicates the behavior of public property when serializing or deserializing the object that contains it.
Public class | IniValueBinding | 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.
Public class | IniValueBindingEventArgs | Provides data for Binding event.
Public class | IniValueMappings | Represents a class of mapped Values and their results, used in TryParseValue Overload methods.
Enumerations
 | Enumeration | Description
Public enumeration | IniCommentStarter | Defines comment's starting character.
Public enumeration | IniDuplication | Defines a behaviour for duplicate Name occurences.
Public enumeration | IniKeyDelimiter | Defines key's name and value delimiter character.
Public enumeration | IniSectionWrapper | Defines section's wrapper characters around its name.


IniComment Class

IniComment Class
Represents a comment object used by IniItem objects, IniSection and IniKey.
Inheritance Hierarchy
SystemObject
MadMilkman.IniIniComment

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public sealed class IniComment
Public NotInheritable Class IniComment
public ref class IniComment sealed

The IniComment type exposes the following members.

Properties
 | Name | Description
Public property | EmptyLinesBefore | Gets or sets the amount of empty lines before this comment's text.
Public property | LeftIndentation | Gets or sets the amount of whitespace characters before this comment's text.
Public property | Text | Gets or sets a text of this IniComment instance.
Top
See Also

Reference

MadMilkman.Ini Namespace


IniComment Properties

IniComment Properties

The IniComment type exposes the following members.

Properties
 | Name | Description
Public property | EmptyLinesBefore | Gets or sets the amount of empty lines before this comment's text.
Public property | LeftIndentation | Gets or sets the amount of whitespace characters before this comment's text.
Public property | Text | Gets or sets a text of this IniComment instance.
Top
See Also

Reference

IniComment Class


IniComment.EmptyLinesBefore Property

IniCommentEmptyLinesBefore Property
Gets or sets the amount of empty lines before this comment's text.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public int EmptyLinesBefore { get; set; }
Public Property EmptyLinesBefore As Integer
    Get
    Set
public:
property int EmptyLinesBefore {
    int get ();
    void set (int value);
}

Property Value

Type: Int32
See Also

Reference

IniComment Class


IniComment.LeftIndentation Property

IniCommentLeftIndentation Property
Gets or sets the amount of whitespace characters before this comment's text.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public int LeftIndentation { get; set; }
Public Property LeftIndentation As Integer
    Get
    Set
public:
property int LeftIndentation {
    int get ();
    void set (int value);
}

Property Value

Type: Int32
See Also

Reference

IniComment Class


IniComment.Text Property

IniCommentText Property
Gets or sets a text of this IniComment instance.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public string Text { get; set; }
Public Property Text As String
    Get
    Set
public:
property String^ Text {
    String^ get ();
    void set (String^ value);
}

Property Value

Type: String
Remarks

For LeadingComment text should not contain new line characters. If it does, they will be replaced with a space characters.

See Also

Reference

IniComment Class


IniCommentStarter Enumeration

IniCommentStarter Enumeration
Defines comment's starting character.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public enum IniCommentStarter
Public Enumeration IniCommentStarter
public enum class IniCommentStarter
Members
Member name | Value | Description
Semicolon | 59 | Use ';' as comment's starting character.
Hash | 35 | Use '#' as comment's starting character.
See Also

Reference

MadMilkman.Ini Namespace
Send comments on this topic to zorica.mario@rocketmail.com


IniDuplication Enumeration

IniDuplication Enumeration
Defines a behaviour for duplicate Name occurences.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public enum IniDuplication
Public Enumeration IniDuplication
public enum class IniDuplication
Members
Member name | Value | Description
Allowed | 0 | Allow duplicate names in IniItemCollectionT.
Disallowed | 1 | Disallow duplicate names in IniItemCollectionT.
Ignored | 2 | Ignore duplicate names.
See Also

Reference

MadMilkman.Ini Namespace
Send comments on this topic to zorica.mario@rocketmail.com


IniFile Class

IniFile Class
In-memory representation of an INI file.
Inheritance Hierarchy
SystemObject
MadMilkman.IniIniFile

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public sealed class IniFile
Public NotInheritable Class IniFile
public ref class IniFile sealed

The IniFile type exposes the following members.

Constructors
 | Name | Description
Public method | IniFile | Initializes a new instance of IniFile class.
Public method | IniFile(IniOptions) | Initializes a new instance of IniFile class.
Top
Methods
 | Name | Description
Public method | Load(Stream) | Loads a file from a stream.
Public method | Load(TextReader) | Loads a file from a reader.
Public method | Load(String) | Loads a file from a path.
Public method | Save(Stream) | Saves a file to a stream.
Public method | Save(TextWriter) | Saves a file to a writer.
Public method | Save(String) | Saves a file to a path.
Top
Properties
 | Name | Description
Public property | Sections | Gets file's sections.
Public property | ValueBinding | Gets the object that exposes binding operations, which are executed with Bind Overload methods.
Public property | ValueMappings | Gets the mappings of Values and their results, used in TryParseValue Overload methods.
Top
Remarks

IniFile is a central class of MadMilkman.Ini component.

To define an INI file's format use IniOptions 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.

See Also

Reference

MadMilkman.Ini Namespace

Other Resources

Overview
INI file format on Wikipedia.


IniFile Constructor

IniFile Constructor
Overload List
 | Name | Description
Public method | IniFile | Initializes a new instance of IniFile class.
Public method | IniFile(IniOptions) | Initializes a new instance of IniFile class.
Top
See Also

Reference

IniFile Class


IniFile Constructor

IniFile Constructor
Initializes a new instance of IniFile class.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniFile()
Public Sub New
public:
IniFile()
See Also

Reference

IniFile Class
IniFile Overload


IniFile Constructor (IniOptions)

IniFile Constructor (IniOptions)
Initializes a new instance of IniFile class.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniFile(
    IniOptions options
)
Public Sub New (
    options As IniOptions
)
public:
IniFile(
    IniOptions^ options
)

Parameters

options
Type: MadMilkman.IniIniOptions
IniOptions object that defines INI file's format, settings for both Load and Save methods.
See Also

Reference

IniFile Class
IniFile Overload


IniFile Methods

IniFile Methods
Methods
 | Name | Description
Public method | Load(Stream) | Loads a file from a stream.
Public method | Load(TextReader) | Loads a file from a reader.
Public method | Load(String) | Loads a file from a path.
Public method | Save(Stream) | Saves a file to a stream.
Public method | Save(TextWriter) | Saves a file to a writer.
Public method | Save(String) | Saves a file to a path.
Top
See Also

Reference

IniFile Class


IniFile.Load Method

IniFileLoad Method
Overload List
 | Name | Description
Public method | Load(Stream) | Loads a file from a stream.
Public method | Load(TextReader) | Loads a file from a reader.
Public method | Load(String) | Loads a file from a path.
Top
See Also

Reference

IniFile Class


IniFile.Load Method (Stream)

IniFileLoad Method (Stream)
Loads a file from a stream.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Load(
    Stream fileStream
)
Public Sub Load (
    fileStream As Stream
)
public:
void Load(
    Stream^ fileStream
)

Parameters

fileStream
Type: System.IOStream
Stream from which to load a file.
See Also

Reference

IniFile Class
Load Overload


IniFile.Load Method (TextReader)

IniFileLoad Method (TextReader)
Loads a file from a reader.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Load(
    TextReader fileReader
)
Public Sub Load (
    fileReader As TextReader
)
public:
void Load(
    TextReader^ fileReader
)

Parameters

fileReader
Type: System.IOTextReader
Reader from which to load a file.
See Also

Reference

IniFile Class
Load Overload


IniFile.Load Method (String)

IniFileLoad Method (String)
Loads a file from a path.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Load(
    string filePath
)
Public Sub Load (
    filePath As String
)
public:
void Load(
    String^ filePath
)

Parameters

filePath
Type: SystemString
Path from which to load a file.
See Also

Reference

IniFile Class
Load Overload


IniFile.Save Method

IniFileSave Method
Overload List
 | Name | Description
Public method | Save(Stream) | Saves a file to a stream.
Public method | Save(TextWriter) | Saves a file to a writer.
Public method | Save(String) | Saves a file to a path.
Top
See Also

Reference

IniFile Class


IniFile.Save Method (Stream)

IniFileSave Method (Stream)
Saves a file to a stream.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Save(
    Stream fileStream
)
Public Sub Save (
    fileStream As Stream
)
public:
void Save(
    Stream^ fileStream
)

Parameters

fileStream
Type: System.IOStream
Stream to which to save a file.
See Also

Reference

IniFile Class
Save Overload


IniFile.Save Method (TextWriter)

IniFileSave Method (TextWriter)
Saves a file to a writer.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Save(
    TextWriter fileWriter
)
Public Sub Save (
    fileWriter As TextWriter
)
public:
void Save(
    TextWriter^ fileWriter
)

Parameters

fileWriter
Type: System.IOTextWriter
Writer to which to save a file.
See Also

Reference

IniFile Class
Save Overload


IniFile.Save Method (String)

IniFileSave Method (String)
Saves a file to a path.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Save(
    string filePath
)
Public Sub Save (
    filePath As String
)
public:
void Save(
    String^ filePath
)

Parameters

filePath
Type: SystemString
Path to which to save a file.
See Also

Reference

IniFile Class
Save Overload


IniFile Properties

IniFile Properties

The IniFile type exposes the following members.

Properties
 | Name | Description
Public property | Sections | Gets file's sections.
Public property | ValueBinding | Gets the object that exposes binding operations, which are executed with Bind Overload methods.
Public property | ValueMappings | Gets the mappings of Values and their results, used in TryParseValue Overload methods.
Top
See Also

Reference

IniFile Class


IniFile.Sections Property

IniFileSections Property
Gets file's sections.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSectionCollection Sections { get; }
Public ReadOnly Property Sections As IniSectionCollection
    Get
public:
property IniSectionCollection^ Sections {
    IniSectionCollection^ get ();
}

Property Value

Type: IniSectionCollection
See Also

Reference

IniFile Class


IniFile.ValueBinding Property

IniFileValueBinding Property
Gets the object that exposes binding operations, which are executed with Bind Overload methods.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniValueBinding ValueBinding { get; }
Public ReadOnly Property ValueBinding As IniValueBinding
    Get
public:
property IniValueBinding^ ValueBinding {
    IniValueBinding^ get ();
}

Property Value

Type: IniValueBinding
See Also

Reference

IniFile Class


IniFile.ValueMappings Property

IniFileValueMappings Property
Gets the mappings of Values and their results, used in TryParseValue Overload methods.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniValueMappings ValueMappings { get; }
Public ReadOnly Property ValueMappings As IniValueMappings
    Get
public:
property IniValueMappings^ ValueMappings {
    IniValueMappings^ get ();
}

Property Value

Type: IniValueMappings
See Also

Reference

IniFile Class


IniItem Class

IniItem Class
Represents a base class for INI content items, IniSection and IniKey.
Inheritance Hierarchy
SystemObject
MadMilkman.IniIniItem
MadMilkman.IniIniKey
MadMilkman.IniIniSection

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public abstract class IniItem
Public MustInherit Class IniItem
public ref class IniItem abstract

The IniItem type exposes the following members.

Properties
 | Name | Description
Public property | LeadingComment | Gets the IniComment object that represents a comment that follows this IniItem on the same line.
Public property | LeftIndentation | Gets or sets the amount of whitespace characters before this item's name.
Public property | Name | Gets and sets the name of the current IniItem.
Public property | ParentFile | Gets the IniFile to which this IniItem belongs to.
Public property | TrailingComment | Gets the IniComment object that represents a comments that occur before this IniItem.
Top
Remarks

All INI items share the same content like Name, LeadingComment and TrailingComment. These properties are defined on an IniItem class, a base class for INI content items.

See Also

Reference

MadMilkman.Ini Namespace
Send comments on this topic to zorica.mario@rocketmail.com


IniItem Properties

IniItem Properties

The IniItem type exposes the following members.

Properties
 | Name | Description
Public property | LeadingComment | Gets the IniComment object that represents a comment that follows this IniItem on the same line.
Public property | LeftIndentation | Gets or sets the amount of whitespace characters before this item's name.
Public property | Name | Gets and sets the name of the current IniItem.
Public property | ParentFile | Gets the IniFile to which this IniItem belongs to.
Public property | TrailingComment | Gets the IniComment object that represents a comments that occur before this IniItem.
Top
See Also

Reference

IniItem Class


IniItem.LeadingComment Property

IniItemLeadingComment Property
Gets the IniComment object that represents a comment that follows this IniItem on the same line.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniComment LeadingComment { get; }
Public ReadOnly Property LeadingComment As IniComment
    Get
public:
property IniComment^ LeadingComment {
    IniComment^ get ();
}

Property Value

Type: IniComment
See Also

Reference

IniItem Class


IniItem.LeftIndentation Property

IniItemLeftIndentation Property
Gets or sets the amount of whitespace characters before this item's name.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public int LeftIndentation { get; set; }
Public Property LeftIndentation As Integer
    Get
    Set
public:
property int LeftIndentation {
    int get ();
    void set (int value);
}

Property Value

Type: Int32
See Also

Reference

IniItem Class


IniItem.Name Property

IniItemName Property
Gets and sets the name of the current IniItem.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public string Name { get; set; }
Public Property Name As String
    Get
    Set
public:
property String^ Name {
    String^ get ();
    void set (String^ value);
}

Property Value

Type: String
Remarks
When setting Name the value is verified by the item's IniDuplication rule.
See Also

Reference

IniItem Class


IniItem.ParentFile Property

IniItemParentFile Property
Gets the IniFile to which this IniItem belongs to.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniFile ParentFile { get; }
Public ReadOnly Property ParentFile As IniFile
    Get
public:
property IniFile^ ParentFile {
    IniFile^ get ();
}

Property Value

Type: IniFile
See Also

Reference

IniItem Class


IniItem.TrailingComment Property

IniItemTrailingComment Property
Gets the IniComment object that represents a comments that occur before this IniItem.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniComment TrailingComment { get; }
Public ReadOnly Property TrailingComment As IniComment
    Get
public:
property IniComment^ TrailingComment {
    IniComment^ get ();
}

Property Value

Type: IniComment
See Also

Reference

IniItem Class


IniItemCollection(T) Class

IniItemCollectionT Class
Represents a base generic class for INI content item collections, IniSectionCollection and IniKeyCollection.
Inheritance Hierarchy
SystemObject
MadMilkman.IniIniItemCollectionT
MadMilkman.IniIniKeyCollection
MadMilkman.IniIniSectionCollection

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public abstract class IniItemCollection<T> : IList<T>,
    ICollection<T>, IEnumerable<T>, IEnumerable
where T : IniItem

Public MustInherit Class IniItemCollection(Of T As IniItem)
    Implements IList(Of T), ICollection(Of T),
    IEnumerable(Of T), IEnumerable
generic<typename T>
where T : IniItem
public ref class IniItemCollection abstract : IList<T>,
    ICollection<T>, IEnumerable<T>, IEnumerable

Type Parameters

T
IniItem derived type.

The IniItemCollectionT type exposes the following members.

Methods
 | Name | Description
Public method | Add | Adds an item to the end of this collection.
Public method | Clear | Removes all items from this collection.
Public method | Contains(String) | Determines whether an item is in this collection.
Public method | Contains(T) | Determines whether an item is in this collection.
Public method | CopyTo | Shallow copies the items of this collection to an array.
Public method | GetEnumerator | Returns an enumerator that iterates through the collection.
Public method | IndexOf(String) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection.
Public method | IndexOf(T) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection.
Public method | Insert | Inserts an item to this collection at the specified index.
Public method | Remove(String) | Removes the first occurrence of specific item from this collection.
Public method | Remove(T) | Removes the first occurrence of specific item from this collection.
Public method | RemoveAt | Removes an item at the specified index from this collection.
Top
Properties
 | Name | Description
Public property | Count | Gets the number of items in this collection.
Public property | ItemInt32 | Gets or sets the item at the specified index.
Public property | ItemString | Gets the first item of the specified name.
Public property | ItemString | Gets the first items of the specified names.
Top
See Also

Reference

MadMilkman.Ini Namespace
MadMilkman.IniIniItem


IniItemCollection(T) Methods

IniItemCollectionT Methods

The IniItemCollectionT generic type exposes the following members.

Methods
 | Name | Description
Public method | Add | Adds an item to the end of this collection.
Public method | Clear | Removes all items from this collection.
Public method | Contains(String) | Determines whether an item is in this collection.
Public method | Contains(T) | Determines whether an item is in this collection.
Public method | CopyTo | Shallow copies the items of this collection to an array.
Public method | GetEnumerator | Returns an enumerator that iterates through the collection.
Public method | IndexOf(String) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection.
Public method | IndexOf(T) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection.
Public method | Insert | Inserts an item to this collection at the specified index.
Public method | Remove(String) | Removes the first occurrence of specific item from this collection.
Public method | Remove(T) | Removes the first occurrence of specific item from this collection.
Public method | RemoveAt | Removes an item at the specified index from this collection.
Top
See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).Add Method

IniItemCollectionTAdd Method
Adds an item to the end of this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Add(
    T item
)
Public Sub Add (
    item As T
)
public:
virtual void Add(
    T item
) sealed

Parameters

item
Type: T
Item to add to this collection.

Implements

ICollectionTAdd(T)
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not added.

See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).Clear Method

IniItemCollectionTClear Method
Removes all items from this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Clear()
Public Sub Clear
public:
virtual void Clear() sealed

Implements

ICollectionTClear
See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).Contains Method

IniItemCollectionTContains Method
Overload List
 | Name | Description
Public method | Contains(String) | Determines whether an item is in this collection.
Public method | Contains(T) | Determines whether an item is in this collection.
Top
See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).Contains Method (String)

IniItemCollectionTContains Method (String)
Determines whether an item is in this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool Contains(
    string name
)
Public Function Contains (
    name As String
) As Boolean
public:
bool Contains(
    String^ name
)

Parameters

name
Type: SystemString
Name of the item to locate in this collection.

Return Value

Type: Boolean
if the item with specified name is in the collection.
See Also

Reference

IniItemCollectionT Class
Contains Overload


IniItemCollection(T).Contains Method (T)

IniItemCollectionTContains Method (T)
Determines whether an item is in this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool Contains(
    T item
)
Public Function Contains (
    item As T
) As Boolean
public:
virtual bool Contains(
    T item
) sealed

Parameters

item
Type: T
Item to locate in this collection.

Return Value

Type: Boolean
if the specified item is in the collection.

Implements

ICollectionTContains(T)
See Also

Reference

IniItemCollectionT Class
Contains Overload


IniItemCollection(T).CopyTo Method

IniItemCollectionTCopyTo Method
Shallow copies the items of this collection to an array.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void CopyTo(
    T[] array,
    int arrayIndex
)
Public Sub CopyTo (
    array As T(),
    arrayIndex As Integer
)
public:
virtual void CopyTo(
    array<T>^ array,
    int arrayIndex
) sealed

Parameters

array
Type: T
One-dimensional array that is the destination of the items copied from this collection.
arrayIndex
Type: SystemInt32
Zero-based index in array at which copying begins.

Implements

ICollectionTCopyTo(T, Int32)
See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).GetEnumerator Method

IniItemCollectionTGetEnumerator Method
Returns an enumerator that iterates through the collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IEnumerator<T> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of T)
public:
virtual IEnumerator<T>^ GetEnumerator() sealed

Return Value

Type: IEnumerator T
IEnumeratorT object that can be used to iterate through the collection.

Implements

IEnumerableTGetEnumerator
See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).IndexOf Method

IniItemCollectionTIndexOf Method
Overload List
 | Name | Description
Public method | IndexOf(String) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection.
Public method | IndexOf(T) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection.
Top
See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).IndexOf Method (String)

IniItemCollectionTIndexOf Method (String)
Searches for the specified item and returns the zero-based index of the first occurrence within this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public int IndexOf(
    string name
)
Public Function IndexOf (
    name As String
) As Integer
public:
int IndexOf(
    String^ name
)

Parameters

name
Type: SystemString
Name of the item to locate in this collection.

Return Value

Type: Int32
Index of the first occurrence of the item with specified name in the collection.
See Also

Reference

IniItemCollectionT Class
IndexOf Overload


IniItemCollection(T).IndexOf Method (T)

IniItemCollectionTIndexOf Method (T)
Searches for the specified item and returns the zero-based index of the first occurrence within this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public int IndexOf(
    T item
)
Public Function IndexOf (
    item As T
) As Integer
public:
virtual int IndexOf(
    T item
) sealed

Parameters

item
Type: T
Item to locate in this collection.

Return Value

Type: Int32
Index of the first occurrence of specified item in the collection.

Implements

IListTIndexOf(T)
See Also

Reference

IniItemCollectionT Class
IndexOf Overload


IniItemCollection(T).Insert Method

IniItemCollectionTInsert Method
Inserts an item to this collection at the specified index.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Insert(
    int index,
    T item
)
Public Sub Insert (
    index As Integer,
    item As T
)
public:
virtual void Insert(
    int index,
    T item
) sealed

Parameters

index
Type: SystemInt32
Zero-based index at which item should be inserted.
item
Type: T
Item to insert to this collection.

Implements

IListTInsert(Int32, T)
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not inserted.

See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).Remove Method

IniItemCollectionTRemove Method
Overload List
 | Name | Description
Public method | Remove(String) | Removes the first occurrence of specific item from this collection.
Public method | Remove(T) | Removes the first occurrence of specific item from this collection.
Top
See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).Remove Method (String)

IniItemCollectionTRemove Method (String)
Removes the first occurrence of specific item from this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool Remove(
    string name
)
Public Function Remove (
    name As String
) As Boolean
public:
bool Remove(
    String^ name
)

Parameters

name
Type: SystemString
Name of the item to remove from this collection.

Return Value

Type: Boolean
if the item with specified name is removed from the collection.
See Also

Reference

IniItemCollectionT Class
Remove Overload


IniItemCollection(T).Remove Method (T)

IniItemCollectionTRemove Method (T)
Removes the first occurrence of specific item from this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool Remove(
    T item
)
Public Function Remove (
    item As T
) As Boolean
public:
virtual bool Remove(
    T item
) sealed

Parameters

item
Type: T
Item to remove from this collection.

Return Value

Type: Boolean
if the specified item is removed from the collection.

Implements

ICollectionTRemove(T)
See Also

Reference

IniItemCollectionT Class
Remove Overload


IniItemCollection(T).RemoveAt Method

IniItemCollectionTRemoveAt Method
Removes an item at the specified index from this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void RemoveAt(
    int index
)
Public Sub RemoveAt (
    index As Integer
)
public:
virtual void RemoveAt(
    int index
) sealed

Parameters

index
Type: SystemInt32
Zero-based index at which item should be inserted.

Implements

IListTRemoveAt(Int32)
See Also

Reference

IniItemCollectionT Class


IniItemCollection(T) Properties

IniItemCollectionT Properties

The IniItemCollectionT generic type exposes the following members.

Properties
 | Name | Description
Public property | Count | Gets the number of items in this collection.
Public property | ItemInt32 | Gets or sets the item at the specified index.
Public property | ItemString | Gets the first item of the specified name.
Public property | ItemString | Gets the first items of the specified names.
Top
See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).Count Property

IniItemCollectionTCount Property
Gets the number of items in this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public int Count { get; }
Public ReadOnly Property Count As Integer
    Get
public:
virtual property int Count {
    int get () sealed;
}

Property Value

Type: Int32

Implements

ICollectionTCount
See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).Item Property

IniItemCollectionTItem Property
Overload List
 | Name | Description
Public property | ItemInt32 | Gets or sets the item at the specified index.
Public property | ItemString | Gets the first item of the specified name.
Public property | ItemString | Gets the first items of the specified names.
Top
See Also

Reference

IniItemCollectionT Class


IniItemCollection(T).Item Property (Int32)

IniItemCollectionTItem Property (Int32)
Gets or sets the item at the specified index.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public T this[
    int index
] { get; set; }
Public Default Property Item (
    index As Integer
) As T
    Get
    Set
public:
virtual property T default[int index] {
    T get (int index) sealed;
    void set (int index, T value) sealed;
}

Parameters

index
Type: SystemInt32
Zero-based index of the item to get or set.

Property Value

Type: T

Implements

IListTItemInt32
Remarks
If item duplicates are ignored and value is a duplicate item, has an existing name in this collection, then this value is ignored.
See Also

Reference

IniItemCollectionT Class
Item Overload


IniItemCollection(T).Item Property (String)

IniItemCollectionTItem Property (String)
Gets the first item of the specified name.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public T this[
    string name
] { get; }
Public ReadOnly Default Property Item (
    name As String
) As T
    Get
public:
property T default[String^ name] {
    T get (String^ name);
}

Parameters

name
Type: SystemString
Name of the item to get.

Property Value

Type: T
Remarks
If item with the specified name doesn't exist a value is returned.
See Also

Reference

IniItemCollectionT Class
Item Overload


IniItemCollection(T).Item Property (String[])

IniItemCollectionTItem Property (String)
Gets the first items of the specified names.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IEnumerable<T> this[
    params string[] names
] { get; }
Public ReadOnly Default Property Item (
    ParamArray names As String()
) As IEnumerable(Of T)
    Get
public:
property IEnumerable<T>^ default[... array<String^>^ names] {
    IEnumerable<T>^ get (... array<String^>^ names);
}

Parameters

names
Type: SystemString
Names of the items to get.

Property Value

Type: IEnumerable T
Remarks
If item with any specified name doesn't exist a value is returned in its place.
See Also

Reference

IniItemCollectionT Class
Item Overload


IniKey Class

IniKey Class
Represents a key item of the INI file with name and value content.
Inheritance Hierarchy
SystemObject
MadMilkman.IniIniItem
MadMilkman.IniIniKey

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public sealed class IniKey : IniItem
Public NotInheritable Class IniKey
    Inherits IniItem
public ref class IniKey sealed : public IniItem

The IniKey type exposes the following members.

Constructors
 | Name | Description
Public method | IniKey(IniFile, KeyValuePairString, String) | Initializes a new instance of the IniKey class.
Public method | IniKey(IniFile, String) | Initializes a new instance of the IniKey class.
Public method | IniKey(IniFile, String, String) | Initializes a new instance of the IniKey class.
Top
Methods
 | Name | Description
Public method | Copy | Copies this IniKey instance.
Public method | Copy(IniFile) | Copies this IniKey instance and sets copied instance's ParentFile.
 | IsSupportedValueType | Indicates whether the Value can be converted to specified type.
Public method | TryParseValueT(ListT) | Converts the Value to a list of the specified type.
Public method | TryParseValueT(T) | Converts the Value to an instance of the specified type.
Public method | TryParseValueT(T) | Converts the Value to an array of the specified type.
Top
Properties
 | Name | Description
Public property | LeadingComment | Gets the IniComment object that represents a comment that follows this IniItem on the same line. (Inherited from IniItem.)
Public property | LeftIndentation | Gets or sets the amount of whitespace characters before this item's name. (Inherited from IniItem.)
Public property | Name | Gets and sets the name of the current IniItem. (Inherited from IniItem.)
Public property | ParentCollection | Gets the IniKeyCollection to which this IniKey belongs to.
Public property | ParentFile | Gets the IniFile to which this IniItem belongs to. (Inherited from IniItem.)
Public property | ParentSection | Gets the IniSection to which this IniKey belongs to.
Public property | TrailingComment | Gets the IniComment object that represents a comments that occur before this IniItem. (Inherited from IniItem.)
Public property | Value | Gets and sets IniKey value.
Top
See Also

Reference

MadMilkman.Ini Namespace
Send comments on this topic to zorica.mario@rocketmail.com


IniKey Constructor

IniKey Constructor
Overload List
 | Name | Description
Public method | IniKey(IniFile, KeyValuePairString, String) | Initializes a new instance of the IniKey class.
Public method | IniKey(IniFile, String) | Initializes a new instance of the IniKey class.
Public method | IniKey(IniFile, String, String) | Initializes a new instance of the IniKey class.
Top
See Also

Reference

IniKey Class


IniKey Constructor (IniFile, KeyValuePair(String, String))

IniKey Constructor (IniFile, KeyValuePairString, String)
Initializes a new instance of the IniKey class.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey(
    IniFile parentFile,
    KeyValuePair<string, string> nameValuePair
)
Public Sub New (
    parentFile As IniFile,
    nameValuePair As KeyValuePair(Of String, String)
)
public:
IniKey(
    IniFile^ parentFile,
    KeyValuePair<String^, String^> nameValuePair
)

Parameters

parentFile
Type: MadMilkman.IniIniFile
The owner file.
nameValuePair
Type: System.Collections.GenericKeyValuePair String, String
The key's data, pair of key's name and key's value.
See Also

Reference

IniKey Class
IniKey Overload


IniKey Constructor (IniFile, String)

IniKey Constructor (IniFile, String)
Initializes a new instance of the IniKey class.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey(
    IniFile parentFile,
    string name
)
Public Sub New (
    parentFile As IniFile,
    name As String
)
public:
IniKey(
    IniFile^ parentFile,
    String^ name
)

Parameters

parentFile
Type: MadMilkman.IniIniFile
The owner file.
name
Type: SystemString
The key's name.
See Also

Reference

IniKey Class
IniKey Overload


IniKey Constructor (IniFile, String, String)

IniKey Constructor (IniFile, String, String)
Initializes a new instance of the IniKey class.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey(
    IniFile parentFile,
    string name,
    string value
)
Public Sub New (
    parentFile As IniFile,
    name As String,
    value As String
)
public:
IniKey(
    IniFile^ parentFile,
    String^ name,
    String^ value
)

Parameters

parentFile
Type: MadMilkman.IniIniFile
The owner file.
name
Type: SystemString
The key's name.
value
Type: SystemString
The key's value.
See Also

Reference

IniKey Class
IniKey Overload


IniKey Methods

IniKey Methods

The IniKey type exposes the following members.

Methods
 | Name | Description
Public method | Copy | Copies this IniKey instance.
Public method | Copy(IniFile) | Copies this IniKey instance and sets copied instance's ParentFile.
 | IsSupportedValueType | Indicates whether the Value can be converted to specified type.
Public method | TryParseValueT(ListT) | Converts the Value to a list of the specified type.
Public method | TryParseValueT(T) | Converts the Value to an instance of the specified type.
Public method | TryParseValueT(T) | Converts the Value to an array of the specified type.
Top
See Also

Reference

IniKey Class


IniKey.Copy Method

IniKeyCopy Method
Overload List
 | Name | Description
Public method | Copy | Copies this IniKey instance.
Public method | Copy(IniFile) | Copies this IniKey instance and sets copied instance's ParentFile.
Top
See Also

Reference

IniKey Class


IniKey.Copy Method

IniKeyCopy Method
Copies this IniKey instance.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey Copy()
Public Function Copy As IniKey
public:
IniKey^ Copy()

Return Value

Type: IniKey
Copied IniKey.
See Also

Reference

IniKey Class
Copy Overload
MadMilkman.Ini Namespace

Other Resources

IniItem's Copying


IniKey.Copy Method (IniFile)

IniKeyCopy Method (IniFile)
Copies this IniKey instance and sets copied instance's ParentFile.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey Copy(
    IniFile destinationFile
)
Public Function Copy (
    destinationFile As IniFile
) As IniKey
public:
IniKey^ Copy(
    IniFile^ destinationFile
)

Parameters

destinationFile
Type: MadMilkman.IniIniFile
Copied key's parent file.

Return Value

Type: IniKey
Copied IniKey that belongs to a specified IniFile.
See Also

Reference

IniKey Class
Copy Overload
MadMilkman.Ini Namespace

Other Resources

IniItem's Copying


IniKey.IsSupportedValueType Method

IniKeyIsSupportedValueType Method
Indicates whether the Value can be converted to specified type.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public static bool IsSupportedValueType(
    Type type
)
Public Shared Function IsSupportedValueType (
    type As Type
) As Boolean
public:
static bool IsSupportedValueType(
    Type^ type
)

Parameters

type
Type: SystemType
Type of the object to convert the Value to.

Return Value

Type: Boolean
if the specified type is supported.
Remarks
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.
See Also

Reference

IniKey Class


IniKey.TryParseValue Method

IniKeyTryParseValue Method
Overload List
 | Name | Description
Public method | TryParseValueT(ListT) | Converts the Value to a list of the specified type.
Public method | TryParseValueT(T) | Converts the Value to an instance of the specified type.
Public method | TryParseValueT(T) | Converts the Value to an array of the specified type.
Top
See Also

Reference

IniKey Class


IniKey.TryParseValue(T) Method (List(T))

IniKeyTryParseValueT Method (ListT)
Converts the Value to a list of the specified type.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool TryParseValue<T>(
    out List<T> results
)

Public Function TryParseValue(Of T) (
    <OutAttribute> ByRef results As List(Of T)
) As Boolean
public:
generic<typename T>
bool TryParseValue(
    [OutAttribute] List<T>^% results
)

Parameters

results
Type: System.Collections.GenericList T
Uninitialized list of a specific type which will hold the converted values if the conversion succeeds.

Type Parameters

T
Type of the objects in list to convert the Value to.

Return Value

Type: Boolean
Value that indicates whether the conversion succeeded.
Remarks

For supported types see the remarks of IsSupportedValueType(Type) method.

Mapped value results in ValueMappings have priority over parsing the value.

See Also

Reference

IniKey Class
TryParseValue Overload
MadMilkman.Ini Namespace

Other Resources

IniKey's Value Parsing


IniKey.TryParseValue(T) Method (T)

IniKeyTryParseValueT Method (T)
Converts the Value to an instance of the specified type.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool TryParseValue<T>(
    out T result
)

Public Function TryParseValue(Of T) (
    <OutAttribute> ByRef result As T
) As Boolean
public:
generic<typename T>
bool TryParseValue(
    [OutAttribute] T% result
)

Parameters

result
Type: T
Uninitialized instance of a specific type which will hold the converted value if the conversion succeeds.

Type Parameters

T
Type of the object to convert the Value to.

Return Value

Type: Boolean
Value that indicates whether the conversion succeeded.
Remarks

For supported types see the remarks of IsSupportedValueType(Type) method.

Mapped value results in ValueMappings have priority over parsing the value.

See Also

Reference

IniKey Class
TryParseValue Overload
MadMilkman.Ini Namespace

Other Resources

IniKey's Value Parsing


IniKey.TryParseValue(T) Method (T[])

IniKeyTryParseValueT Method (T)
Converts the Value to an array of the specified type.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool TryParseValue<T>(
    out T[] results
)

Public Function TryParseValue(Of T) (
    <OutAttribute> ByRef results As T()
) As Boolean
public:
generic<typename T>
bool TryParseValue(
    [OutAttribute] array<T>^% results
)

Parameters

results
Type: T
Uninitialized array of a specific type which will hold the converted values if the conversion succeeds.

Type Parameters

T
Type of the objects in array to convert the Value to.

Return Value

Type: Boolean
Value that indicates whether the conversion succeeded.
Remarks

For supported types see the remarks of IsSupportedValueType(Type) method.

Mapped value results in ValueMappings have priority over parsing the value.

See Also

Reference

IniKey Class
TryParseValue Overload
MadMilkman.Ini Namespace

Other Resources

IniKey's Value Parsing


IniKey Properties

IniKey Properties

The IniKey type exposes the following members.

Properties
 | Name | Description
Public property | LeadingComment | Gets the IniComment object that represents a comment that follows this IniItem on the same line. (Inherited from IniItem.)
Public property | LeftIndentation | Gets or sets the amount of whitespace characters before this item's name. (Inherited from IniItem.)
Public property | Name | Gets and sets the name of the current IniItem. (Inherited from IniItem.)
Public property | ParentCollection | Gets the IniKeyCollection to which this IniKey belongs to.
Public property | ParentFile | Gets the IniFile to which this IniItem belongs to. (Inherited from IniItem.)
Public property | ParentSection | Gets the IniSection to which this IniKey belongs to.
Public property | TrailingComment | Gets the IniComment object that represents a comments that occur before this IniItem. (Inherited from IniItem.)
Public property | Value | Gets and sets IniKey value.
Top
See Also

Reference

IniKey Class


IniKey.ParentCollection Property

IniKeyParentCollection Property
Gets the IniKeyCollection to which this IniKey belongs to.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKeyCollection ParentCollection { get; }
Public ReadOnly Property ParentCollection As IniKeyCollection
    Get
public:
property IniKeyCollection^ ParentCollection {
    IniKeyCollection^ get ();
}

Property Value

Type: IniKeyCollection
See Also

Reference

IniKey Class


IniKey.ParentSection Property

IniKeyParentSection Property
Gets the IniSection to which this IniKey belongs to.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSection ParentSection { get; }
Public ReadOnly Property ParentSection As IniSection
    Get
public:
property IniSection^ ParentSection {
    IniSection^ get ();
}

Property Value

Type: IniSection
See Also

Reference

IniKey Class


IniKey.Value Property

IniKeyValue Property
Gets and sets IniKey value.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public string Value { get; set; }
Public Property Value As String
    Get
    Set
public:
property String^ Value {
    String^ get ();
    void set (String^ value);
}

Property Value

Type: String
See Also

Reference

IniKey Class
MadMilkman.Ini Namespace

Other Resources

IniKey's Value Parsing
IniKey's Value Binding


IniKeyCollection Class

IniKeyCollection Class
Represents a collection of IniKey items.
Inheritance Hierarchy
SystemObject
MadMilkman.IniIniItemCollection IniKey
MadMilkman.IniIniKeyCollection

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public sealed class IniKeyCollection : IniItemCollection<IniKey>
Public NotInheritable Class IniKeyCollection
    Inherits IniItemCollection(Of IniKey)
public ref class IniKeyCollection sealed : public IniItemCollection<IniKey^>

The IniKeyCollection type exposes the following members.

Methods
 | Name | Description
Public method | Add(T) | Adds an item to the end of this collection. (Inherited from IniItemCollectionT.)
Public method | Add(KeyValuePairString, String) | Adds an item to the end of this collection.
Public method | Add(String) | Adds an item to the end of this collection.
Public method | Add(String, String) | Adds an item to the end of this collection.
Public method | Clear | Removes all items from this collection. (Inherited from IniItemCollectionT.)
Public method | Contains(String) | Determines whether an item is in this collection. (Inherited from IniItemCollectionT.)
Public method | Contains(T) | Determines whether an item is in this collection. (Inherited from IniItemCollectionT.)
Public method | CopyTo | Shallow copies the items of this collection to an array. (Inherited from IniItemCollectionT.)
Public method | GetEnumerator | Returns an enumerator that iterates through the collection. (Inherited from IniItemCollectionT.)
Public method | IndexOf(String) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection. (Inherited from IniItemCollectionT.)
Public method | IndexOf(T) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection. (Inherited from IniItemCollectionT.)
Public method | Insert(Int32, T) | Inserts an item to this collection at the specified index. (Inherited from IniItemCollectionT.)
Public method | Insert(Int32, KeyValuePairString, String) | Inserts an item to this collection at the specified index.
Public method | Insert(Int32, String) | Inserts an item to this collection at the specified index.
Public method | Insert(Int32, String, String) | Inserts an item to this collection at the specified index.
Public method | Remove(String) | Removes the first occurrence of specific item from this collection. (Inherited from IniItemCollectionT.)
Public method | Remove(T) | Removes the first occurrence of specific item from this collection. (Inherited from IniItemCollectionT.)
Public method | RemoveAt | Removes an item at the specified index from this collection. (Inherited from IniItemCollectionT.)
Top
Properties
 | Name | Description
Public property | Count | Gets the number of items in this collection. (Inherited from IniItemCollectionT.)
Public property | ItemInt32 | Gets or sets the item at the specified index. (Inherited from IniItemCollectionT.)
Public property | ItemString | Gets the first item of the specified name. (Inherited from IniItemCollectionT.)
Public property | ItemString | Gets the first items of the specified names. (Inherited from IniItemCollectionT.)
Top
See Also

Reference

MadMilkman.Ini Namespace
MadMilkman.IniIniKey


IniKeyCollection Methods

IniKeyCollection Methods

The IniKeyCollection type exposes the following members.

Methods
 | Name | Description
Public method | Add(T) | Adds an item to the end of this collection. (Inherited from IniItemCollectionT.)
Public method | Add(KeyValuePairString, String) | Adds an item to the end of this collection.
Public method | Add(String) | Adds an item to the end of this collection.
Public method | Add(String, String) | Adds an item to the end of this collection.
Public method | Clear | Removes all items from this collection. (Inherited from IniItemCollectionT.)
Public method | Contains(String) | Determines whether an item is in this collection. (Inherited from IniItemCollectionT.)
Public method | Contains(T) | Determines whether an item is in this collection. (Inherited from IniItemCollectionT.)
Public method | CopyTo | Shallow copies the items of this collection to an array. (Inherited from IniItemCollectionT.)
Public method | GetEnumerator | Returns an enumerator that iterates through the collection. (Inherited from IniItemCollectionT.)
Public method | IndexOf(String) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection. (Inherited from IniItemCollectionT.)
Public method | IndexOf(T) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection. (Inherited from IniItemCollectionT.)
Public method | Insert(Int32, T) | Inserts an item to this collection at the specified index. (Inherited from IniItemCollectionT.)
Public method | Insert(Int32, KeyValuePairString, String) | Inserts an item to this collection at the specified index.
Public method | Insert(Int32, String) | Inserts an item to this collection at the specified index.
Public method | Insert(Int32, String, String) | Inserts an item to this collection at the specified index.
Public method | Remove(String) | Removes the first occurrence of specific item from this collection. (Inherited from IniItemCollectionT.)
Public method | Remove(T) | Removes the first occurrence of specific item from this collection. (Inherited from IniItemCollectionT.)
Public method | RemoveAt | Removes an item at the specified index from this collection. (Inherited from IniItemCollectionT.)
Top
See Also

Reference

IniKeyCollection Class


IniKeyCollection.Add Method

IniKeyCollectionAdd Method
Overload List
 | Name | Description
Public method | Add(T) | Adds an item to the end of this collection. (Inherited from IniItemCollectionT.)
Public method | Add(KeyValuePairString, String) | Adds an item to the end of this collection.
Public method | Add(String) | Adds an item to the end of this collection.
Public method | Add(String, String) | Adds an item to the end of this collection.
Top
See Also

Reference

IniKeyCollection Class


IniKeyCollection.Add Method (KeyValuePair(String, String))

IniKeyCollectionAdd Method (KeyValuePairString, String)
Adds an item to the end of this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey Add(
    KeyValuePair<string, string> nameValuePair
)
Public Function Add (
    nameValuePair As KeyValuePair(Of String, String)
) As IniKey
public:
IniKey^ Add(
    KeyValuePair<String^, String^> nameValuePair
)

Parameters

nameValuePair
Type: System.Collections.GenericKeyValuePair String, String
The key's data, pair of key's name and key's value, to add to this collection.

Return Value

Type: IniKey
IniKey that was added to this collection.
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not added.

See Also

Reference

IniKeyCollection Class
Add Overload


IniKeyCollection.Add Method (String)

IniKeyCollectionAdd Method (String)
Adds an item to the end of this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey Add(
    string name
)
Public Function Add (
    name As String
) As IniKey
public:
IniKey^ Add(
    String^ name
)

Parameters

name
Type: SystemString
Name of the IniKey to add to this collection.

Return Value

Type: IniKey
IniKey that was added to this collection.
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not added.

See Also

Reference

IniKeyCollection Class
Add Overload


IniKeyCollection.Add Method (String, String)

IniKeyCollectionAdd Method (String, String)
Adds an item to the end of this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey Add(
    string name,
    string value
)
Public Function Add (
    name As String,
    value As String
) As IniKey
public:
IniKey^ Add(
    String^ name,
    String^ value
)

Parameters

name
Type: SystemString
Name of the IniKey to add to this collection.
value
Type: SystemString
Value of the IniKey to add to this collection.

Return Value

Type: IniKey
IniKey that was added to this collection.
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not added.

See Also

Reference

IniKeyCollection Class
Add Overload


IniKeyCollection.Insert Method

IniKeyCollectionInsert Method
Overload List
 | Name | Description
Public method | Insert(Int32, T) | Inserts an item to this collection at the specified index. (Inherited from IniItemCollectionT.)
Public method | Insert(Int32, KeyValuePairString, String) | Inserts an item to this collection at the specified index.
Public method | Insert(Int32, String) | Inserts an item to this collection at the specified index.
Public method | Insert(Int32, String, String) | Inserts an item to this collection at the specified index.
Top
See Also

Reference

IniKeyCollection Class


IniKeyCollection.Insert Method (Int32, KeyValuePair(String, String))

IniKeyCollectionInsert Method (Int32, KeyValuePairString, String)
Inserts an item to this collection at the specified index.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey Insert(
    int index,
    KeyValuePair<string, string> nameValuePair
)
Public Function Insert (
    index As Integer,
    nameValuePair As KeyValuePair(Of String, String)
) As IniKey
public:
IniKey^ Insert(
    int index,
    KeyValuePair<String^, String^> nameValuePair
)

Parameters

index
Type: SystemInt32
Zero-based index at which item should be inserted.
nameValuePair
Type: System.Collections.GenericKeyValuePair String, String
The key's data, pair of key's name and key's value, to insert to this collection.

Return Value

Type: IniKey
IniKey that was inserted to this collection.
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not inserted.

See Also

Reference

IniKeyCollection Class
Insert Overload


IniKeyCollection.Insert Method (Int32, String)

IniKeyCollectionInsert Method (Int32, String)
Inserts an item to this collection at the specified index.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey Insert(
    int index,
    string name
)
Public Function Insert (
    index As Integer,
    name As String
) As IniKey
public:
IniKey^ Insert(
    int index,
    String^ name
)

Parameters

index
Type: SystemInt32
Zero-based index at which item should be inserted.
name
Type: SystemString
Name of the IniKey to insert to this collection.

Return Value

Type: IniKey
IniKey that was inserted to this collection.
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not inserted.

See Also

Reference

IniKeyCollection Class
Insert Overload


IniKeyCollection.Insert Method (Int32, String, String)

IniKeyCollectionInsert Method (Int32, String, String)
Inserts an item to this collection at the specified index.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey Insert(
    int index,
    string name,
    string value
)
Public Function Insert (
    index As Integer,
    name As String,
    value As String
) As IniKey
public:
IniKey^ Insert(
    int index,
    String^ name,
    String^ value
)

Parameters

index
Type: SystemInt32
Zero-based index at which item should be inserted.
name
Type: SystemString
Name of the IniKey to insert to this collection.
value
Type: SystemString
Value of the IniKey to insert to this collection.

Return Value

Type: IniKey
IniKey that was inserted to this collection.
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not inserted.

See Also

Reference

IniKeyCollection Class
Insert Overload


IniKeyCollection Properties

IniKeyCollection Properties

The IniKeyCollection type exposes the following members.

Properties
 | Name | Description
Public property | Count | Gets the number of items in this collection. (Inherited from IniItemCollectionT.)
Public property | ItemInt32 | Gets or sets the item at the specified index. (Inherited from IniItemCollectionT.)
Public property | ItemString | Gets the first item of the specified name. (Inherited from IniItemCollectionT.)
Public property | ItemString | Gets the first items of the specified names. (Inherited from IniItemCollectionT.)
Top
See Also

Reference

IniKeyCollection Class


IniKeyDelimiter Enumeration

IniKeyDelimiter Enumeration
Defines key's name and value delimiter character.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public enum IniKeyDelimiter
Public Enumeration IniKeyDelimiter
public enum class IniKeyDelimiter
Members
Member name | Value | Description
Equal | 61 | Use '=' as key's name and value delimiter character.
Colon | 58 | Use ':' as key's name and value delimiter character.
See Also

Reference

MadMilkman.Ini Namespace
Send comments on this topic to zorica.mario@rocketmail.com


IniOptions Class

IniOptions Class
Represents a class that defines INI file's format, stores properties used for both reading and writing a file.
Inheritance Hierarchy
SystemObject
MadMilkman.IniIniOptions

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public sealed class IniOptions
Public NotInheritable Class IniOptions
public ref class IniOptions sealed

The IniOptions type exposes the following members.

Constructors
 | Name | Description
Public method | IniOptions | Initializes a new instance of the IniOptions class.
Top
Properties
 | Name | Description
Public property | CommentStarter | Gets or sets comments starting character.
Public property | Compression | Gets or sets a value indicating if file's size is reduced. If file is decompressed on Load and compressed on Save.
Public property | Encoding | Gets or sets encoding for reading and writing an INI file.
Public property | EncryptionPassword | Gets or sets an INI file's protection password. File is decrypted on Load and encrypted on Save if a password is not or Empty.
Public property | KeyDelimiter | Gets or sets keys name and value delimiter character.
Public property | KeyDuplicate | Gets or sets a value indicating whether keys with same name are allowed, disallowed or ignored.
Public property | KeyNameCaseSensitive | Gets or sets a value indicating whether keys name are case sensitive.
Public property | KeySpaceAroundDelimiter | Gets or sets a value indicating whether space is written around the keys delimiter.
Public property | SectionDuplicate | Gets or sets a value indicating whether sections with same name are allowed, disallowed or ignored.
Public property | SectionNameCaseSensitive | Gets or sets a value indicating whether sections name are case sensitive.
Public property | SectionWrapper | Gets or sets wrapper characters of sections name.
Top
Remarks

After an instance of this class is passed to an IniFile constructor, further changes on that instance's properties will have no effect.

Property | Default Value
CommentStarter | Semicolon
Compression |
EncryptionPassword |
Encoding | Encoding.ASCII
KeyDelimiter | Equal
KeyDuplicate | Allowed
KeyNameCaseSensitive |
KeySpaceAroundDelimiter |
SectionDuplicate | Allowed
SectionNameCaseSensitive |
SectionWrapper | SquareBrackets
See Also

Reference

MadMilkman.Ini Namespace
Send comments on this topic to zorica.mario@rocketmail.com


IniOptions Constructor

IniOptions Constructor
Initializes a new instance of the IniOptions class.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniOptions()
Public Sub New
public:
IniOptions()
See Also

Reference

IniOptions Class


IniOptions Properties

IniOptions Properties

The IniOptions type exposes the following members.

Properties
 | Name | Description
Public property | CommentStarter | Gets or sets comments starting character.
Public property | Compression | Gets or sets a value indicating if file's size is reduced. If file is decompressed on Load and compressed on Save.
Public property | Encoding | Gets or sets encoding for reading and writing an INI file.
Public property | EncryptionPassword | Gets or sets an INI file's protection password. File is decrypted on Load and encrypted on Save if a password is not or Empty.
Public property | KeyDelimiter | Gets or sets keys name and value delimiter character.
Public property | KeyDuplicate | Gets or sets a value indicating whether keys with same name are allowed, disallowed or ignored.
Public property | KeyNameCaseSensitive | Gets or sets a value indicating whether keys name are case sensitive.
Public property | KeySpaceAroundDelimiter | Gets or sets a value indicating whether space is written around the keys delimiter.
Public property | SectionDuplicate | Gets or sets a value indicating whether sections with same name are allowed, disallowed or ignored.
Public property | SectionNameCaseSensitive | Gets or sets a value indicating whether sections name are case sensitive.
Public property | SectionWrapper | Gets or sets wrapper characters of sections name.
Top
See Also

Reference

IniOptions Class


IniOptions.CommentStarter Property

IniOptionsCommentStarter Property
Gets or sets comments starting character.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniCommentStarter CommentStarter { get; set; }
Public Property CommentStarter As IniCommentStarter
    Get
    Set
public:
property IniCommentStarter CommentStarter {
    IniCommentStarter get ();
    void set (IniCommentStarter value);
}

Property Value

Type: IniCommentStarter
See Also

Reference

IniOptions Class


IniOptions.Compression Property

IniOptionsCompression Property

Gets or sets a value indicating if file's size is reduced.

If file is decompressed on Load and compressed on Save.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool Compression { get; set; }
Public Property Compression As Boolean
    Get
    Set
public:
property bool Compression {
    bool get ();
    void set (bool value);
}

Property Value

Type: Boolean
See Also

Reference

IniOptions Class


IniOptions.Encoding Property

IniOptionsEncoding Property
Gets or sets encoding for reading and writing an INI file.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public Encoding Encoding { get; set; }
Public Property Encoding As Encoding
    Get
    Set
public:
property Encoding^ Encoding {
    Encoding^ get ();
    void set (Encoding^ value);
}

Property Value

Type: Encoding
Remarks
Value should not be , if it is then a default Encoding.ASCII value will be used.
See Also

Reference

IniOptions Class


IniOptions.EncryptionPassword Property

IniOptionsEncryptionPassword Property

Gets or sets an INI file's protection password.

File is decrypted on Load and encrypted on Save if a password is not or Empty.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public string EncryptionPassword { get; set; }
Public Property EncryptionPassword As String
    Get
    Set
public:
property String^ EncryptionPassword {
    String^ get ();
    void set (String^ value);
}

Property Value

Type: String
See Also

Reference

IniOptions Class


IniOptions.KeyDelimiter Property

IniOptionsKeyDelimiter Property
Gets or sets keys name and value delimiter character.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKeyDelimiter KeyDelimiter { get; set; }
Public Property KeyDelimiter As IniKeyDelimiter
    Get
    Set
public:
property IniKeyDelimiter KeyDelimiter {
    IniKeyDelimiter get ();
    void set (IniKeyDelimiter value);
}

Property Value

Type: IniKeyDelimiter
See Also

Reference

IniOptions Class


IniOptions.KeyDuplicate Property

IniOptionsKeyDuplicate Property
Gets or sets a value indicating whether keys with same name are allowed, disallowed or ignored.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniDuplication KeyDuplicate { get; set; }
Public Property KeyDuplicate As IniDuplication
    Get
    Set
public:
property IniDuplication KeyDuplicate {
    IniDuplication get ();
    void set (IniDuplication value);
}

Property Value

Type: IniDuplication
See Also

Reference

IniOptions Class


IniOptions.KeyNameCaseSensitive Property

IniOptionsKeyNameCaseSensitive Property
Gets or sets a value indicating whether keys name are case sensitive.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool KeyNameCaseSensitive { get; set; }
Public Property KeyNameCaseSensitive As Boolean
    Get
    Set
public:
property bool KeyNameCaseSensitive {
    bool get ();
    void set (bool value);
}

Property Value

Type: Boolean
See Also

Reference

IniOptions Class


IniOptions.KeySpaceAroundDelimiter Property

IniOptionsKeySpaceAroundDelimiter Property
Gets or sets a value indicating whether space is written around the keys delimiter.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool KeySpaceAroundDelimiter { get; set; }
Public Property KeySpaceAroundDelimiter As Boolean
    Get
    Set
public:
property bool KeySpaceAroundDelimiter {
    bool get ();
    void set (bool value);
}

Property Value

Type: Boolean
See Also

Reference

IniOptions Class


IniOptions.SectionDuplicate Property

IniOptionsSectionDuplicate Property
Gets or sets a value indicating whether sections with same name are allowed, disallowed or ignored.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniDuplication SectionDuplicate { get; set; }
Public Property SectionDuplicate As IniDuplication
    Get
    Set
public:
property IniDuplication SectionDuplicate {
    IniDuplication get ();
    void set (IniDuplication value);
}

Property Value

Type: IniDuplication
See Also

Reference

IniOptions Class


IniOptions.SectionNameCaseSensitive Property

IniOptionsSectionNameCaseSensitive Property
Gets or sets a value indicating whether sections name are case sensitive.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool SectionNameCaseSensitive { get; set; }
Public Property SectionNameCaseSensitive As Boolean
    Get
    Set
public:
property bool SectionNameCaseSensitive {
    bool get ();
    void set (bool value);
}

Property Value

Type: Boolean
See Also

Reference

IniOptions Class


IniOptions.SectionWrapper Property

IniOptionsSectionWrapper Property
Gets or sets wrapper characters of sections name.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSectionWrapper SectionWrapper { get; set; }
Public Property SectionWrapper As IniSectionWrapper
    Get
    Set
public:
property IniSectionWrapper SectionWrapper {
    IniSectionWrapper get ();
    void set (IniSectionWrapper value);
}

Property Value

Type: IniSectionWrapper
See Also

Reference

IniOptions Class


IniSection Class

IniSection Class
Represents a section item of the INI file with name and keys content.
Inheritance Hierarchy
SystemObject
MadMilkman.IniIniItem
MadMilkman.IniIniSection

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public sealed class IniSection : IniItem
Public NotInheritable Class IniSection
    Inherits IniItem
public ref class IniSection sealed : public IniItem

The IniSection type exposes the following members.

Constructors
 | Name | Description
Public method | IniSection(IniFile, String) | Initializes a new instance of the IniSection class.
Public method | IniSection(IniFile, String, IniKey) | Initializes a new instance of the IniSection class.
Public method | IniSection(IniFile, String, IEnumerableIniKey) | Initializes a new instance of the IniSection class.
Public method | IniSection(IniFile, String, IEnumerableKeyValuePairString, String) | Initializes a new instance of the IniSection class.
Top
Methods
 | Name | Description
Public method | Copy | Copies this IniSection instance.
Public method | Copy(IniFile) | Copies this IniSection instance and sets copied instance's ParentFile.
Public method | DeserializeT | Deserializes this IniSection into an object of specified type.
Public method | SerializeT | Serializes the specified object into this IniSection.
Top
Fields
Name | Description
GlobalSectionName | 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.
Top
Properties
 | Name | Description
Public property | Keys | Gets the section's key collection.
Public property | LeadingComment | Gets the IniComment object that represents a comment that follows this IniItem on the same line. (Inherited from IniItem.)
Public property | LeftIndentation | Gets or sets the amount of whitespace characters before this item's name. (Inherited from IniItem.)
Public property | Name | Gets and sets the name of the current IniItem. (Inherited from IniItem.)
Public property | ParentCollection | Gets the IniSectionCollection to which this IniSection belongs to.
Public property | ParentFile | Gets the IniFile to which this IniItem belongs to. (Inherited from IniItem.)
Public property | TrailingComment | Gets the IniComment object that represents a comments that occur before this IniItem. (Inherited from IniItem.)
Top
See Also

Reference

MadMilkman.Ini Namespace
Send comments on this topic to zorica.mario@rocketmail.com


IniSection Constructor

IniSection Constructor
Overload List
 | Name | Description
Public method | IniSection(IniFile, String) | Initializes a new instance of the IniSection class.
Public method | IniSection(IniFile, String, IniKey) | Initializes a new instance of the IniSection class.
Public method | IniSection(IniFile, String, IEnumerableIniKey) | Initializes a new instance of the IniSection class.
Public method | IniSection(IniFile, String, IEnumerableKeyValuePairString, String) | Initializes a new instance of the IniSection class.
Top
See Also

Reference

IniSection Class


IniSection Constructor (IniFile, String)

IniSection Constructor (IniFile, String)
Initializes a new instance of the IniSection class.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSection(
    IniFile parentFile,
    string name
)
Public Sub New (
    parentFile As IniFile,
    name As String
)
public:
IniSection(
    IniFile^ parentFile,
    String^ name
)

Parameters

parentFile
Type: MadMilkman.IniIniFile
The owner file.
name
Type: SystemString
The section's name.
See Also

Reference

IniSection Class
IniSection Overload


IniSection Constructor (IniFile, String, IniKey[])

IniSection Constructor (IniFile, String, IniKey)
Initializes a new instance of the IniSection class.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSection(
    IniFile parentFile,
    string name,
    params IniKey[] keys
)
Public Sub New (
    parentFile As IniFile,
    name As String,
    ParamArray keys As IniKey()
)
public:
IniSection(
    IniFile^ parentFile,
    String^ name,
    ... array<IniKey^>^ keys
)

Parameters

parentFile
Type: MadMilkman.IniIniFile
The owner file.
name
Type: SystemString
The section's name.
keys
Type: MadMilkman.IniIniKey
The section's keys.
See Also

Reference

IniSection Class
IniSection Overload


IniSection Constructor (IniFile, String, IEnumerable(IniKey))

IniSection Constructor (IniFile, String, IEnumerableIniKey)
Initializes a new instance of the IniSection class.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSection(
    IniFile parentFile,
    string name,
    IEnumerable<IniKey> keys
)
Public Sub New (
    parentFile As IniFile,
    name As String,
    keys As IEnumerable(Of IniKey)
)
public:
IniSection(
    IniFile^ parentFile,
    String^ name,
    IEnumerable<IniKey^>^ keys
)

Parameters

parentFile
Type: MadMilkman.IniIniFile
The owner file.
name
Type: SystemString
The section's name.
keys
Type: System.Collections.GenericIEnumerable IniKey
The section's keys.
See Also

Reference

IniSection Class
IniSection Overload


IniSection Constructor (IniFile, String, IEnumerable(KeyValuePair(String, String)))

IniSection Constructor (IniFile, String, IEnumerableKeyValuePairString, String)
Initializes a new instance of the IniSection class.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSection(
    IniFile parentFile,
    string name,
    IEnumerable<KeyValuePair<string, string>> nameValuePairs
)
Public Sub New (
    parentFile As IniFile,
    name As String,
    nameValuePairs As IEnumerable(Of KeyValuePair(Of String, String))
)
public:
IniSection(
    IniFile^ parentFile,
    String^ name,
    IEnumerable<KeyValuePair<String^, String^>>^ nameValuePairs
)

Parameters

parentFile
Type: MadMilkman.IniIniFile
The owner file.
name
Type: SystemString
The section's name.
nameValuePairs
Type: System.Collections.GenericIEnumerable KeyValuePair String, String
The section's keys data, pairs of key's name and key's value.
See Also

Reference

IniSection Class
IniSection Overload


IniSection Fields

IniSection Fields

The IniSection type exposes the following members.

Fields
Name | Description
GlobalSectionName | 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.
Top
See Also

Reference

IniSection Class


IniSection.GlobalSectionName Field

IniSectionGlobalSectionName Field
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.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public const string GlobalSectionName
Public Const GlobalSectionName As String
public:
literal String^ GlobalSectionName

Field Value

Type: String
Remarks

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.

See Also

Reference

IniSection Class


IniSection Methods

IniSection Methods

The IniSection type exposes the following members.

Methods
 | Name | Description
Public method | Copy | Copies this IniSection instance.
Public method | Copy(IniFile) | Copies this IniSection instance and sets copied instance's ParentFile.
Public method | DeserializeT | Deserializes this IniSection into an object of specified type.
Public method | SerializeT | Serializes the specified object into this IniSection.
Top
See Also

Reference

IniSection Class


IniSection.Copy Method

IniSectionCopy Method
Overload List
 | Name | Description
Public method | Copy | Copies this IniSection instance.
Public method | Copy(IniFile) | Copies this IniSection instance and sets copied instance's ParentFile.
Top
See Also

Reference

IniSection Class


IniSection.Copy Method

IniSectionCopy Method
Copies this IniSection instance.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSection Copy()
Public Function Copy As IniSection
public:
IniSection^ Copy()

Return Value

Type: IniSection
Copied IniSection.
See Also

Reference

IniSection Class
Copy Overload
MadMilkman.Ini Namespace

Other Resources

IniItem's Copying


IniSection.Copy Method (IniFile)

IniSectionCopy Method (IniFile)
Copies this IniSection instance and sets copied instance's ParentFile.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSection Copy(
    IniFile destinationFile
)
Public Function Copy (
    destinationFile As IniFile
) As IniSection
public:
IniSection^ Copy(
    IniFile^ destinationFile
)

Parameters

destinationFile
Type: MadMilkman.IniIniFile
Copied section's parent file.

Return Value

Type: IniSection
Copied IniSection that belongs to a specified IniFile.
See Also

Reference

IniSection Class
Copy Overload
MadMilkman.Ini Namespace

Other Resources

IniItem's Copying


IniSection.Deserialize(T) Method

IniSectionDeserializeT Method
Deserializes this IniSection into an object of specified type.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public T Deserialize<T>()
where T : class, new()

Public Function Deserialize(Of T As {Class, New}) As T
public:
generic<typename T>
where T : ref class, gcnew()
T Deserialize()

Type Parameters

T
The type of deserialized object.

Return Value

Type: T
The object being deserialized.
See Also

Reference

IniSection Class
MadMilkman.Ini Namespace

Other Resources

IniSection's Object Serialization


IniSection.Serialize(T) Method

IniSectionSerializeT Method
Serializes the specified object into this IniSection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Serialize<T>(
    T source
)
where T : class, new()

Public Sub Serialize(Of T As {Class, New}) (
    source As T
)
public:
generic<typename T>
where T : ref class, gcnew()
void Serialize(
    T source
)

Parameters

source
Type: T
The object to serialize.

Type Parameters

T
The type of serialized object.
See Also

Reference

IniSection Class
MadMilkman.Ini Namespace

Other Resources

IniSection's Object Serialization


IniSection Properties

IniSection Properties

The IniSection type exposes the following members.

Properties
 | Name | Description
Public property | Keys | Gets the section's key collection.
Public property | LeadingComment | Gets the IniComment object that represents a comment that follows this IniItem on the same line. (Inherited from IniItem.)
Public property | LeftIndentation | Gets or sets the amount of whitespace characters before this item's name. (Inherited from IniItem.)
Public property | Name | Gets and sets the name of the current IniItem. (Inherited from IniItem.)
Public property | ParentCollection | Gets the IniSectionCollection to which this IniSection belongs to.
Public property | ParentFile | Gets the IniFile to which this IniItem belongs to. (Inherited from IniItem.)
Public property | TrailingComment | Gets the IniComment object that represents a comments that occur before this IniItem. (Inherited from IniItem.)
Top
See Also

Reference

IniSection Class


IniSection.Keys Property

IniSectionKeys Property
Gets the section's key collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKeyCollection Keys { get; }
Public ReadOnly Property Keys As IniKeyCollection
    Get
public:
property IniKeyCollection^ Keys {
    IniKeyCollection^ get ();
}

Property Value

Type: IniKeyCollection
See Also

Reference

IniSection Class


IniSection.ParentCollection Property

IniSectionParentCollection Property
Gets the IniSectionCollection to which this IniSection belongs to.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSectionCollection ParentCollection { get; }
Public ReadOnly Property ParentCollection As IniSectionCollection
    Get
public:
property IniSectionCollection^ ParentCollection {
    IniSectionCollection^ get ();
}

Property Value

Type: IniSectionCollection
See Also

Reference

IniSection Class


IniSectionCollection Class

IniSectionCollection Class
Represents a collection of IniSection items.
Inheritance Hierarchy
SystemObject
MadMilkman.IniIniItemCollection IniSection
MadMilkman.IniIniSectionCollection

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public sealed class IniSectionCollection : IniItemCollection<IniSection>
Public NotInheritable Class IniSectionCollection
    Inherits IniItemCollection(Of IniSection)
public ref class IniSectionCollection sealed : public IniItemCollection<IniSection^>

The IniSectionCollection type exposes the following members.

Methods
 | Name | Description
Public method | Add(T) | Adds an item to the end of this collection. (Inherited from IniItemCollectionT.)
Public method | Add(String) | Adds an item to the end of this collection.
Public method | Add(String, IEnumerableKeyValuePairString, String) | Adds an item to the end of this collection.
Public method | Clear | Removes all items from this collection. (Inherited from IniItemCollectionT.)
Public method | Contains(String) | Determines whether an item is in this collection. (Inherited from IniItemCollectionT.)
Public method | Contains(T) | Determines whether an item is in this collection. (Inherited from IniItemCollectionT.)
Public method | CopyTo | Shallow copies the items of this collection to an array. (Inherited from IniItemCollectionT.)
Public method | GetEnumerator | Returns an enumerator that iterates through the collection. (Inherited from IniItemCollectionT.)
Public method | IndexOf(String) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection. (Inherited from IniItemCollectionT.)
Public method | IndexOf(T) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection. (Inherited from IniItemCollectionT.)
Public method | Insert(Int32, T) | Inserts an item to this collection at the specified index. (Inherited from IniItemCollectionT.)
Public method | Insert(Int32, String) | Inserts an item to this collection at the specified index.
Public method | Insert(Int32, String, IEnumerableKeyValuePairString, String) | Inserts an item to this collection at the specified index.
Public method | Remove(String) | Removes the first occurrence of specific item from this collection. (Inherited from IniItemCollectionT.)
Public method | Remove(T) | Removes the first occurrence of specific item from this collection. (Inherited from IniItemCollectionT.)
Public method | RemoveAt | Removes an item at the specified index from this collection. (Inherited from IniItemCollectionT.)
Top
Properties
 | Name | Description
Public property | Count | Gets the number of items in this collection. (Inherited from IniItemCollectionT.)
Public property | ItemInt32 | Gets or sets the item at the specified index. (Inherited from IniItemCollectionT.)
Public property | ItemString | Gets the first item of the specified name. (Inherited from IniItemCollectionT.)
Public property | ItemString | Gets the first items of the specified names. (Inherited from IniItemCollectionT.)
Top
See Also

Reference

MadMilkman.Ini Namespace
MadMilkman.IniIniSection


IniSectionCollection Methods

IniSectionCollection Methods

The IniSectionCollection type exposes the following members.

Methods
 | Name | Description
Public method | Add(T) | Adds an item to the end of this collection. (Inherited from IniItemCollectionT.)
Public method | Add(String) | Adds an item to the end of this collection.
Public method | Add(String, IEnumerableKeyValuePairString, String) | Adds an item to the end of this collection.
Public method | Clear | Removes all items from this collection. (Inherited from IniItemCollectionT.)
Public method | Contains(String) | Determines whether an item is in this collection. (Inherited from IniItemCollectionT.)
Public method | Contains(T) | Determines whether an item is in this collection. (Inherited from IniItemCollectionT.)
Public method | CopyTo | Shallow copies the items of this collection to an array. (Inherited from IniItemCollectionT.)
Public method | GetEnumerator | Returns an enumerator that iterates through the collection. (Inherited from IniItemCollectionT.)
Public method | IndexOf(String) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection. (Inherited from IniItemCollectionT.)
Public method | IndexOf(T) | Searches for the specified item and returns the zero-based index of the first occurrence within this collection. (Inherited from IniItemCollectionT.)
Public method | Insert(Int32, T) | Inserts an item to this collection at the specified index. (Inherited from IniItemCollectionT.)
Public method | Insert(Int32, String) | Inserts an item to this collection at the specified index.
Public method | Insert(Int32, String, IEnumerableKeyValuePairString, String) | Inserts an item to this collection at the specified index.
Public method | Remove(String) | Removes the first occurrence of specific item from this collection. (Inherited from IniItemCollectionT.)
Public method | Remove(T) | Removes the first occurrence of specific item from this collection. (Inherited from IniItemCollectionT.)
Public method | RemoveAt | Removes an item at the specified index from this collection. (Inherited from IniItemCollectionT.)
Top
See Also

Reference

IniSectionCollection Class


IniSectionCollection.Add Method

IniSectionCollectionAdd Method
Overload List
 | Name | Description
Public method | Add(T) | Adds an item to the end of this collection. (Inherited from IniItemCollectionT.)
Public method | Add(String) | Adds an item to the end of this collection.
Public method | Add(String, IEnumerableKeyValuePairString, String) | Adds an item to the end of this collection.
Top
See Also

Reference

IniSectionCollection Class


IniSectionCollection.Add Method (String)

IniSectionCollectionAdd Method (String)
Adds an item to the end of this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSection Add(
    string name
)
Public Function Add (
    name As String
) As IniSection
public:
IniSection^ Add(
    String^ name
)

Parameters

name
Type: SystemString
Name of the IniSection to add to this collection.

Return Value

Type: IniSection
IniSection that was added to this collection.
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not added.

See Also

Reference

IniSectionCollection Class
Add Overload


IniSectionCollection.Add Method (String, IEnumerable(KeyValuePair(String, String)))

IniSectionCollectionAdd Method (String, IEnumerableKeyValuePairString, String)
Adds an item to the end of this collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSection Add(
    string name,
    IEnumerable<KeyValuePair<string, string>> nameValuePairs
)
Public Function Add (
    name As String,
    nameValuePairs As IEnumerable(Of KeyValuePair(Of String, String))
) As IniSection
public:
IniSection^ Add(
    String^ name,
    IEnumerable<KeyValuePair<String^, String^>>^ nameValuePairs
)

Parameters

name
Type: SystemString
Name of the IniSection to add to this collection.
nameValuePairs
Type: System.Collections.GenericIEnumerable KeyValuePair String, String
The section's keys data, pairs of key's name and key's value, to add to this collection.

Return Value

Type: IniSection
IniSection that was added to this collection.
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not added.

See Also

Reference

IniSectionCollection Class
Add Overload


IniSectionCollection.Insert Method

IniSectionCollectionInsert Method
Overload List
 | Name | Description
Public method | Insert(Int32, T) | Inserts an item to this collection at the specified index. (Inherited from IniItemCollectionT.)
Public method | Insert(Int32, String) | Inserts an item to this collection at the specified index.
Public method | Insert(Int32, String, IEnumerableKeyValuePairString, String) | Inserts an item to this collection at the specified index.
Top
See Also

Reference

IniSectionCollection Class


IniSectionCollection.Insert Method (Int32, String)

IniSectionCollectionInsert Method (Int32, String)
Inserts an item to this collection at the specified index.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSection Insert(
    int index,
    string name
)
Public Function Insert (
    index As Integer,
    name As String
) As IniSection
public:
IniSection^ Insert(
    int index,
    String^ name
)

Parameters

index
Type: SystemInt32
Zero-based index at which item should be inserted.
name
Type: SystemString
Name of the IniSection to insert to this collection.

Return Value

Type: IniSection
IniSection that was inserted to this collection.
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not inserted.

See Also

Reference

IniSectionCollection Class
Insert Overload


IniSectionCollection.Insert Method (Int32, String, IEnumerable(KeyValuePair(String, String)))

IniSectionCollectionInsert Method (Int32, String, IEnumerableKeyValuePairString, String)
Inserts an item to this collection at the specified index.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSection Insert(
    int index,
    string name,
    IEnumerable<KeyValuePair<string, string>> nameValuePairs
)
Public Function Insert (
    index As Integer,
    name As String,
    nameValuePairs As IEnumerable(Of KeyValuePair(Of String, String))
) As IniSection
public:
IniSection^ Insert(
    int index,
    String^ name,
    IEnumerable<KeyValuePair<String^, String^>>^ nameValuePairs
)

Parameters

index
Type: SystemInt32
Zero-based index at which item should be inserted.
name
Type: SystemString
Name of the IniSection to insert to this collection.
nameValuePairs
Type: System.Collections.GenericIEnumerable KeyValuePair String, String
The section's keys data, pairs of key's name and key's value, to insert to this collection.

Return Value

Type: IniSection
IniSection that was inserted to this collection.
Remarks

If item duplicates are ignored and this item is a duplicate, has an existing name in this collection, then it is not inserted.

See Also

Reference

IniSectionCollection Class
Insert Overload


IniSectionCollection Properties

IniSectionCollection Properties

The IniSectionCollection type exposes the following members.

Properties
 | Name | Description
Public property | Count | Gets the number of items in this collection. (Inherited from IniItemCollectionT.)
Public property | ItemInt32 | Gets or sets the item at the specified index. (Inherited from IniItemCollectionT.)
Public property | ItemString | Gets the first item of the specified name. (Inherited from IniItemCollectionT.)
Public property | ItemString | Gets the first items of the specified names. (Inherited from IniItemCollectionT.)
Top
See Also

Reference

IniSectionCollection Class


IniSectionWrapper Enumeration

IniSectionWrapper Enumeration
Defines section's wrapper characters around its name.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public enum IniSectionWrapper
Public Enumeration IniSectionWrapper
public enum class IniSectionWrapper
Members
Member name | Value | Description
SquareBrackets | 0 | Use '[' and ']' as section's wrapper characters.
AngleBrackets | 1 | Use '<' and '>' as section's wrapper characters.
CurlyBrackets | 2 | Use '{' and '}' as section's wrapper characters.
Parentheses | 3 | Use '(' and ')' as section's wrapper characters.
See Also

Reference

MadMilkman.Ini Namespace
Send comments on this topic to zorica.mario@rocketmail.com


IniSerializationAttribute Class

IniSerializationAttribute Class
Indicates the behavior of public property when serializing or deserializing the object that contains it.
Inheritance Hierarchy
SystemObject
SystemAttribute
MadMilkman.IniIniSerializationAttribute

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public sealed class IniSerializationAttribute : Attribute
Public NotInheritable Class IniSerializationAttribute
    Inherits Attribute
public ref class IniSerializationAttribute sealed : public Attribute

The IniSerializationAttribute type exposes the following members.

Constructors
 | Name | Description
Public method | IniSerializationAttribute(Boolean) | Initializes a new instance of the IniSerializationAttribute class and specifies if serialization is ignored.
Public method | IniSerializationAttribute(String) | Initializes a new instance of the IniSerializationAttribute class and specifies the IniKey's name.
Top
Properties
 | Name | Description
Public property | Alias | Gets the IniKey name of serialized the property.
Public property | Ignore | Gets the value indicating whether serialization is ignored.
Top
See Also

Reference

MadMilkman.Ini Namespace
Send comments on this topic to zorica.mario@rocketmail.com


IniSerializationAttribute Constructor

IniSerializationAttribute Constructor
Overload List
 | Name | Description
Public method | IniSerializationAttribute(Boolean) | Initializes a new instance of the IniSerializationAttribute class and specifies if serialization is ignored.
Public method | IniSerializationAttribute(String) | Initializes a new instance of the IniSerializationAttribute class and specifies the IniKey's name.
Top
See Also

Reference

IniSerializationAttribute Class


IniSerializationAttribute Constructor (Boolean)

IniSerializationAttribute Constructor (Boolean)
Initializes a new instance of the IniSerializationAttribute class and specifies if serialization is ignored.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSerializationAttribute(
    bool ignore
)
Public Sub New (
    ignore As Boolean
)
public:
IniSerializationAttribute(
    bool ignore
)

Parameters

ignore
Type: SystemBoolean
The value indicating whether serialization is ignored.
See Also

Reference

IniSerializationAttribute Class
IniSerializationAttribute Overload


IniSerializationAttribute Constructor (String)

IniSerializationAttribute Constructor (String)
Initializes a new instance of the IniSerializationAttribute class and specifies the IniKey's name.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniSerializationAttribute(
    string alias
)
Public Sub New (
    alias As String
)
public:
IniSerializationAttribute(
    String^ alias
)

Parameters

alias
Type: SystemString
The name of the generated IniKey.
See Also

Reference

IniSerializationAttribute Class
IniSerializationAttribute Overload


IniSerializationAttribute Properties

IniSerializationAttribute Properties

The IniSerializationAttribute type exposes the following members.

Properties
 | Name | Description
Public property | Alias | Gets the IniKey name of serialized the property.
Public property | Ignore | Gets the value indicating whether serialization is ignored.
Top
See Also

Reference

IniSerializationAttribute Class


IniSerializationAttribute.Alias Property

IniSerializationAttributeAlias Property
Gets the IniKey name of serialized the property.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public string Alias { get; }
Public ReadOnly Property Alias As String
    Get
public:
property String^ Alias {
    String^ get ();
}

Property Value

Type: String
See Also

Reference

IniSerializationAttribute Class


IniSerializationAttribute.Ignore Property

IniSerializationAttributeIgnore Property
Gets the value indicating whether serialization is ignored.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool Ignore { get; }
Public ReadOnly Property Ignore As Boolean
    Get
public:
property bool Ignore {
    bool get ();
}

Property Value

Type: Boolean
See Also

Reference

IniSerializationAttribute Class


IniValueBinding Class

IniValueBinding Class
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.
Inheritance Hierarchy
SystemObject
MadMilkman.IniIniValueBinding

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public sealed class IniValueBinding
Public NotInheritable Class IniValueBinding
public ref class IniValueBinding sealed

The IniValueBinding type exposes the following members.

Methods
 | Name | Description
Public method | Bind | Executes a binding operation with internal data source.
Public method | Bind(Object) | Executes a binding operation with external data source.
Public method | Bind(Object, String) | Executes a binding operation with external data source, only on specified section.
Top
Events
 | Name | Description
Public event | Binding | Occurs when a placeholder is binding with data source value and can be used to customize the binding operation.
Top
Remarks

IniValueBinding can be accessed through ValueBinding property.

Binding can be executed with internal data source or with a provided external data source.

For more information see IniKey's Value Binding.

See Also

Reference

MadMilkman.Ini Namespace

Other Resources

IniKey's Value Binding


IniValueBinding Methods

IniValueBinding Methods
Methods
 | Name | Description
Public method | Bind | Executes a binding operation with internal data source.
Public method | Bind(Object) | Executes a binding operation with external data source.
Public method | Bind(Object, String) | Executes a binding operation with external data source, only on specified section.
Top
See Also

Reference

IniValueBinding Class


IniValueBinding.Bind Method

IniValueBindingBind Method
Overload List
 | Name | Description
Public method | Bind | Executes a binding operation with internal data source.
Public method | Bind(Object) | Executes a binding operation with external data source.
Public method | Bind(Object, String) | Executes a binding operation with external data source, only on specified section.
Top
See Also

Reference

IniValueBinding Class


IniValueBinding.Bind Method

IniValueBindingBind Method
Executes a binding operation with internal data source.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Bind()
Public Sub Bind
public:
void Bind()
See Also

Reference

IniValueBinding Class
Bind Overload
MadMilkman.Ini Namespace

Other Resources

IniKey's Value Binding


IniValueBinding.Bind Method (Object)

IniValueBindingBind Method (Object)
Executes a binding operation with external data source.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Bind(
    Object dataSource
)
Public Sub Bind (
    dataSource As Object
)
public:
void Bind(
    Object^ dataSource
)

Parameters

dataSource
Type: SystemObject
The binding data source.
See Also

Reference

IniValueBinding Class
Bind Overload
MadMilkman.Ini Namespace

Other Resources

IniKey's Value Binding


IniValueBinding.Bind Method (Object, String)

IniValueBindingBind Method (Object, String)
Executes a binding operation with external data source, only on specified section.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Bind(
    Object dataSource,
    string sectionName
)
Public Sub Bind (
    dataSource As Object,
    sectionName As String
)
public:
void Bind(
    Object^ dataSource,
    String^ sectionName
)

Parameters

dataSource
Type: SystemObject
The binding data source.
sectionName
Type: SystemString
The IniSection's name.
See Also

Reference

IniValueBinding Class
Bind Overload
MadMilkman.Ini Namespace

Other Resources

IniKey's Value Binding


IniValueBinding Events

IniValueBinding Events

The IniValueBinding type exposes the following members.

Events
 | Name | Description
Public event | Binding | Occurs when a placeholder is binding with data source value and can be used to customize the binding operation.
Top
See Also

Reference

IniValueBinding Class


IniValueBinding.Binding Event

IniValueBindingBinding Event
Occurs when a placeholder is binding with data source value and can be used to customize the binding operation.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public event EventHandler<IniValueBindingEventArgs> Binding
Public Event Binding As EventHandler(Of IniValueBindingEventArgs)
public:
 event EventHandler<IniValueBindingEventArgs^>^ Binding {
    void add (EventHandler<IniValueBindingEventArgs^>^ value);
    void remove (EventHandler<IniValueBindingEventArgs^>^ value);
}

Value

Type: SystemEventHandler IniValueBindingEventArgs
See Also

Reference

IniValueBinding Class


IniValueBindingEventArgs Class

IniValueBindingEventArgs Class
Provides data for Binding event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
MadMilkman.IniIniValueBindingEventArgs

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public sealed class IniValueBindingEventArgs : EventArgs
Public NotInheritable Class IniValueBindingEventArgs
    Inherits EventArgs
public ref class IniValueBindingEventArgs sealed : public EventArgs

The IniValueBindingEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | IsValueFound | Gets a value indicating whether value was found in the data source.
Public property | PlaceholderKey | Gets the placeholder's IniKey.
Public property | PlaceholderName | Gets the placeholder's name.
Public property | Value | Gets or sets the data source value that will replace the placeholder.
Top
See Also

Reference

MadMilkman.Ini Namespace
Send comments on this topic to zorica.mario@rocketmail.com


IniValueBindingEventArgs Properties

IniValueBindingEventArgs Properties

The IniValueBindingEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | IsValueFound | Gets a value indicating whether value was found in the data source.
Public property | PlaceholderKey | Gets the placeholder's IniKey.
Public property | PlaceholderName | Gets the placeholder's name.
Public property | Value | Gets or sets the data source value that will replace the placeholder.
Top
See Also

Reference

IniValueBindingEventArgs Class


IniValueBindingEventArgs.IsValueFound Property

IniValueBindingEventArgsIsValueFound Property
Gets a value indicating whether value was found in the data source.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool IsValueFound { get; }
Public ReadOnly Property IsValueFound As Boolean
    Get
public:
property bool IsValueFound {
    bool get ();
}

Property Value

Type: Boolean
if value was found in the data source.
See Also

Reference

IniValueBindingEventArgs Class


IniValueBindingEventArgs.PlaceholderKey Property

IniValueBindingEventArgsPlaceholderKey Property
Gets the placeholder's IniKey.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public IniKey PlaceholderKey { get; }
Public ReadOnly Property PlaceholderKey As IniKey
    Get
public:
property IniKey^ PlaceholderKey {
    IniKey^ get ();
}

Property Value

Type: IniKey
See Also

Reference

IniValueBindingEventArgs Class


IniValueBindingEventArgs.PlaceholderName Property

IniValueBindingEventArgsPlaceholderName Property
Gets the placeholder's name.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public string PlaceholderName { get; }
Public ReadOnly Property PlaceholderName As String
    Get
public:
property String^ PlaceholderName {
    String^ get ();
}

Property Value

Type: String
See Also

Reference

IniValueBindingEventArgs Class


IniValueBindingEventArgs.Value Property

IniValueBindingEventArgsValue Property
Gets or sets the data source value that will replace the placeholder.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public string Value { get; set; }
Public Property Value As String
    Get
    Set
public:
property String^ Value {
    String^ get ();
    void set (String^ value);
}

Property Value

Type: String
The data source value that will replace the placeholder, if it's not .
See Also

Reference

IniValueBindingEventArgs Class


IniValueMappings Class

IniValueMappings Class
Represents a class of mapped Values and their results, used in TryParseValue Overload methods.
Inheritance Hierarchy
SystemObject
MadMilkman.IniIniValueMappings

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public sealed class IniValueMappings
Public NotInheritable Class IniValueMappings
public ref class IniValueMappings sealed

The IniValueMappings type exposes the following members.

Methods
 | Name | Description
Public method | AddT | Adds a new mapping of Value to resulting object of parse methods.
Public method | Contains | Determines whether the collection contains a mapping for a specified key's value.
Public method | Remove | Removes a mapping for a specified key's value in the collection.
Top
Remarks

IniValueMappings can be accessed through ValueMappings property.

Mapped value results have priority over parsing the value.

For more information see IniKey's Value Parsing.

See Also

Reference

MadMilkman.Ini Namespace

Other Resources

IniKey's Value Parsing


IniValueMappings Methods

IniValueMappings Methods

The IniValueMappings type exposes the following members.

Methods
 | Name | Description
Public method | AddT | Adds a new mapping of Value to resulting object of parse methods.
Public method | Contains | Determines whether the collection contains a mapping for a specified key's value.
Public method | Remove | Removes a mapping for a specified key's value in the collection.
Top
See Also

Reference

IniValueMappings Class


IniValueMappings.Add(T) Method

IniValueMappingsAddT Method
Adds a new mapping of Value to resulting object of parse methods.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public void Add<T>(
    string value,
    T mappedResult
)

Public Sub Add(Of T) (
    value As String,
    mappedResult As T
)
public:
generic<typename T>
void Add(
    String^ value,
    T mappedResult
)

Parameters

value
Type: SystemString
The key's value.
mappedResult
Type: T
The object that represents parsed Value.

Type Parameters

T
Type of the object that represents parsed Value.
Remarks

The key's value cannot be .

The mapped result's type must be one of the supported types for parsing, see the remarks of IsSupportedValueType(Type) method.

Collection cannot contain multiple entries of same key's value, value comparison is case-insensitive.

See Also

Reference

IniValueMappings Class


IniValueMappings.Contains Method

IniValueMappingsContains Method
Determines whether the collection contains a mapping for a specified key's value.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool Contains(
    string value
)
Public Function Contains (
    value As String
) As Boolean
public:
bool Contains(
    String^ value
)

Parameters

value
Type: SystemString
The key's value to locate in the collection.

Return Value

Type: Boolean
if the collection contains a mapping for a specified key's value.
See Also

Reference

IniValueMappings Class


IniValueMappings.Remove Method

IniValueMappingsRemove Method
Removes a mapping for a specified key's value in the collection.

Namespace: MadMilkman.Ini
Assembly: MadMilkman.Ini (in MadMilkman.Ini.dll) Version: 1.0.6.0
Syntax
C#
VB
C++
Copy
public bool Remove(
    string value
)
Public Function Remove (
    value As String
) As Boolean
public:
bool Remove(
    String^ value
)

Parameters

value
Type: SystemString
The key's value to remove in the collection.

Return Value

Type: Boolean
if a mapping for a specified key's value is successfully found and removed.
See Also

Reference

IniValueMappings Class