public YesNoFieldVariable(VariableInstance variableInstance, FormControlScopeViewModel controlScopeViewModel, ScopeResources scopeResources, BooleanSettings settings)
            : base(variableInstance, controlScopeViewModel, scopeResources)
        {
            NoText = settings.UseTrueOrFalse ? "False" : "No";
            YesText = settings.UseTrueOrFalse ? "True" : "Yes";
            DefaultValue = settings.DefaultValue;

            if (variableInstance.Variable.Value == null)
            {
                Value = settings.DefaultValue.ToString().ToLower();
                IsYesChecked = settings.DefaultValue;
                IsNoChecked = settings.DefaultValue == false;
            }
            else
            {
                Value = variableInstance.Variable.Value.ToLower();
            }
        }
Example #2
0
        protected FieldVariable(VariableInstance variableInstance, FormControlScopeViewModel viewModel, ScopeResources scopeResources)
        {
            ScopeResources = scopeResources;
            Value = variableInstance.Variable.Value;
            ViewModel = viewModel;
            VariableInstance = variableInstance;
            _scopeText = ScopeResources.Text;

            ScopeResources.MachineSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
            ScopeResources.EnvironmentSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
            ScopeResources.RoleSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
            ScopeResources.ActionSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
        }
        public DropdownFieldVariable(VariableInstance variableInstance, FormControlScopeViewModel controlScopeViewModel,
            ScopeResources scopeResources)
            : base(variableInstance, controlScopeViewModel, scopeResources)
        {

        }
Example #4
0
        public ScopeResources CopyAndReset(Resource resource)
        {
            ScopeResources scope = new ScopeResources(resource, new ObservableDictionary<string, object>(EnvironmentItems),
                new ObservableDictionary<string, object>(MachineItems),
                new ObservableDictionary<string, object>(RoleItems),
                new ObservableDictionary<string, object>(EnvironmentItems),
                new ObservableDictionary<string, object>(),
                new ObservableDictionary<string, object>(),
                new ObservableDictionary<string, object>(ActionItems),
                new ObservableDictionary<string, object>());

            return scope;
        }