public void LoadConfig(FXmlNode config) { if (config.Contains(PTY_VALID)) { _valid = config.GetBoolean(PTY_VALID); } _id = config[PTY_ID]; _text = config[PTY_TEXT]; // Load children if (config.HasNode()) { foreach (FXmlNode node in config.Nodes) { if (node.IsName(FScheduleTasks.NAME)) { // Load task _tasks.LoadConfig(node); } else if (node.IsName(FScheduleConditions.NAME)) { // Load condition _conditions.LoadConfig(node); } else if (node.IsName(FScheduleEvents.NAME)) { // Load event _events.LoadConfig(node); } } } }
public override void LoadConfig(FXmlNode config) { base.LoadConfig(config); // Load type string type = config[PTY_TYPE]; if (!RString.IsEmpty(type)) { _dataType = REnum.ToValue <EAopParameterType>(type); } // Load component if (config.HasNode()) { FXmlNode node = config.Nodes[0]; if (node.IsName(XAopComponent.TAG)) { _dataType = EAopParameterType.Component; } } // Load value if (_dataType == EAopParameterType.String) { _dataValue = config.Text; } }
public override void LoadConfig(FXmlNode config) { // Id _id = config[PTY_ID]; // Face _faceName = config[PTY_FACE]; // Type _typeName = config[PTY_TYPE]; // Scope string scope = config[PTY_SCOPE]; if (!RString.IsEmpty(scope)) { _scope = REnum.ToValue <EScope>(scope); } // Load config if (config.HasNode()) { foreach (FXmlNode node in config.Nodes) { if (node.IsName(XAopConstructor.TAG)) { // Constructor if (_constructor != null) { throw new FFatalException("Constructor can't be duplicate.\n{1}", config.Dump()); } _constructor = new XAopConstructor(); _constructor.LoadConfig(node); } else if (node.IsName(XAopProperty.TAG)) { // Properties XAopProperty property = new XAopProperty(); property.LoadConfig(node); _properties.Push(property); } else if (node.IsName(XAopInitialize.TAG)) { // Initializes XAopInitialize method = new XAopInitialize(); method.LoadConfig(node); _initializes.Push(method); } else if (node.IsName(XAopRelease.TAG)) { // Releases XAopRelease method = new XAopRelease(); method.LoadConfig(node); _releases.Push(method); } } } }
public void LoadConfig(FXmlNode config) { if (config.HasNode()) { foreach (FXmlNode node in config.Nodes) { if (node.IsName(FSchedules.NAME)) { // Load schedule _schedules.LoadConfig(node); } } } }
private void BuildConfigMap(FXmlNode config) { string id = config[PTY_ID]; if (!RString.IsEmpty(id)) { _map[id] = config; } if (config.HasNode()) { foreach (FXmlNode node in config.Nodes) { BuildConfigMap(node); } } }
public void LoadConfig(FXmlNode config) { // Load children if (config.HasNode()) { foreach (FXmlNode node in config.Nodes) { if (node.IsName(FScheduleEvent.NAME)) { // Load event FScheduleEvent scheduleEvent = _schedule.Console.Factory.CreateEvent(node); scheduleEvent.LoadConfig(node); Push(scheduleEvent); } } } }
//============================================================ public void LoadConfig(FXmlNode config) { if (config != null && config.HasNode()) { foreach (FXmlNode node in config.Nodes) { if (node.IsName(XAopConfig.TAG)) { // Register config node XAopConfig aopConfig = new XAopConfig(); aopConfig.Console = this; aopConfig.LoadConfig(node); _configs.Push(aopConfig); } else if (node.IsName(XAopReference.TAG)) { // Register reference node XAopReference aopReference = new XAopReference(); aopReference.Console = this; aopReference.LoadConfig(node); _references.Push(aopReference); } else { // Find node type XAopConfig aopConfig = (XAopConfig)_configs.Find(node.Name); if (null == config) { throw new FFatalException("Node({1}) is not be defined.", node.Name); } // Sync node collection IAopNodes configs = _nodesCollection[node.Name]; if (null == configs) { configs = aopConfig.CreateCollection <IAopNodes>(); _nodesCollection[node.Name] = configs; } // Create node instance IAopNode aopCfg = aopConfig.CreateInstance <IAopNode>(); aopCfg.Console = this; aopCfg.LoadConfig(node); configs.Push(aopCfg); } } } }
public void LoadConfig(FXmlNode config) { // Load children if (config.HasNode()) { foreach (FXmlNode node in config.Nodes) { if (node.IsName(FScheduleCondition.NAME)) { // Load condition FScheduleCondition condition = _schedule.Console.Factory.CreateCondition(node); condition.LoadConfig(node); Push(condition); } } } }
public void LoadConfig(FXmlNode config) { if (config.HasNode()) { foreach (FXmlNode node in config.Nodes) { if (node.IsName(FSchedule.NAME)) { // Load schedule FSchedule schedule = new FSchedule(); schedule._console = _console; schedule.LoadConfig(node); Push(schedule); } } } }
public override void LoadConfig(FXmlNode config) { _method = config[PTY_METHOD]; // Load config if (config.HasNode()) { foreach (FXmlNode node in config.Nodes) { if (node.IsName(XAopParameter.TAG)) { // Parameter XAopParameter parameter = new XAopParameter(); parameter.LoadConfig(node); _parameters.Push(parameter); } } } }
public void LoadConfig(FXmlNode config) { // Load children if (config.HasNode()) { foreach (FXmlNode node in config.Nodes) { if (node.IsName(FScheduleTask.NAME)) { // Load task FScheduleTask task = _schedule.Console.Factory.CreateTask(node); task._tasks = this; task.LoadConfig(node); Push(task); } } } }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置节点 //============================================================ public override void LoadConfig(FXmlNode xconfig) { base.LoadConfig(xconfig); if (xconfig.HasNode()) { // 创建所有子节点 foreach (FXmlNode xnode in xconfig.Nodes) { string nodeName = xnode.Name; FRcComponent component = _console.CreateComponent(nodeName); if (component != null) { // 增加为子节点 component.Parent = this; Push(component); // 加载配置信息 component.LoadConfig(xnode); } } } }