Example #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();
        }
Example #2
0
 public void ReceiveButtonIsDisabled()
 {
     using (var dlg = new WelcomeToFieldWorksDlg(new FlexHelpTopicProvider(), null, false))
     {
         var receiveButton = ReflectionHelper.GetField(dlg, "receiveButton") as Button;
         if (FLExBridgeHelper.IsFlexBridgeInstalled())
         {
             Assert.That(receiveButton.Enabled, Is.True);
         }
         else
         {
             Assert.That(receiveButton.Enabled, Is.False);
         }
     }
 }