private ApplicationData(SerializationInfo info, StreamingContext context) { _settings = (ApplicationSettings)info.GetValue("Settings", typeof(ApplicationSettings)); _files = (ApplicationFiles)info.GetValue("Files", typeof(ApplicationFiles)); }
public ApplicationData() { _settings = new ApplicationSettings(); _files = new ApplicationFiles(); }
public ApplicationData() { _settings = new ApplicationSettings(); _files = new ApplicationFiles(); }
private ApplicationData(SerializationInfo info, StreamingContext context) { _settings = (ApplicationSettings)info.GetValue("Settings", typeof(ApplicationSettings)); _files = (ApplicationFiles)info.GetValue("Files", typeof(ApplicationFiles)); }
/// <summary> /// Initializes a new instance of <see cref="VirtualProcessStartInfo"/> /// based on the <see cref="ApplicationData"/> specified. /// </summary> /// <exception cref="ArgumentNullException"> /// An <see cref="ArgumentNullException"/> is thrown if <paramref name="data"/> of one of its properties is null. /// </exception> /// <exception cref="ArgumentException"> /// An <see cref="ArgumentException"/> is thrown if any of the properties of <paramref name="data"/> is of the wrong type. /// </exception> /// <param name="data">The data to base the process on.</param> /// <param name="workingDirectory">The working directory of the process to start.</param> public VirtualProcessStartInfo(ApplicationData data, ApplicationFile workingDirectory) { if (data == null || data.Files.RegistryDatabase == null || data.Files.Executable == null || data.Files.RootDirectory == null) throw new ArgumentNullException("data", "The data argument or one of its properties is null."); if (workingDirectory == null) throw new ArgumentNullException("workingDirectory", "The workingDirectory argument is null."); if (data.Files.Executable.Type != FileType.Executable) throw new ArgumentException("The ApplicationData specified contains an illegal value for the main executable.", "data"); if (data.Files.RegistryDatabase.Type != FileType.Database) throw new ArgumentException( "The ApplicationData specified contains an illegal value for the registry database.", "data"); if (workingDirectory.Type != FileType.Directory) throw new ArgumentException("The working directory specified is not a directory.", "workingDirectory"); _files = new ApplicationFiles { RegistryDatabase = new ApplicationFile(Path.Combine(workingDirectory.FileName, data.Files.RegistryDatabase.FileName)), Executable = new ApplicationFile(Path.Combine(workingDirectory.FileName, data.Files.Executable.FileName)), RootDirectory = new ApplicationFile(Path.Combine(workingDirectory.FileName, data.Files.RootDirectory.FileName)) }; _arguments = ""; _workingDirectory = workingDirectory; _fileSystemRuleCollection = data.Settings.FileSystemEngineRuleCollection ?? FileSystemRuleCollection.GetDefaultRuleCollection(); _registryRuleCollection = data.Settings.RegistryEngineRuleCollection ?? RegistryRuleCollection.GetDefaultRuleCollection(); }