Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Build"></param>
        public void InitFromScript(ScriptLaunchMode Build)
        {
            ScriptInstance = Build;

            Name = Build.Name;

            foreach (PropertyInfo Info in Build.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public))
            {
                if (Info.PropertyType != typeof(string) &&
                    Info.PropertyType != typeof(int) &&
                    Info.PropertyType != typeof(float) &&
                    Info.PropertyType != typeof(bool))
                {
                    continue;
                }

                BuildLaunchVariable Arg = new BuildLaunchVariable();
                Arg.InitFromScript(Build, Info);

                Variables.Add(Arg);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// </summary>
        public BuildLaunchVariable AddStringVariable(string Name, string Value)
        {
            foreach (BuildLaunchVariable Var in Variables)
            {
                if (Var.Name == Name)
                {
                    Var.Value = Value;
                    return(Var);
                }
            }

            BuildLaunchVariable Variable = new BuildLaunchVariable();

            Variable.Condition       = "true";
            Variable.ConditionResult = true;
            Variable.DataType        = BuildLaunchVariableDataType.String;
            Variable.Name            = Name;
            Variable.Value           = Value;
            Variable.Internal        = true;
            Variables.Add(Variable);

            return(Variable);
        }