protected void UnregisterSubcontrolPath(CogEditControlBaseV2 subcontrol) { CogSubcontrolWatcher cogSubcontrolWatcher = this.FindSubcontrolWatcher(subcontrol); if (cogSubcontrolWatcher == null) { throw new ArgumentException("subcontrol does not have a registered path"); } cogSubcontrolWatcher.Subject = null; this.mSubcontrolSubjectWatchers.Remove(cogSubcontrolWatcher); }
private CogSubcontrolWatcher FindSubcontrolWatcher(CogEditControlBaseV2 subcontrol) { CogSubcontrolWatcher result = null; foreach (CogSubcontrolWatcher mSubcontrolSubjectWatcher in this.mSubcontrolSubjectWatchers) { if (object.ReferenceEquals(mSubcontrolSubjectWatcher.mSubcontrol, subcontrol)) { return(mSubcontrolSubjectWatcher); } } return(result); }
protected void RegisterSubcontrolPath(CogEditControlBaseV2 subcontrol, string path) { CogSubcontrolWatcher subW = new CogSubcontrolWatcher(null, path, subcontrol); subW.Changed += this.WatcherHandler; subcontrol.Enabled = false; this.mSubcontrolSubjectWatchers.Add(subW); if (this.SubjectInUse) { this.mPropertyProvider.LoopSafeDelegateQueue.Enqueue(new DelegateQueueItem((MethodInvoker) delegate { subW.Subject = this.mSubject; }, null)); } else { subW.Subject = this.mSubject; } }
public CogSubcontrolWatcher(object subject, string path, CogEditControlBaseV2 subcontrol) : base(subject, path) { this.mSubcontrol = subcontrol; }