tools/VsIdeHostAdapter/TargetAddIn/HostSide/VsIdeHostAdapterRunConfigControl.cs
/// <summary>
/// Called by the main editor to load the data into UI.
/// </summary>
/// <param name="data">host specific data</param>
Called by the main editor to load the data into UI.
Called by the main editor to load the data into UI .
[SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions")] 
        void IRunConfigurationCustomHostEditor.SetData(IHostSpecificRunConfigurationData data)
        {
            string currentVersion = VSRegistry.GetDefaultVersion();  
            VsIdeHostRunConfigData vsIdeHostData = data as VsIdeHostRunConfigData;
            if (vsIdeHostData == null)
            {
                vsIdeHostData = new VsIdeHostRunConfigData(currentVersion);
                SetDirty();
            }
            else if (!m_hiveCombo.Items.Contains(vsIdeHostData.RegistryHive))
            {
                MessageBox.Show(
                    this, 
                    Resources.WrongVSVersionPassedToRunConfigControl(vsIdeHostData.RegistryHive, currentVersion),
                    Resources.MicrosoftVisualStudio);
                vsIdeHostData.RegistryHive = currentVersion;
                SetDirty();
            }
            m_data = vsIdeHostData;
            int selectedIndex = m_hiveCombo.Items.IndexOf(vsIdeHostData.RegistryHive);
            if (selectedIndex < 0)
            {
                selectedIndex = m_hiveCombo.Items.IndexOf(currentVersion);
                Debug.Assert(selectedIndex >= 0);
            }
            if (selectedIndex >= 0)
            {
                m_hiveCombo.SelectedIndex = selectedIndex;
            }
            m_additionalCommandLineArgumentsEdit.Text = vsIdeHostData.AdditionalCommandLineArguments;
            m_additionalTestDataEdit.Text = vsIdeHostData.AdditionalTestData;
        }
[ SuppressMessage ( " " , " " ) ] void IRunConfigurationCustomHostEditor . SetData ( IHostSpecificRunConfigurationData data ) { string currentVersion = VSRegistry . GetDefaultVersion ( ) ; VsIdeHostRunConfigData vsIdeHostData = data as VsIdeHostRunConfigData ; if ( vsIdeHostData == null ) { vsIdeHostData = new VsIdeHostRunConfigData ( currentVersion ) ; SetDirty ( ) ; } else if ( ! m_hiveCombo . Items . Contains ( vsIdeHostData . RegistryHive ) ) { MessageBox . Show ( this , Resources . WrongVSVersionPassedToRunConfigControl ( vsIdeHostData . RegistryHive , currentVersion ) , Resources . MicrosoftVisualStudio ) ; vsIdeHostData . RegistryHive = currentVersion ; SetDirty ( ) ; } m_data = vsIdeHostData ; int selectedIndex = m_hiveCombo . Items . IndexOf ( vsIdeHostData . RegistryHive ) ; if ( selectedIndex < 0 ) { selectedIndex = m_hiveCombo . Items . IndexOf ( currentVersion ) ; Debug . Assert ( selectedIndex >= 0 ) ; } if ( selectedIndex >= 0 ) { m_hiveCombo . SelectedIndex = selectedIndex ; } m_additionalCommandLineArgumentsEdit . Text = vsIdeHostData . AdditionalCommandLineArguments ; m_additionalTestDataEdit . Text = vsIdeHostData . AdditionalTestData ; }
Called by the main editor to load the data into UI.
Called by the main editor to load the data into UI .
// TODO: should we care about rightAlign? -- no unless we ship this HA. // Throws if VS is not installed. // TODO: SetDirty() that set run config to dirty is disabled in parent during Initialize/SetData, so this makes no effect. // If .testrunconfig file has VS version that we do not have in combobox, // show message box and use default version. // TODO: SetDirty() that set run config to dirty is disabled in parent during Initialize/SetData, so this makes no effect. // Set the data.
data
IHostSpecificRunConfigurationData
host specific data
host specific data