Ejemplo n.º 1
0
        ///<summary>
        ///Determines whether the specified <see cref="T:System.Object"></see> is equal to the current <see cref="T:System.Object"></see>.
        ///</summary>
        ///<returns>
        ///true if the specified <see cref="T:System.Object"></see> is equal to the current <see cref="T:System.Object"></see>; otherwise, false.
        ///</returns>
        ///<param name="obj">The <see cref="T:System.Object"></see> to compare with the current <see cref="T:System.Object"></see>. </param><filterpriority>2</filterpriority>
        public override bool Equals(object obj)
        {
            BindingErrorMessage other = obj as BindingErrorMessage;

            return((other != null) &&
                   (this.BindingId == other.BindingId) &&
                   (base.Equals(obj)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets error message that should be displayed in the case
        /// of a non-fatal binding error.
        /// </summary>
        /// <param name="messageId">
        /// Resource ID of the error message.
        /// </param>
        /// <param name="errorProviders">
        /// List of error providers message should be added to.
        /// </param>
        public void SetErrorMessage(string messageId, params string[] errorProviders)
        {
            AssertUtils.ArgumentHasText(messageId, "messageId");
            if (errorProviders == null || errorProviders.Length == 0)
            {
                throw new ArgumentException("At least one error provider has to be specified.", "providers");
            }

            this.errorMessage = new BindingErrorMessage(this.BINDING_ID, messageId, null);
            Set providers = new HashedSet();

            providers.Add(ALL_BINDINGERRORS_PROVIDER);
            providers.AddAll(errorProviders);
            errorProviders = new string[providers.Count];
            providers.CopyTo(errorProviders, 0);
            this.errorProviders = errorProviders;
        }
        /// <summary>
        /// Sets error message that should be displayed in the case 
        /// of a non-fatal binding error.
        /// </summary>
        /// <param name="messageId">
        /// Resource ID of the error message.
        /// </param>
        /// <param name="errorProviders">
        /// List of error providers message should be added to.
        /// </param>
        public void SetErrorMessage(string messageId, params string[] errorProviders)
        {
            AssertUtils.ArgumentHasText(messageId, "messageId");
            if (errorProviders == null || errorProviders.Length == 0)
            {
                throw new ArgumentException("At least one error provider has to be specified.", "providers");
            }

            this.errorMessage = new BindingErrorMessage(this.BINDING_ID, messageId, null);
            Set providers = new HashedSet();
            providers.Add(ALL_BINDINGERRORS_PROVIDER);
            providers.AddAll(errorProviders);
            errorProviders = new string[providers.Count];
            providers.CopyTo(errorProviders, 0);
            this.errorProviders = errorProviders;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"></see> class.
 /// </summary>
 protected AbstractBinding()
 {
     this.errorMessage = new BindingErrorMessage( this.Id, "Binding-Error");
     this.errorProviders = new string[] { ALL_BINDINGERRORS_PROVIDER };
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"></see> class.
 /// </summary>
 protected AbstractBinding()
 {
     this.errorMessage   = new BindingErrorMessage(this.Id, "Binding-Error");
     this.errorProviders = new string[] { ALL_BINDINGERRORS_PROVIDER };
 }