Exemple #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();
             }
         }
     }
 }
Exemple #2
0
        // Highlight the data controls affected by the Quickpaste entry
        private void QuickPasteDataControlsHighlight(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 (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.ShowPreviewControlValue(item.Value);
                    }
                }
            }
        }