Inheritance: Microsoft.VisualStudio.Shell.Package
Esempio n. 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
        /// Visual Studio.
        /// </summary>
        /// <param name="token">Cancellation token that can signal abort.</param>
        /// <param name="progress">The progress indicator.</param>
        protected override async System.Threading.Tasks.Task InitializeAsync(
            CancellationToken token,
            IProgress <ServiceProgressData> progress)
        {
            Instance = this;

            if (Directory.Exists(Options.ExtensionsDir))
            {
                _engine = new EngineWrapper(Options.ExtensionsDir);
            }
            else
            {
                _engine = new EngineWrapper(null);
            }

            try
            {
                if (File.Exists(Options.MnemonicsConfiguration))
                {
                    MnemonicParser.MergeConfiguration(Options.MnemonicsConfiguration);
                }
            }
            catch
            {
                await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(token);

                ShowCriticalError(
                    $"Failed to load mnemonics configuration from {Options.MnemonicsConfiguration}");
            }

            SortCssPropertiesCommand.Initialize(this);

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(token);

            Options = GetDialogPage(typeof(Options)) as Options;

            if (Options.WriteDebugMessages)
            {
                var pane = GetOutputPane(VSConstants.OutputWindowPaneGuid.DebugPane_guid, Vsix.Name);
                Tracer.Initialize(pane);
            }
        }
Esempio n. 2
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
        /// Visual Studio.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            Instance = this;
            Options  = GetDialogPage(typeof(Options)) as Options;

            if (Options.WriteDebugMessages)
            {
                var pane = GetOutputPane(VSConstants.OutputWindowPaneGuid.DebugPane_guid, "Emmet.NET");
                Tracer.Initialize(pane);
            }

            if (Directory.Exists(Options.ExtensionsDir))
            {
                _engine = new EngineWrapper(Options.ExtensionsDir);
            }
            else
            {
                _engine = new EngineWrapper(null);
            }
        }
Esempio n. 3
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
        /// Visual Studio.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            Instance = this;
            Options = GetDialogPage(typeof(Options)) as Options;

            if (Options.WriteDebugMessages)
            {
                var pane = GetOutputPane(VSConstants.OutputWindowPaneGuid.DebugPane_guid, "Emmet.NET");
                Tracer.Initialize(pane);
            }

            if (Directory.Exists(Options.ExtensionsDir))
                _engine = new EngineWrapper(Options.ExtensionsDir);
            else
                _engine = new EngineWrapper(null);
        }