Exemple #1
0
        public void Commit()
        {
            if (!this.HasChanged)
            {
                return;
            }

            try
            {
                TValue typedValue = (TValue)this.Snapshot;

                this.Data.Bind((TValue)this.Snapshot);
                this.HasChanged = false;
            }
            catch (NotIndexableException)
            {
                throw BindingException.From(this, "Property has no indexer.");
            }
            catch (NotWritableException)
            {
                throw BindingException.From(this, "Property has no setter.");
            }
            catch (NullReferenceException)
            {
                throw BindingException.From(this, "Property cannot be null.");
            }
            catch (Exception ex)
            {
                throw BindingException.From(this, innerException: ex);
            }
        }
Exemple #2
0
 public void Update(object model) => throw BindingException.From(this, "Cannot update model field.");
Exemple #3
0
 public void Update(object value) => throw BindingException.From(this, "Cannot update missing field.");