Beispiel #1
0
        public void SaveInterfaceInfo(InterfaceInfo info)
        {
            _interface_info = info;
            string category = "interface";

            INIManipulator.WriteValue(_config_file, category, "suggestions", info.NumberOfSuggestions.ToString());
            INIManipulator.WriteValue(_config_file, category, "location_x", info.WindowLocation.X.ToString());
            INIManipulator.WriteValue(_config_file, category, "location_y", info.WindowLocation.Y.ToString());
        }
Beispiel #2
0
 public InterfaceInfo GetInterfaceInfo()
 {
     if (_interface_info == null)
     {
         int           number_of_suggestions = 10;
         Point         location   = new Point(-1, -1);
         List <string> categories = INIManipulator.GetCategories(_config_file);
         if (categories.Count > 0)
         {
             string category = "interface";
             if (categories.Contains(category))
             {
                 List <string> keys = INIManipulator.GetKeys(_config_file, category);
                 if (keys.Count > 0)
                 {
                     string number_of_suggestions_name = "suggestions";
                     string location_x_name            = "location_x";
                     string location_y_name            = "location_y";
                     if (keys.Contains(number_of_suggestions_name))
                     {
                         Int32.TryParse(INIManipulator.GetValue(_config_file, category, number_of_suggestions_name, "10"), out number_of_suggestions);
                     }
                     if (keys.Contains(location_x_name) && keys.Contains(location_y_name))
                     {
                         int x, y;
                         Int32.TryParse(INIManipulator.GetValue(_config_file, category, location_x_name, "-1"), out x);
                         Int32.TryParse(INIManipulator.GetValue(_config_file, category, location_y_name, "-1"), out y);
                         location.X = x;
                         location.Y = y;
                     }
                 }
             }
         }
         _interface_info = new InterfaceInfo(number_of_suggestions, location);
     }
     return(_interface_info);
 }
Beispiel #3
0
 public InterfaceInfo(InterfaceInfo info)
 {
     _number_of_suggestions = info.NumberOfSuggestions;
     _window_location       = new Point(info.WindowLocation.X, info.WindowLocation.Y);
 }