Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void OnLoaded(object sender, RoutedEventArgs e)
        {
            try
            {
                m_MruManager = new MruManager();
                m_MruManager.Initialize(
                    this,                       // owner form
                    menuItemRecentFiles,        // Recent Files menu item
                    menuItemFile,               // parent
                    m_RegistryPath);            // Registry path to keep MRU list

                m_MruManager.MruOpenEvent += delegate(object sender_, MruFileOpenEventArgs e_)
                {
                    SaveChangesOnDemand();
                    LoadFile(e_.FileName);
                };

                LoadSettings();

//                 TaskLauncher.TaskLaunch += new EventHandler<EventArg1Param<Task>>(OnTaskLaunch);
//                 TaskLauncher.TaskFinish += new EventHandler<EventArg1Param<Task>>(OnTaskFinish);
//                 TaskLauncher.TaskMessageSent += new EventHandler<EventArg2Params<int, bool>>(OnTaskMessageSent);
//                 TaskLauncher.TaskCountChanged += new EventHandler<EventArg1Param<int>>(OnTaskCountChanged);
//                 m_ReportControl.StartReporting += new EventHandler(OnStartReporting);
//                 m_ReportControl.StopReporting += new EventHandler(OnStopReporting);
//
                if (string.IsNullOrWhiteSpace(m_MruManager.GetFirstFileName) == false)
                {
                    LoadFile(m_MruManager.GetFirstFileName);
                }

                m_LastLeft   = Left;
                m_LastTop    = Top;
                m_LastWidth  = Width;
                m_LastHeight = Height;
            }
            catch (System.Exception ex)
            {
                LogManager.Instance.WriteException(ex);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void OnLoaded(object sender, RoutedEventArgs e)
        {
            try
            {
                m_MruManager = new MruManager();
                m_MruManager.Initialize(
                    this,						// owner form
                    menuItemRecentFiles,        // Recent Files menu item
                    menuItemFile,		        // parent
                    m_RegistryPath);			// Registry path to keep MRU list

                m_MruManager.MruOpenEvent += delegate(object sender_, MruFileOpenEventArgs e_)
                {
                    SaveChangesOnDemand();
                    LoadFile(e_.FileName);
                };

                LoadSettings();

            //                 TaskLauncher.TaskLaunch += new EventHandler<EventArg1Param<Task>>(OnTaskLaunch);
            //                 TaskLauncher.TaskFinish += new EventHandler<EventArg1Param<Task>>(OnTaskFinish);
            //                 TaskLauncher.TaskMessageSent += new EventHandler<EventArg2Params<int, bool>>(OnTaskMessageSent);
            //                 TaskLauncher.TaskCountChanged += new EventHandler<EventArg1Param<int>>(OnTaskCountChanged);
            //                 m_ReportControl.StartReporting += new EventHandler(OnStartReporting);
            //                 m_ReportControl.StopReporting += new EventHandler(OnStopReporting);
            //
                if (string.IsNullOrWhiteSpace(m_MruManager.GetFirstFileName) == false)
                {
                    LoadFile(m_MruManager.GetFirstFileName);
                }

                m_LastLeft = Left;
                m_LastTop = Top;
                m_LastWidth = Width;
                m_LastHeight = Height;
            }
            catch (System.Exception ex)
            {
                LogManager.Instance.WriteException(ex);
            }
        }