Пример #1
0
        public void Initialise(ConditionAtom atom)
        {
            ulong primaryMask = Primary.MaskValue;
            this.IsSelected = ((atom.PrimaryMask & primaryMask) == primaryMask);

            foreach (SubConditionRadioEditorModel subCondition in this.SubConditions)
            {
                if (this.IsSelected)
                    subCondition.SetMask(atom);
                else
                    subCondition.Clear();
            }
        }
Пример #2
0
 public void SetMask(ConditionAtom atom)
 {
     this.IsSelected = false;
     foreach (SubConditionRadioItemModel item in Items)
     {
         ulong mask = item.Value.MaskValue;
         item.IsSelected = ((atom.PrimaryMask & mask) == mask);
         this.IsSelected |= item.IsSelected;
     }
 }
Пример #3
0
 public ConditionComponentListingModel(ConditionAtom atom)
 {
     Atom = atom;
     Name = atom.Name;
 }
Пример #4
0
 public ConditionComponentListingModel GetConditionAtomForOr()
 {
     ConditionAtom atom = new ConditionAtom();
     ConditionComponentListingModel componentModel = new ConditionComponentListingModel(atom);
     componentModel.OnEdit += EditComponentModel;
     componentModel.OnDelete += DeleteComponentModel;
     OrAtoms.Add(componentModel);
     return componentModel;
 }
Пример #5
0
        public void SaveEditor()
        {
            if (Atom == null)
                Atom = new ConditionAtom();

            PrimaryCondition condition = ValueConditions.FirstOrDefault(x => x.Name == SelectedCondition);
            ulong mask = (condition == null) ? 0 : condition.MaskValue;

            if (this.ValueSubconditions != null)
            {
                foreach (SubConditionRadioEditorModel subCondition in this.ValueSubconditions)
                    mask |= subCondition.GetMask();
            }
            foreach (SubConditionRadioEditorModel subCondition in this.DrawSubconditions)
                mask |= subCondition.GetMask();

            Atom.PrimaryMask = mask;
            Atom.Name = Name;
        }