示例#1
0
    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);
    }
示例#2
0
    private CogSubcontrolWatcher FindSubcontrolWatcher(CogEditControlBaseV2 subcontrol)
    {
        CogSubcontrolWatcher result = null;

        foreach (CogSubcontrolWatcher mSubcontrolSubjectWatcher in this.mSubcontrolSubjectWatchers)
        {
            if (object.ReferenceEquals(mSubcontrolSubjectWatcher.mSubcontrol, subcontrol))
            {
                return(mSubcontrolSubjectWatcher);
            }
        }
        return(result);
    }
示例#3
0
    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;
        }
    }
示例#4
0
 public CogSubcontrolWatcher(object subject, string path, CogEditControlBaseV2 subcontrol)
     : base(subject, path)
 {
     this.mSubcontrol = subcontrol;
 }