示例#1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Id == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Id");
     }
     if (Device == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Device");
     }
     if (Os == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Os");
     }
     if (Browser == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Browser");
     }
     if (Language == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Language");
     }
     if (Device != null)
     {
         Device.Validate();
     }
     if (Os != null)
     {
         Os.Validate();
     }
     if (Browser != null)
     {
         Browser.Validate();
     }
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the BaseProfilePreview class.
 /// </summary>
 /// <param name="id">The unique identifier of the base profile. You can
 /// use this as a reference to create a new profile from this base
 /// profile.</param>
 /// <param name="language">Language of the base profile. Using ISO
 /// 639-1 language codes.</param>
 public BaseProfilePreview(string id, Device device, Os os, Browser browser, string language)
 {
     Id       = id;
     Device   = device;
     Os       = os;
     Browser  = browser;
     Language = language;
     CustomInit();
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the ProfilePreview class.
 /// </summary>
 /// <param name="id">A unique identifier of the profile</param>
 /// <param name="language">Language of the profile. This is derived
 /// from the base profile. Using ISO 639-1 language codes.</param>
 /// <param name="launcher">The mode how the profile should be launched.
 /// It determines which browser to launch. This cannot be modified
 /// after creation. Possible values are 'automatic', 'chrome',
 /// 'chromium', 'firefox', 'edge', 'external'</param>
 /// <param name="lastKnownPath">An absolute path where the related
 /// .kameleo profile file was accessed lastly. This is updated when a
 /// profile is saved to a .kameleo file, or loaded from a .kameleo
 /// file.</param>
 public ProfilePreview(System.Guid id, Device device, Os os, Browser browser, string language, string launcher, StatusResponse status, string lastKnownPath = default(string))
 {
     Id            = id;
     LastKnownPath = lastKnownPath;
     Device        = device;
     Os            = os;
     Browser       = browser;
     Language      = language;
     Launcher      = launcher;
     Status        = status;
     CustomInit();
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the BaseProfile class.
 /// </summary>
 /// <param name="version">The version of the base profile. As time
 /// passes new base profile versions will be introduced. It is
 /// recommended to use the latest one.</param>
 /// <param name="id">The unique identifier of the base profile. You can
 /// use this as a reference to create a new profile from this base
 /// profile.</param>
 /// <param name="language">Language of the base profile. Using ISO
 /// 639-1 language codes.</param>
 /// <param name="resolution">The screen size of the device in
 /// pixels</param>
 /// <param name="fonts">A list of font types included in the
 /// profile</param>
 /// <param name="plugins">A list of plugins included in the
 /// profile</param>
 public BaseProfile(string version, string id, Device device, Os os, Browser browser, string language, string resolution, IList <string> fonts, IList <string> plugins)
 {
     Version    = version;
     Id         = id;
     Device     = device;
     Os         = os;
     Browser    = browser;
     Language   = language;
     Resolution = resolution;
     Fonts      = fonts;
     Plugins    = plugins;
     CustomInit();
 }
示例#5
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Version == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Version");
     }
     if (Id == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Id");
     }
     if (Device == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Device");
     }
     if (Os == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Os");
     }
     if (Browser == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Browser");
     }
     if (Language == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Language");
     }
     if (Resolution == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Resolution");
     }
     if (Fonts == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Fonts");
     }
     if (Plugins == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Plugins");
     }
     if (Device != null)
     {
         Device.Validate();
     }
     if (Os != null)
     {
         Os.Validate();
     }
     if (Browser != null)
     {
         Browser.Validate();
     }
 }