/// <summary>
 /// Initializes a new instance of the <see cref="ConfigurationManager"/> class.
 /// </summary>
 public ConfigurationManager()
 {
     this.configuration = BabelImConfiguration.GetConfiguration();
     #warning TODO: Receive Session chage messages
 }
        public static BabelImConfiguration GetConfiguration(string configurationFilename)
        {
            FileStream              stream          = null;
            BabelImConfiguration    configuration   = null;

            if (!Directory.Exists(Path.GetPathRoot(configurationFilename)))
            {
                Directory.CreateDirectory(Path.GetPathRoot(configurationFilename));
            }
            if (!File.Exists(configurationFilename))
            {
                BabelImConfiguration tmpCfg = new BabelImConfiguration();

                tmpCfg.Save(configurationFilename);
            }

            try
            {
                stream          = new FileStream(configurationFilename, FileMode.Open, FileAccess.Read);
                configuration   = (BabelImConfiguration)Serializer.Deserialize(stream);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (stream != null)
                {
                    stream.Close();
                }
            }

            return configuration;
        }
        /// <summary>
        /// Gets the configuration by reading it from the configuration file.
        /// </summary>
        /// <returns></returns>
        public BabelImConfiguration GetConfiguration()
        {
            this.configuration = BabelImConfiguration.GetConfiguration();

            return this.Configuration;
        }