Пример #1
0
        private static void TestValidationPanel()
        {
            System.Windows.Application app     = new System.Windows.Application();
            ValidationPanelDialog      dialog  = new ValidationPanelDialog();
            DesignValidationContext    context = new DesignValidationContext();

            RuleAppExtension.ValidationManager.AddValidationItem(new PipeValidationItem
            {
                FID        = 1,
                DeviceType = "Pipe",
                Category   = "General Validation",
                ResultType = ValidationType.Error,
                Title      = "Validation Failed",
            });

            RuleAppExtension.ValidationManager.AddValidationItem(new PipeValidationItem
            {
                FID        = 2,
                DeviceType = "Pipe",
                Category   = "General Validation",
                ResultType = ValidationType.Error,
                Title      = "Validation Failed",
            });

            RuleAppExtension.ValidationManager.AddValidationItem(new PipeValidationItem
            {
                FID        = 3,
                DeviceType = "Pipe",
                Category   = "General Validation",
                ResultType = ValidationType.Error,
                Title      = "Validation Failed"
            });

            RuleAppExtension.ValidationManager.AddValidationItem(new PipeValidationItem
            {
                FID        = 4,
                DeviceType = "Pipe",
                Category   = "General Validation",
                ResultType = ValidationType.Error,
                Title      = "Validation Failed",
            });
            dialog.DataContext = context;
            app.Run(dialog);
        }
Пример #2
0
        protected ValidationItemContextBase(DesignValidationContext owner, IValidationItem item)
        {
            if (item == null)
            {
                throw new NullReferenceException("ValidationItemBase.Constructor: Parameter item can't be null"); // NOXLATE
            }
            if (owner == null)
            {
                throw new NullReferenceException("ValidationItemBase.Constructor: Parameter owner can't be null"); // NOXLATE
            }
            this._owner = owner;

            this.IsVisible = true;

            this.ValidationItem = item;

            SetStatus(ItemStatus.Normal);

            this.UpdateUiByValidationType();
        }
Пример #3
0
 public ValidationItemContext(DesignValidationContext owner, IValidationItem item)
     : base(owner, item)
 {
 }