/// <summary> /// Creates Notes config file if it doesn't exist, and updates notes with the values from config file /// </summary> /// <returns> /// Returns notes /// </returns> public string TreatNotesFile() { /// Creates Notes config file with default content if it doesn't exist string filePath = ConfigFileInit(path, ConfigFileNotes.Filename, ConfigFileNotes.DefaultContent()); string notes = ""; /// Reads each lines from config file ConfigFileNotes.ReadFile(filePath, ref notes); return(notes); }
/// <summary> /// Opens specified configuration configFileType file /// </summary> /// <param name="configFileType"></param> public void OpenConfigFile(ConfigFileType configFileType) { string filePath; switch (configFileType) { case ConfigFileType.MMParameters: filePath = ConfigFileInit(path, ConfigFileMMParameters.Filename, ConfigFileMMParameters.DefaultContent()); break; case ConfigFileType.Devices: filePath = ConfigFileInit(path, ConfigFileDevices.Filename, ConfigFileDevices.DefaultContent()); break; case ConfigFileType.Notes: filePath = ConfigFileInit(path, ConfigFileNotes.Filename, ConfigFileNotes.DefaultContent()); break; case ConfigFileType.MySQL: filePath = ConfigFileInit(path, ConfigFileMySQL.Filename, ConfigFileMySQL.DefaultContent()); break; case ConfigFileType.EPCDatasets: filePath = ConfigFileInit(path, ConfigFileEPCs.Filename, ConfigFileEPCs.DefaultContent()); break; case ConfigFileType.Log: string date = DateTime.Now.ToShortDateString().Replace('/', '-'); filePath = Path.Combine(logsPath, String.Format("{0}.log", date)); break; default: return; } /// Open file Process.Start(filePath); }