コード例 #1
0
        void presets_ListChangePosition(Widget source, EventArgs e)
        {
            uint selectedIndex = presets.getIndexSelected();

            if (selectedIndex != uint.MaxValue)
            {
                RenderPreset preset = (RenderPreset)presets.getItemDataAt(selectedIndex);
                ImageWidth  = preset.Width;
                ImageHeight = preset.Height;
                if (ResolutionChanged != null)
                {
                    ResolutionChanged.Invoke(this, EventArgs.Empty);
                }
            }
        }
コード例 #2
0
 void deleteButton_MouseButtonClick(Widget source, EventArgs e)
 {
     if (fileDataGrid.hasItemSelected())
     {
         uint            selectedIndex = fileDataGrid.getIndexSelected();
         PatientDataFile deleteFile    = (PatientDataFile)fileDataGrid.getItemDataAt(selectedIndex);
         try
         {
             File.Delete(deleteFile.BackingFile);
             fileDataGrid.removeItemAt(selectedIndex);
             fileDataGrid_ListChangePosition(null, null);
         }
         catch (Exception ex)
         {
             MessageBox.show(String.Format("Could not delete file {0}.\nReason\n{1}.", deleteFile.BackingFile, ex.Message), "Delete Error", MessageBoxStyle.Ok | MessageBoxStyle.IconError, null);
         }
     }
 }
コード例 #3
0
 void listBox_ListSelectAccept(Widget source, EventArgs e)
 {
     if (playingAnimationState != null)
     {
         playingAnimationState.Playing = false;
     }
     if (listBox.getIndexSelected() >= 0)
     {
         playingAnimationState = (AnimationWindowListItem)listBox.getItemDataAt(listBox.getIndexSelected());
         if (playingAnimationState != null)
         {
             playingAnimationState.Playing = true;
         }
     }
 }