示例#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);
            }
        }
示例#2
0
 public void Update(object model) => throw BindingException.From(this, "Cannot update model field.");
示例#3
0
 public void Update(object value) => throw BindingException.From(this, "Cannot update missing field.");