internal static string GetDisplayName(this ImageExtension enumValue)
 {
     return(enumValue
            .GetType()
            .GetMember(enumValue.ToString())
            .First()
            .GetCustomAttribute <DisplayAttribute>()
            .GetName());
 }
Beispiel #2
0
        /// <summary>
        /// OnSaveAs opens the Save Dialog box so that the user
        /// can save the active Spectrum as something else.
        /// </summary>
        private void OnSaveAs()
        {
            //Create a SaveFileDialog and set it up
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.AddExtension    = true;
            sfd.CheckPathExists = true;
            sfd.Filter          = ImageExtension.ToString() + "|" + SpectrumExtension.ToString(SpectrumType.R3D);
            sfd.OverwritePrompt = true;
            sfd.Title           = Strings.SaveSHArKFile;
            sfd.ValidateNames   = true;

            //Open the Dialog and get the result
            Nullable <Boolean> result = sfd.ShowDialog();

            //If the user clicked OK, save the file by firing
            //the SaveSpectrumAsEvent.
            if (result == true)
            {
                this._eventAggregator.GetEvent <SaveSpectrumAsEvent>().Publish(sfd.FileName);
            }
        }