Ejemplo n.º 1
0
        protected override void Initialize()
        {
            MapController = new MapController <AppRuleMap, AbstractMapViewModel <AppRuleMap> >(Model.AppRuleMaps, Workspace);

            _actions = new ObservableCollection <ActionContainerViewModel>(Model.Actions.Select(x => new ActionContainerViewModel(x, this, _automationService)));

            if (!string.IsNullOrEmpty(Model.EventConstraints))
            {
                Constraints.AddRange(_automationService.CreateRuleConstraints(Model.EventConstraints));

                var settingData = Model.EventConstraints.Split('#').Where(x => x.StartsWith("SN$")).FirstOrDefault();

                if (!string.IsNullOrEmpty(settingData))
                {
                    var settingParts = settingData.Split(';');
                    if (settingParts.Length == 3)
                    {
                        SettingConstraintName      = settingParts[0].Replace("SN$", "");
                        SettingConstraintOperation = settingParts[1];
                        SettingConstraintValue     = settingParts[2];
                    }
                }
            }

            base.Initialize();
        }
Ejemplo n.º 2
0
        protected override void Initialize()
        {
            MapController = new MapController <AppRuleMap, AbstractMapViewModel <AppRuleMap> >(Model.AppRuleMaps, Workspace);

            _actions = new ObservableCollection <ActionContainerViewModel>(Model.Actions.OrderBy(x => x.SortOrder).Select(x => new ActionContainerViewModel(x, this, _automationService, _automationDao)));

            if (!string.IsNullOrEmpty(Model.EventConstraints))
            {
                Constraints.AddRange(_automationService.CreateRuleConstraints(Model.EventConstraints));
            }
            base.Initialize();
        }