Logs stuff to a file created in c:\Documents and Settings\Username\Local Settings\Temp\Companyname\Productname\Log.txt
This class also has a rudimentary implementation of IStream. The only really implemented method is IStream.Write, the other methods of this interface are no-ops or throw a NotImplementedException.
Inheritance: IFWDisposable, IStream
Exemple #1
0
        public void OnPropertyChanged(string name)
        {
            CheckDisposed();

            switch (name)
            {
            default:
                break;

            /* remember, what XCore thinks of as a "Content Control", is what this AreaManager sees as a "tool".
             * with that in mind, this case is invoked when the user chooses a different tool.
             * the purpose of this code is to then store the name of that tool so that
             * next time we come back to this area, we can remember to use this same tool.
             */
            case "currentContentControlObject":
                string toolName = m_mediator.PropertyTable.GetStringProperty("currentContentControl", "");
                var    c        = (IxCoreContentControl)m_mediator.PropertyTable.GetValue("currentContentControlObject");
                m_mediator.PropertyTable.SetProperty("ToolForAreaNamed_" + c.AreaName, toolName);
                Logger.WriteEvent("Switched to " + toolName);
                // Should we report a tool change?
                if (m_lastToolChange.Date != DateTime.Now.Date)
                {
                    // new day has dawned (or just started up). Reset tool reporting.
                    m_toolsReportedToday.Clear();
                    m_lastToolChange = DateTime.Now;
                }
                string areaNameForReport = m_mediator.PropertyTable.GetStringProperty("areaChoice", null);
                if (!string.IsNullOrWhiteSpace(areaNameForReport) && !m_toolsReportedToday.Contains(toolName))
                {
                    m_toolsReportedToday.Add(toolName);
                    UsageReporter.SendNavigationNotice("SwitchToTool/{0}/{1}", areaNameForReport, toolName);
                }
                break;

            case "areaChoice":
                string areaName = m_mediator.PropertyTable.GetStringProperty("areaChoice", null);

                if (string.IsNullOrEmpty(areaName))
                {
                    break;                            //this can happen when we use this property very early in the initialization
                }
                //for next startup
                m_mediator.PropertyTable.SetProperty("InitialArea", areaName);

                ActivateToolForArea(areaName);
                break;
            }
        }
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="WelcomeToFieldWorksDlg"/> class.
        /// </summary>
        /// <param name="helpTopicProvider">Help topic provider</param>
        /// <param name="appAbbrev">Standard application abbreviation.</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, string appAbbrev, StartupException exception, bool showReportingRow)
        {
            m_appAbbrev = appAbbrev;
            InitializeComponent();
            AccessibleName = GetType().Name;
            var fullAppName = AppIsFlex ? Properties.Resources.kstidFLEx : Properties.Resources.kstidTE;

            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 =
                ClientServerServices.Current.Local.DefaultBackendType != FDOBackendProviderType.kDb4oClientServer &&
                FLExBridgeHelper.IsFlexBridgeInstalled();
        }
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Log the dialog result
 /// </summary>
 /// <param name="e"></param>
 /// ------------------------------------------------------------------------------------
 protected override void OnClosing(CancelEventArgs e)
 {
     Logger.WriteEvent("Closing dialog: " + m_dlgResult);
     base.OnClosing(e);
 }