예제 #1
0
 /// <summary>
 /// When image selection is changed, this method is called from ImageControlController.
 /// </summary>
 /// <param name="imagecontrol">The current Imagecontrol being selected.</param>
 public void OnImageSelected(INotifier imagecontrol)
 {
     if (imagecontrol.GetHashCode() != ActiveImageControlController.GetHashCode())
     {
         ActiveImageControlController.RemoveStyle();
         ActiveImageControlController.UnRegisterImageControlEvents();
         PclsMainWindowModel.ExportFilterStateToDataTable(ActiveImageControlController.GetHashCode());
         ActiveImageControlController = imagecontrol as ImageControlController;
         ActiveImageControlController.RegisterImageControlEvents();
         ActiveImageControlController.Notify("UpdateImageControlStyle", null);
         PclsMainWindowView.FileNameTextBox.Text = _dctImagePaths[ActiveImageControlController.GetHashCode()];
         PclsMainWindowModel.ImportFilterStateToModel(ActiveImageControlController.GetHashCode());
     }
 }
예제 #2
0
        private Assigner _QueryNotifier <T>(INotifier <T> notifier)
        {
            var      hash = notifier.GetHashCode();
            Assigner outAssigner;

            if (_Notifiers.TryGetValue(hash, out outAssigner))
            {
                return(outAssigner);
            }

            outAssigner = new Assigner <T>(notifier);
            _Notifiers.Add(hash, outAssigner);
            return(outAssigner);
        }