Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EnvConfiguratorDialog"/> class.
        /// </summary>
        /// <param name="environment">
        /// The environment.
        /// </param>
        /// <param name="executionParam">
        /// The execution param.
        /// </param>
        /// <exception cref="ArgumentException">
        /// </exception>
        internal EnvConfiguratorDialog(MonitorEnvironment environment, ExecutionParam executionParam)
            : this()
        {
            if (environment == null)
            {
                throw new ArgumentException("Environment cannot be null");
            }

            if (environment.Logger == null)
            {
                throw new ArgumentException("Environment logger cannot be null");
            }

            if (environment.ConfigStore == null)
            {
                throw new ArgumentException("Environment config store cannot be null");
            }

            if (executionParam.ConfigHandler == null)
            {
                throw new ArgumentException("Execution param config store cannot be null");
            }

            this._logger = environment.Logger;
            this._typeResolver = new TypeResolver(this._logger);
            this._executionParam = executionParam.ReflectionDeepClone(this._logger);

            this.Height -= this.pnlTop.Height;
            this._env = environment.ReflectionDeepClone(this._logger);
            #if DEBUG
            this._env.Id = Guid.NewGuid().ToString();
            #endif

            this.InitializeData();
        }