private void ApplyAuthorizationRules(Control control) { foreach (Binding binding in control.DataBindings) { // get the BindingSource if appropriate if (binding.DataSource is BindingSource) { BindingSource bs = (BindingSource)binding.DataSource; // get the object property name string propertyName = binding.BindingMemberInfo.BindingField; // get the BusinessObject if appropriate if (bs.DataSource is Dothan.Core.BusinessBase) { Dothan.Core.BusinessBase ds = (Dothan.Core.BusinessBase)bs.DataSource; ApplyReadRules( control, binding, propertyName, ds.CanReadProperty(propertyName)); ApplyWriteRules( control, binding, propertyName, ds.CanWriteProperty(propertyName)); } else if (bs.DataSource is Dothan.Core.IReadOnlyObj) { Dothan.Core.IReadOnlyObj ds = (Dothan.Core.IReadOnlyObj)bs.DataSource; ApplyReadRules( control, binding, propertyName, ds.CanReadProperty(propertyName)); } } } }
void Core.IEditableCollection.RemoveChild(Dothan.Core.BusinessBase child) { Remove((C)child); }