Пример #1
0
 // Place highlighted previews of the values to be copied atop the copyable controls
 // e.g., if the mouse is over the CopyPrevious button and we are not on the first row
 private void CopyPreviousValueSetPreviewsAsNeeded(int previousRow)
 {
     if (this.IsDisplayingSingleImage() &&
         this.CopyPreviousValuesButton != null &&
         this.CopyPreviousValuesButton.IsEnabled == true &&
         this.CopyPreviousValuesButton.IsMouseOver &&
         previousRow >= 0)
     {
         // Show the previews on the copyable controls
         foreach (KeyValuePair <string, DataEntryControl> pair in this.DataEntryControls.ControlsByDataLabel)
         {
             DataEntryControl control = pair.Value;
             if (control.Copyable)
             {
                 string previewValue = this.DataHandler.FileDatabase.FileTable[previousRow].GetValueDisplayString(control.DataLabel);
                 control.ShowPreviewControlValue(previewValue);
             }
         }
     }
     else
     {
         // Remove the preview from each control
         foreach (KeyValuePair <string, DataEntryControl> pair in this.DataEntryControls.ControlsByDataLabel)
         {
             DataEntryControl control = pair.Value;
             if (control.Copyable)
             {
                 control.HidePreviewControlValue();
             }
         }
     }
 }
Пример #2
0
        // Unhighlight the data controls affected by the Quickpaste entry
        private void QuickPasteDataControlsUnHighlight(QuickPasteEntry quickPasteEntry)
        {
            this.FilePlayer_Stop(); // In case the FilePlayer is going
            int row = this.DataHandler.ImageCache.CurrentRow;

            if (!this.DataHandler.FileDatabase.IsFileRowInRange(row))
            {
                return; // This shouldn't happen, but just in case...
            }

            foreach (QuickPasteItem item in quickPasteEntry.Items)
            {
                // If the item wasn't used, then it wasn't highlit.
                if (item.Use == false)
                {
                    continue;
                }

                // Find the data entry control that matches the quickPasteItem's DataLael
                foreach (KeyValuePair <string, DataEntryControl> pair in this.DataEntryControls.ControlsByDataLabel)
                {
                    DataEntryControl control = pair.Value;
                    if (control.DataLabel == item.DataLabel)
                    {
                        control.Container.ClearValue(Control.BackgroundProperty);
                        control.HidePreviewControlValue();
                        break;
                    }
                }
            }
        }