Пример #1
0
        public override bool Load(ConfigNode configNode)
        {
            // Load base class
            bool valid = base.Load(configNode);

            valid &= ConfigNodeUtil.ParseValue <string>(configNode, "facility", x => facility = x, this);
            valid &= ConfigNodeUtil.ParseValue <string>(configNode, "preWaitText", x => preWaitText = x, this, (string)null);
            valid &= ConfigNodeUtil.ParseValue <string>(configNode, "waitingText", x => waitingText = x, this, (string)null);
            valid &= ConfigNodeUtil.ParseValue <string>(configNode, "completionText", x => completionText = x, this, (string)null);
            valid &= ConfigNodeUtil.ParseValue <ContractConfigurator.Parameters.Duration.StartCriteria>(configNode, "startCriteria", x => startCriteria = x, this, ContractConfigurator.Parameters.Duration.StartCriteria.CONTRACT_ACCEPTANCE);
            valid &= ConfigNodeUtil.ParseValue <List <string> >(configNode, "parameter", x => parameter = x, this, new List <string>());
            valid &= ConfigNodeUtil.ValidateExcludedValue(configNode, "title", this);

            return(valid);
        }
Пример #2
0
        public override bool Load(ConfigNode configNode)
        {
            // Load base class
            bool valid = base.Load(configNode);

            valid &= ConfigNodeUtil.ParseValue <string>(configNode, "facility", x => facility = x, this, "Observatory");
            valid &= ConfigNodeUtil.ParseValue <string>(configNode, "preWaitText", x => preWaitText = x, this, "The observatory will search the skies for a period of time.");
            valid &= ConfigNodeUtil.ParseValue <string>(configNode, "waitingText", x => waitingText = x, this, "Searching the Skies.");
            valid &= ConfigNodeUtil.ParseValue <string>(configNode, "completionText", x => completionText = x, this, "The search is over.");
            valid &= ConfigNodeUtil.ParseValue <ContractConfigurator.Parameters.Duration.StartCriteria>(configNode, "startCriteria", x => startCriteria = x, this, ContractConfigurator.Parameters.Duration.StartCriteria.CONTRACT_ACCEPTANCE);
            valid &= ConfigNodeUtil.ParseValue <List <string> >(configNode, "parameter", x => parameter = x, this, new List <string>());
            valid &= ConfigNodeUtil.ValidateExcludedValue(configNode, "title", this);

            return(valid);
        }