/// <summary>
        /// Populates and returns a list of default settings profiles that should always be available when using the app.
        /// These profiles cannot be edited or removed.
        /// Be sure to create a valid profile with actual credentials for testing
        /// </summary>
        public List <Settings> GenerateDefaultSettings()
        {
            var profiles = new List <Settings>();

            var defaultTest = new Settings()
            {
                ProfileName    = "Default Test Settings",
                Url            = "http://localhost/MobuWcf/MobuWs.svc",
                Timeout        = 60000,
                Domain         = "Domain",
                Username       = "******",
                Password       = EncryptionControl.EncryptWithDeviceID("Password"),
                FragmentSize   = 500000,
                IsTestInstance = true,
                IsDefault      = true
            };

            profiles.Add(defaultTest);

            SaveSettingsProfiles(profiles);

            return(profiles);
        }
 /// <summary>
 /// Constructor for the web service control.
 /// </summary>
 /// <param name="settings">Current app settings used to setup the web service.</param>
 public WebServiceControl(Settings settings)
 {
     try
     {
         if (settings != null)
         {
             WebService = new MobuWs
             {
                 Url                 = settings.Url,
                 Timeout             = settings.Timeout,
                 Credentials         = new NetworkCredential(settings.Username, EncryptionControl.DecryptWithDeviceID(settings.Password), settings.Domain),
                 PreAuthenticate     = false,
                 EnableDecompression = true
             };
         }
     }
     catch (Exception e)
     {
         Log.Error("Mobu", "Error while creating web service.", e);
         throw new Exception("Error while creating web service. " + e.Message);
     }
 }