Exemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="sourceAudioDirectory"></param>
 /// <param name="destinationAudioDirectory"></param>
 /// <param name="imgDirectory"></param>
 /// <param name="IsRemoveSourceFile"></param>
 /// <param name="IsWorkWithSourceFileOnly"></param>
 /// <param name="STYLE"></param>
 public Settings(string sourceAudioDirectory, string destinationAudioDirectory,
                 string imgDirectory, bool IsRemoveSourceFile, bool IsWorkWithSourceFileOnly, SONG_NAME_STYLE STYLE)
 {
     this.sourceAudioDirectory      = sourceAudioDirectory;
     this.destinationAudioDirectory = destinationAudioDirectory;
     this.imgDirectory             = imgDirectory;
     this.IsRemoveSourceFile       = IsRemoveSourceFile;
     this.IsWorkWithSourceFileOnly = IsWorkWithSourceFileOnly;
     this.STYLE = STYLE;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Returns all settings.
 /// </summary>
 /// <param name="_Source_Audio_Directory"></param>
 /// <param name="_Destination_Audio_Directory"></param>
 /// <param name="_Img_Directory"></param>
 /// <param name="_IsRemoveSourceFile"></param>
 /// <param name="_IsWorkWithSourceFileOnly"></param>
 /// <param name="_STYLE"></param>
 public void GetSettings(ref string sourceAudioDirectory, ref string destinationAudioDirectory,
                         ref string imgDirectory, ref bool IsRemoveSourceFile, ref bool IsWorkWithSourceFileOnly,
                         ref SONG_NAME_STYLE STYLE)
 {
     sourceAudioDirectory      = this.sourceAudioDirectory;
     destinationAudioDirectory = this.destinationAudioDirectory;
     imgDirectory             = this.imgDirectory;
     IsRemoveSourceFile       = this.IsRemoveSourceFile;
     IsWorkWithSourceFileOnly = this.IsWorkWithSourceFileOnly;
     STYLE = this.STYLE;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Loads settings from json file
        /// </summary>
        public void LoadSettings()
        {
            DataContractJsonSerializer jsonFormatter = new DataContractJsonSerializer(typeof(Settings));

            try
            {
                using (FileStream fs = new FileStream("settings.json", FileMode.Open))
                {
                    Settings settings = (Settings)jsonFormatter.ReadObject(fs);

                    sourceAudioDirectory      = settings.sourceAudioDirectory;
                    destinationAudioDirectory = settings.destinationAudioDirectory;
                    imgDirectory             = settings.imgDirectory;
                    IsRemoveSourceFile       = settings.IsRemoveSourceFile;
                    IsWorkWithSourceFileOnly = settings.IsWorkWithSourceFileOnly;
                    STYLE = settings.STYLE;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Can't read settings from file. Reason: " + ex.Message);
            }
        }