Beispiel #1
0
 /// <summary>
 /// Window Size
 /// </summary>
 /// <param name="type"></param>
 /// <param name="frm"></param>
 public void WindowSize(WindowSizes type, Form frm, string ini)
 {
     if (!string.IsNullOrEmpty(frm.Name))
     {
         if (type == WindowSizes.Loading)
         {
             frm.Left   = IniFileHelper.ReadIniInt(ini, frm.Name, "Left", frm.Left);
             frm.Top    = IniFileHelper.ReadIniInt(ini, frm.Name, "Top", frm.Top);
             frm.Width  = IniFileHelper.ReadIniInt(ini, frm.Name, "Width", frm.Width);
             frm.Height = IniFileHelper.ReadIniInt(ini, frm.Name, "Height", frm.Height);
         }
         else
         {
             IniFileHelper.WriteIni(ini, frm.Name, "Left", frm.Left.ToString());
             IniFileHelper.WriteIni(ini, frm.Name, "Top", frm.Top.ToString());
             IniFileHelper.WriteIni(ini, frm.Name, "Width", frm.Width.ToString());
             IniFileHelper.WriteIni(ini, frm.Name, "Height", frm.Height.ToString());
         }
     }
 }