{"action":"published","release":{"url":"https://api.github.com/repos/e-lefort/CSharpIniFileSerializer/releases/1804931","assets_url":"https://api.github.com/repos/e-lefort/CSharpIniFileSerializer/releases/1804931/assets","upload_url":"https://uploads.github.com/repos/e-lefort/CSharpIniFileSerializer/releases/1804931/assets{?name,label}","html_url":"https://github.com/e-lefort/CSharpIniFileSerializer/releases/tag/v2.0.0","id":1804931,"tag_name":"v2.0.0","target_commitish":"master","name":"CSharpIniFileSerializer v2.0.0","draft":false,"author":{"login":"e-lefort","id":5994007,"avatar_url":"https://avatars.githubusercontent.com/u/5994007?v=3","gravatar_id":"","url":"https://api.github.com/users/e-lefort","html_url":"https://github.com/e-lefort","followers_url":"https://api.github.com/users/e-lefort/followers","following_url":"https://api.github.com/users/e-lefort/following{/other_user}","gists_url":"https://api.github.com/users/e-lefort/gists{/gist_id}","starred_url":"https://api.github.com/users/e-lefort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-lefort/subscriptions","organizations_url":"https://api.github.com/users/e-lefort/orgs","repos_url":"https://api.github.com/users/e-lefort/repos","events_url":"https://api.github.com/users/e-lefort/events{/privacy}","received_events_url":"https://api.github.com/users/e-lefort/received_events","type":"User","site_admin":false},"prerelease":true,"created_at":"2015-09-12T22:20:24Z","published_at":"2015-09-12T22:21:53Z","assets":[],"tarball_url":"https://api.github.com/repos/e-lefort/CSharpIniFileSerializer/tarball/v2.0.0","zipball_url":"https://api.github.com/repos/e-lefort/CSharpIniFileSerializer/zipball/v2.0.0","body":"# C# INI File Serializer\r\nCSharpIniFileSerializer is a .NET Serializer for INI File. It use reflection to serialize/deserialize fields or/and properties of the given class.\r\nSection names and field names are fully customisable with Attributes.\r\n# Getting Started\r\n## Simple example\r\n```csharp\r\nclass MyClass\r\n{\r\n\t[IniSectionName(\"GLOBAL\")]\r\n\tstring m_DisplayString;\r\n\tpublic string DisplayString\r\n\t{\r\n\t\tget { return m_DisplayString; }\r\n\t\tset { m_DisplayString = value; }\r\n\t}\r\n\t[IniSectionName(\"GLOBAL\")]\r\n\t[IniFieldName(\"MyCustomName\")]\r\n\tdouble m_DisplayDouble;\r\n\tpublic double DisplayDouble\r\n\t{\r\n\t\tget { return m_DisplayDouble; }\r\n\t\tset { m_DisplayDouble = value; }\r\n\t}\r\n}\r\n```\r\nOutput result (.ini)\r\n``` ini\r\n[GLOBAL]\r\nm_DisplayString=Hello World\r\nMyCustomName=0.42\r\n```\r\n## Attributes\r\n| Attribute        \t\t\t\t\t\t| Description   \t\t|\r\n| -------------------------------------------------------------\t| -----------------------------\t|\r\n| ``` [IniSectionName(\"GLOBAL\") ```\t\t\t\t| change default section name\t|\r\n| ``` [IniFieldName(\"DisplayBool\")] ```\t\t\t\t| change default field name\t|\r\n| ``` [IniArrayDelimiter(ArrayDelimiter.Underscore)] ```\t| set array delimite\t\t|\r\n| ``` [IniArrayType(ArrayType.Section)] ```\t\t\t| set array format      \t|\r\n| ``` [IniIgnore] ```\t\t\t\t\t\t| ignore field or property\t|\r\n| ``` [IniDefaultValue(\"0.25\")] ```\t\t\t\t| set default value      \t|\r\n\r\n## Read from INI File\r\n```csharp\r\nMyClass obj = new MyClass();\r\nusing (StreamReader sr = new StreamReader(\r\n\tPath.Combine(Directory.GetCurrentDirectory(), \"settings.ini\"), true))\r\n{\r\n\tIniReader reader = new IniReader();\r\n\treader.Deserialize<MyClass>(ref obj, sr);\r\n}\r\n```\r\n## Write to INI File\r\n```csharp\r\nIniWriter writer = new IniWriter();\r\nwriter.Serialize<MyClass>(obj, \r\n\tPath.Combine(Directory.GetCurrentDirectory(), \"settings.ini\"));\r\n```\r\n# Supported Type\r\n- Generic types (string, char, short, int, long, float, double, bool, Enum, Color, Date)\r\n- Array and IList\r\n\r\n# Advanced serialization (depth)\r\n```csharp\r\npublic class Person\r\n{\r\n    public string FirstName { get; set; }\r\n    public string LastName { get; set; }\r\n    public DateTime DateOfBirth { get; set; }\r\n}\r\n\r\npublic class GroupOfPerson\r\n{\r\n    [IniArrayType(ArrayType.Section)]\r\n    public List<Person> Persons { get; set; }\r\n\r\n    public GroupOfPerson()\r\n    {\r\n        this.Persons = new List<Person>();\r\n    }\r\n}\r\n\r\nstatic void Main(string[] args)\r\n{\r\n\tGroupOfPerson gop = new GroupOfPerson();\r\n\tgop.Persons.Add(new Person() \r\n\t{ \r\n\t\tFirstName = \"Alice\", \r\n\t\tLastName = \"Cooper\", \r\n\t\tDateOfBirth = DateTime.Parse(\"4/02/1948\") \r\n\t});\r\n\tgop.Persons.Add(new Person() \r\n\t{ \r\n\t\tFirstName = \"Marilyin\", \r\n\t\tLastName = \"Manson\", \r\n\t\tDateOfBirth = DateTime.Parse(\"5/01/1969\") \r\n\t});\r\n\t\r\n\tIniWriter writer = new IniWriter();\r\n\twriter.settings = new IniSettings() { DefaultTypeInfo = TypeInfo.Properties };\r\n\twriter.Serialize<GroupOfPerson>(gop, \r\n\t\tPath.Combine(Directory.GetCurrentDirectory(), \"settings.ini\"));\r\n}\r\n```\r\n``` ini\r\n[GroupOfPerson:0/Person]\r\nFirstName = Alice\r\nLastName = Cooper\r\nDateOfBirth = 04/02/1948 00:00:00\r\n[GroupOfPerson:1/Person]\r\nFirstName = Marilyin\r\nLastName = Manson\r\nDateOfBirth = 05/01/1969 00:00:00\r\n```\r\n"}}