Beispiel #1
0
        /// <summary>
        /// Called from the IMultiImageControl control when the group of images changes.
        /// </summary>
        /// <param name="file">Unused as IMultiImageControl uses batches of files.</param>
        private void IMultiImageControlGroupChanged(SourceFile file)
        {
            if (this.ApplicationContext.SelectedDataSource != null && !String.IsNullOrEmpty(this.ApplicationContext.SelectedDataSource.CurrentContainer))
            {
                String classification = (this.ApplicationContext.SelectedDataSource as IMultiImageDataSource).CurrentContainerAsClassification;
                int    groupSize      = (this.ApplicationContext.SelectedDataSource as IMultiImageDataSource).BatchSize;
                int    currentIndex   = this.ApplicationContext.SelectedDataSource.CurrentContainerIndex + 1;
                int    containerCount = this.ApplicationContext.SelectedDataSource.CurrentContainerCollectionCount;

                double dblgroups = (double)containerCount / (double)groupSize;
                int    intgroups = containerCount / groupSize;

                if ((dblgroups - intgroups) > 0)
                {
                    intgroups += 1;
                }

                int currentGroup = (currentIndex > 0) ? (int)Math.Round((double)currentIndex / (double)groupSize) : 1;


                ClassificationCheckboxPanelHelper.MakeSelection(
                    this.ClassificationTabSelectionPanel,
                    classification);

                this.StatusBarLocationStatus.Text =
                    String.Format("Viewing Group :  {0} of {1}",
                                  (currentGroup > 0)?currentGroup : 1,
                                  intgroups);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Populate the StackPanel with the classificaitons options then select
        /// whatever the image has been tagged with already.
        /// </summary>
        private void AddPanelItems()
        {
            this.ClassificationPanel.Children.Clear();
            ClassificationCheckboxPanelHelper.PopulateSelectionPanel(
                this.Source,
                this.ClassificationPanel,
                this.Classifications,
                this.OnSelectionsChanged);

            ClassificationCheckboxPanelHelper.MakeSelection(
                this.ClassificationPanel,
                this.Item.CurrentSource);
        }
Beispiel #3
0
        /// <summary>
        /// Called from the ISingleImageControl control when the displayed image changes
        /// </summary>
        /// <param name="file">File on display</param>
        private void ISingleImageControlFileChanged(SourceFile file)
        {
            if (this.ApplicationContext.SelectedDataSource != null)
            {
                if (file != null)
                {
                    ClassificationCheckboxPanelHelper.MakeSelection(
                        this.ClassificationTabSelectionPanel,
                        file);
                }

                this.StatusBarLocationStatus.Text =
                    String.Format("Viewing {0} of {1} ",
                                  this.ApplicationContext.SelectedDataSource.CurrentContainerIndex + 1,
                                  this.ApplicationContext.SelectedDataSource.CurrentContainerCollectionCount);
            }
        }