예제 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="WelcomeToFieldWorksDlg"/> class.
        /// </summary>
        /// <param name="helpTopicProvider">Help topic provider</param>
        /// <param name="exception">Exception that was thrown if the previously requested
        /// project could not be opened.</param>
        /// <param name="showReportingRow">True (usually only on the first run) when we want to show the first-time warning about
        /// sending google analytics information</param>
        /// ------------------------------------------------------------------------------------
        public WelcomeToFieldWorksDlg(IHelpTopicProvider helpTopicProvider, StartupException exception, bool showReportingRow)
        {
            InitializeComponent();
            AccessibleName = GetType().Name;
            var fullAppName = Properties.Resources.kstidFLEx;

            SetCheckboxText = fullAppName;              // Setter uses the app name in a format string.

            if (exception == null || !exception.ReportToUser)
            {
                Text = fullAppName;
                Logger.WriteEvent("Opening 'Welcome to FieldWorks' dialog");
            }
            else
            {
                m_helpTopic = "khtpUnableToOpenProject";
                Text        = Properties.Resources.kstidUnableToOpenProjectCaption;
                m_lblProjectLoadError.Text = exception.Message;
                Logger.WriteEvent("Opening 'Unable to Open Project' dialog");
            }

            if (!showReportingRow)
            {
                reportingInfoLayout.Visible = false;
            }

            m_helpTopicProvider        = helpTopicProvider;
            helpProvider               = new HelpProvider();
            helpProvider.HelpNamespace = FwDirectoryFinder.CodeDirectory + m_helpTopicProvider.GetHelpString("UserHelpFile");
            helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(m_helpTopic));
            helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            receiveButton.Enabled = FLExBridgeHelper.IsFlexBridgeInstalled();
        }
예제 #2
0
        private void ValidateSettings()
        {
            // TODO: Remove dependency on AppSettings.cs to load app variables
            // using it here since SendGridService.cs is using AppSettings.SendGridTemplatesApiKey
            // directly to read send grid api key. Because of that we need to set AppSettings.SendGrid...
            // var directly. In future have SendGridService.cs depend on _settings.SendGridTemplatesApiKey
            AppSettings.SendGridTemplatesApiKey = Configuration["SendGridTemplatesApiKey"];
            AppSettings.ConnectionString        = Configuration["ConnectionString"];

            if (_settings.PubApiEndpoint == null ||
                _settings.ServiceBusConnectionString == null ||
                _settings.ServiceBusQueueName == null ||
                _settings.PubJobsQueueName == null ||
                _settings.ConnectionString == null ||
                _settings.ApiKey == null ||
                _settings.SendGridTemplatesApiKey == null ||
                _settings.TableStorageConnectionString == null ||
                _settings.MailTrackingTableName == null ||
                _settings.StorageTableName == null)
            {
                string message = ExceptionMessage.ApplicationMissingStartupVariables;
                var    ex      = new StartupException(message);
                throw ex;
            }
        }