Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Ini Classifier
Ini Classifier

Ini Classifier

Miroslav Makhruk

|
1,036 installs
| (0) | Free
Generates a C# class with static string properties out of .ini file sections. Does it automatically for all .ini files in a solution.
Download

Generates a C# class with public static properties out of .ini file sections.
Creates new <INIFILENAME>.cs file for each .ini file.
It means if you have a Translations.ini file a new Translations.cs file will be created and added to your project.

E.g.

.ini file (Translations.ini) content:

INI
Edit|Remove
ini
[First name] eng=First name rus=Имя  [Last name] eng=Last name rus=Фамилия
[First name]  eng=First name  rus=Имя    [Last name]  eng=Last name  rus=Фамилия
 .cs file (Translations.cs) created after running the Ini Classifier tool:
C#
Edit|Remove
csharp
namespace MMINI {          public class Translations     {         public const string FIRST_NAME = "First name";         public const string LAST_NAME = "Last name";     } }
namespace MMINI  {            public class Translations      {          public const string FIRST_NAME = "First name";          public const string LAST_NAME = "Last name";      }  }
 .cs file (Translations.cs) created after running the Ini Classifier tool in Advanced Mode:
C#
Edit|Remove
csharp
namespace MMINI {          // Created out of '\inis\Translations.ini'     public class Translations     {         public const string SOURCE_INI_FILE = "C:\\Users\\never_again\\Documents" +             "\\Visual Studio 2015" +             "\\Projects\\Demo\\inis\\Translations.ini";         public class FIRST_NAME         {             public const string Value = "First name";             public class Keys             {                 public const string ENG = "eng";                 public const string RUS = "rus";             }         }         public class LAST_NAME         {             public const string Value = "Last name";             public class Keys             {                 public const string ENG = "eng";                 public const string RUS = "rus";             }         }     } }
namespace MMINI  {            // Created out of '\inis\Translations.ini'      public class Translations      {          public const string SOURCE_INI_FILE = "C:\\Users\\never_again\\Documents" +              "\\Visual Studio 2015" +              "\\Projects\\Demo\\inis\\Translations.ini";          public class FIRST_NAME          {              public const string Value = "First name";              public class Keys              {                  public const string ENG = "eng";                  public const string RUS = "rus";              }          }          public class LAST_NAME          {              public const string Value = "Last name";              public class Keys              {                  public const string ENG = "eng";                  public const string RUS = "rus";              }          }      }  }
 
And the usage is:
C#
Edit|Remove
csharp
void GetNames() {     string rusFName = ReadINI(MMINI.Translations.FIRST_NAME,"rus");     string engFName = ReadINI(MMINI.Translations.FIRST_NAME,"eng");     string rusLName = ReadINI(MMINI.Translations.LAST_NAME,"rus");     string engLName = ReadINI(MMINI.Translations.LAST_NAME,"eng"); } 
void GetNames()  {      string rusFName = ReadINI(MMINI.Translations.FIRST_NAME,"rus");      string engFName = ReadINI(MMINI.Translations.FIRST_NAME,"eng");      string rusLName = ReadINI(MMINI.Translations.LAST_NAME,"rus");      string engLName = ReadINI(MMINI.Translations.LAST_NAME,"eng");  }  
And the usage in Advanced mode is:
C#
Edit|Remove
csharp
void GetNames()  {      string rusFName = ReadINI(MMINI.Translations.FIRST_NAME.Value,                               MMINI.Translations.FIRST_NAME.Keys.RUS);      string engFName = ReadINI(MMINI.Translations.FIRST_NAME.Value,                               MMINI.Translations.FIRST_NAME.Keys.ENG);      string rusLName = ReadINI(MMINI.Translations.LAST_NAME.Value,                               MMINI.Translations.LAST_NAME.Keys.RUS);      string engLName = ReadINI(MMINI.Translations.LAST_NAME.Value,                               MMINI.Translations.LAST_NAME.Keys.ENG);  } 
void GetNames()   {       string rusFName = ReadINI(MMINI.Translations.FIRST_NAME.Value,                                MMINI.Translations.FIRST_NAME.Keys.RUS);       string engFName = ReadINI(MMINI.Translations.FIRST_NAME.Value,                                MMINI.Translations.FIRST_NAME.Keys.ENG);       string rusLName = ReadINI(MMINI.Translations.LAST_NAME.Value,                                MMINI.Translations.LAST_NAME.Keys.RUS);       string engLName = ReadINI(MMINI.Translations.LAST_NAME.Value,                                MMINI.Translations.LAST_NAME.Keys.ENG);   } 
Changes to version 1.3.5
1) Added support for vs2017

Changes to version 1.3.4
1) Added option to create camel case properties

Changes to version 1.3.3
1) Now you can run the tool on a single .ini file by opening and saving the .ini file.
 
Changes to version 1.3.2
1) Duplicates are now being logged to "Warnings" tab in "Error List" window.
2) By default the tool only works on an active project instead of on a whole solution (can be changed in Options)
3) Changed Options groups.
4) Encoding bug fixed.
 
Changes to version 1.3.1:
1) Added link to "More information" 
 
Changes to version 1.3.0:
1) Added "Advanced mode".
2) Added "GenerateIniInteractionClass" property to options. When set to TRUE generates a class with static properties to read/write .ini files.
3) Added "IniInteractionClassName" property to options. Defines name of the Ini Interaction class. Default is "INI"
 
Changes to version 1.2.3:
1) If exists a .CS file created by user, it doesn't get overwritten. The tool creates a .cs file with a slightly changed name instead.
 
Changes to version 1.2.2:
1) A few bug fixex
 
Changes to version 1.2.1:
1) Added more options.
 
Changes to version 1.2.0:
1) Added more options.
2) Changed shortcut from "ALT+SHIFT+I, ALT+SHIFT+I" to "CTRL+SHIFT+BACKSPACE" for it didn't work on some machines.
 
P.S. You can run this tool from "Tools"->"Classify .ini files" or by hitting CTRL+SHIFT+BACKSPACE, or just by building your solution/project.
P.P.S This tool is written in C# for C#. I won't support other languages. Sorry 
 
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft