예제 #1
0
 /// <summary>
 ///     Initializes a new instance of the UIControl class.
 /// </summary>
 public UIControl()
 {
     ControlRole        = UIControlRole.Label;
     Platform           = UIPlatform.WPF;
     _controlProperties = new SerializableObservableCollection <UIProperty>();
     ControlType        = string.Empty;
 }
예제 #2
0
        /// <summary>
        ///     A specialized constructor for the UIControl class for serialization.
        /// </summary>
        /// <exception cref="ArgumentNullException">
        ///     Thrown when one or more required arguments are null.
        /// </exception>
        protected UIControl(SerializationInfo info, StreamingContext context)
            : this()
        {
            if (info == null)
            {
                throw new ArgumentNullException("info");
            }

            GenerateControlName = (bool)info.GetValue("GenerateControlName",
                                                      typeof(bool));

            IncludeNotifyOnValidationError = (bool)
                                             info.GetValue("IncludeNotifyOnValidationError", typeof(bool));
            IncludeTargetNullValueForNullableBindings = (bool)
                                                        info.GetValue("IncludeTargetNullValueForNullableBindings", typeof(bool));
            IncludeValidatesOnDataErrors = (bool)
                                           info.GetValue("IncludeValidatesOnDataErrors", typeof(bool));
            IncludeValidatesOnExceptions = (bool)
                                           info.GetValue("IncludeValidatesOnExceptions", typeof(bool));
            ControlRole = (UIControlRole)info.GetValue("UIControlRole",
                                                       typeof(UIControlRole));
            Platform           = (UIPlatform)info.GetValue("Platform", typeof(UIPlatform));
            ControlType        = (string)info.GetValue("ControlType", typeof(string));
            _controlProperties = (SerializableObservableCollection <UIProperty>)
                                 info.GetValue("ControlProperties",
                                               typeof(SerializableObservableCollection <UIProperty>));
        }