コード例 #1
0
 /// <summary>
 /// Called by Loupe to indicate the configuration of the add in has changed at runtime
 /// </summary>
 public void ConfigurationChanged()
 {
     m_CommonConfig = (CommonConfig)m_Context.Configuration.Common;
     m_UserConfig   = (UserConfig)m_Context.Configuration.User;
     m_HubConfig    = (ServerConfig)m_Context.Configuration.Server;
 }
コード例 #2
0
 /// <summary>
 /// Called by Loupe to indicate the configuration of the add in has changed at runtime
 /// </summary>
 public void ConfigurationChanged()
 {
     m_CommonConfig = (CommonConfig)m_Context.Configuration.Common;
     m_UserConfig = (UserConfig)m_Context.Configuration.User;
     m_HubConfig = (ServerConfig)m_Context.Configuration.Server;
 }
コード例 #3
0
        /// <summary>
        /// Called by Loupe to have the configuration editor display itself and edit the provided configuration
        /// </summary>
        /// <param name="context">The Add In Context provides a connection to the hosting environment.</param><param name="configuration">The current configuration.</param><param name="initialConfiguration">Indicates if the configuration has ever completed in the current environment.</param>
        /// <returns>
        /// DialogResult.OK if the configuration is complete and should be accepted as the new configuration.  Any other result to cancel.  If this
        ///             is the initial configuration and it is not OK the add in will not be enabled.
        /// </returns>
        public DialogResult EditConfiguration(IRepositoryContext context, IRepositoryConfiguration configuration, bool initialConfiguration)
        {
            m_Context = context;

            m_WorkingConfiguration = configuration;

            //make SURE we have a configuration.
            m_WorkingCommonConfig = configuration.Common as CommonConfig;
            m_WorkingServerConfig = configuration.Server as ServerConfig;

            if (context.Environment == LoupeEnvironment.Desktop)
            {
                m_WorkingUserConfig = configuration.User as UserConfig;
            }

            if (m_WorkingCommonConfig == null)
            {
                m_WorkingCommonConfig = new CommonConfig();
            }

            if (m_WorkingServerConfig == null)
            {
                m_WorkingServerConfig = new ServerConfig();
            }

            if (m_WorkingUserConfig == null)
            {
                m_WorkingUserConfig = new UserConfig();
            }

            if (context.Environment == LoupeEnvironment.Desktop)
            {
                localAccountInformation.Visible = true;
            }
            else
            {
                localAccountInformation.Visible = false;
                m_UserIsValid = true;
            }

            if (initialConfiguration)
            {
                //set our default tab to the correct tab
                mainTabControl.SelectedTab = serverTab;
            }
            else
            {
                mainTabControl.SelectedTab = mappingTab;
            }

            CaseStatusList.DataBindings.Add("SelectedValue", m_WorkingUserConfig, "CaseStatusFilter");
            LastUpdatedList.DataBindings.Add("SelectedValue", m_WorkingUserConfig, "LastUpdatedFilter");

            DialogResult result = ShowDialog();

            if (result == DialogResult.OK)
            {
                configuration.Common = m_WorkingCommonConfig;
                configuration.Server = m_WorkingServerConfig;

                if (context.Environment == LoupeEnvironment.Desktop)
                {
                    configuration.User = m_WorkingUserConfig;
                }
            }

            CaseStatusList.DataBindings.Clear();
            LastUpdatedList.DataBindings.Clear();

            return(DialogResult.OK);
        }