示例#1
0
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            //Initializing File Store
            if (!Directory.Exists(CodeTalkFileStorePath))
            {
                Directory.CreateDirectory(CodeTalkFileStorePath);
            }
            if (!Directory.Exists(TonesPath))
            {
                Directory.CreateDirectory(TonesPath);
            }

            //Loading CodeTalk config
            LoadCodeTalkConfig();

            //Adding Focus changed event
            CurrentProcessId = System.Diagnostics.Process.GetCurrentProcess().Id;
            Automation.AddAutomationFocusChangedEventHandler(OnFocusChangedHandler);

            //Keyboard Hook
            if (null != keyboardManager)
            {
                keyboardManager.Dispose();
            }
            keyboardManager = new KeyboardManager();
            keyboardManager.AddKeyboardHook();


            //Visual Studio close event
            m_packageDTEEvents = ApplicationObject.Events.DTEEvents;
            ShutdownHandler    = new _dispDTEEvents_OnBeginShutdownEventHandler(HandleVisualStudioShutdown);
            m_packageDTEEvents.OnBeginShutdown += ShutdownHandler;

            base.Initialize();
            FunctionsListToolWindowCommand.Initialize(this);
            CodeTalk.UI.TalkpointToolWindowCommand.Initialize(this);

            currentPackage = this;

            vsOperations = new VSOperations();

            codeTalkWebSocketServer = new CodeTalkWebSocketServer();

            TalkCodePackageBreakpointHandler = new FunctionLevelDetailsHandler(codeTalkWebSocketServer);
            vsOperations.SetBreakpointHandler(TalkCodePackageBreakpointHandler);

            SetProfilepointsCommand.vsOperations = vsOperations;
            TextToSpeech.IsTextToSpeechEnabled   = true;
            AboutCommand.Initialize(this);
            CodeTalkOptionsCommand.Initialize(this);
            CodeTalk.UI.GetSummaryToolWindowCommand.Initialize(this);
        }
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 public static void Initialize(Package package)
 {
     Instance = new CodeTalkOptionsCommand(package);
 }