コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CodeReorderManager" /> class.
        /// </summary>
        /// <param name="package">The hosting package.</param>
        private CodeReorderManager(CodeMaidPackage package)
        {
            _package = package;

            _codeModelManager = CodeModelManager.GetInstance(_package);
            _undoTransactionHelper = new UndoTransactionHelper(_package, "CodeMaid Reorganize");

            _generateRegionLogic = GenerateRegionLogic.GetInstance(_package);
            _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(_package);
            _removeRegionLogic = RemoveRegionLogic.GetInstance(_package);
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CodeCleanupManager" /> class.
        /// </summary>
        /// <param name="package">The hosting package.</param>
        private CodeCleanupManager(CodeMaidPackage package)
        {
            _package = package;

            _codeModelManager = CodeModelManager.GetInstance(_package);
            _codeReorderManager = CodeReorderManager.GetInstance(_package);
            _undoTransactionHelper = new UndoTransactionHelper(_package, "CodeMaid Cleanup");

            _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(_package);
            _commentFormatLogic = CommentFormatLogic.GetInstance(_package);
            _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(_package);
            _insertExplicitAccessModifierLogic = InsertExplicitAccessModifierLogic.GetInstance();
            _insertWhitespaceLogic = InsertWhitespaceLogic.GetInstance(_package);
            _removeRegionLogic = RemoveRegionLogic.GetInstance(_package);
            _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(_package);
            _updateLogic = UpdateLogic.GetInstance(_package);
            _usingStatementCleanupLogic = UsingStatementCleanupLogic.GetInstance(_package);
        }
コード例 #3
0
ファイル: CodeCleanupManager.cs プロジェクト: reima/codemaid
        /// <summary>
        /// Initializes a new instance of the <see cref="CodeCleanupManager" /> class.
        /// </summary>
        /// <param name="package">The hosting package.</param>
        private CodeCleanupManager(CodeMaidPackage package)
        {
            _package = package;

            _codeModelManager = CodeModelManager.GetInstance(_package);
            _codeReorganizationManager = CodeReorganizationManager.GetInstance(_package);
            _commandHelper = CommandHelper.GetInstance(_package);

            _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(_package);
            _commentFormatLogic = CommentFormatLogic.GetInstance(_package);
            _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(_package);
            _insertExplicitAccessModifierLogic = InsertExplicitAccessModifierLogic.GetInstance();
            _insertWhitespaceLogic = InsertWhitespaceLogic.GetInstance(_package);
            _fileHeaderLogic = FileHeaderLogic.GetInstance(_package);
            _removeRegionLogic = RemoveRegionLogic.GetInstance(_package);
            _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(_package);
            _updateLogic = UpdateLogic.GetInstance(_package);
            _usingStatementCleanupLogic = UsingStatementCleanupLogic.GetInstance(_package);
        }
コード例 #4
0
 /// <summary>
 /// Gets an instance of the <see cref="CodeModelManager" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <returns>An instance of the <see cref="CodeModelManager" /> class.</returns>
 internal static CodeModelManager GetInstance(CodeMaidPackage package)
 {
     return(_instance ?? (_instance = new CodeModelManager(package)));
 }
コード例 #5
0
        /// <summary>
        /// This method can be overriden by the derived class to execute any code that needs to run
        /// after the IVsWindowFrame is created. If the toolwindow has a toolbar with a combobox, it
        /// should make sure its command handler are set by the time they return from this method.
        /// This is called when someone set the Frame property.
        /// </summary>
        public override void OnToolWindowCreated()
        {
            base.OnToolWindowCreated();

            // Register for events to this window.
            ((IVsWindowFrame)Frame).SetProperty((int)__VSFPROPID.VSFPROPID_ViewHelper, this);

            // Package is not available at constructor time.
            if (Package != null)
            {
                // Get an instance of the code model manager.
                _codeModelManager = CodeModelManager.GetInstance(Package);
                _codeModelManager.CodeModelBuilt += OnCodeModelBuilt;

                // Pass the package over to the view model.
                _viewModel.Package = Package;

                // Attempt to initialize the Document, may have been set before Spade was created.
                if (Document == null)
                {
                    Document = Package.ActiveDocument;
                }

                var spadeContent = Content as FrameworkElement;
                if (spadeContent != null)
                {
                    spadeContent.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new Action(() => Package.ThemeManager.ApplyTheme()));
                }
            }
        }
コード例 #6
0
ファイル: CodeModelManager.cs プロジェクト: reima/codemaid
 /// <summary>
 /// Gets an instance of the <see cref="CodeModelManager" /> class.
 /// </summary>
 /// <param name="package">The hosting package.</param>
 /// <returns>An instance of the <see cref="CodeModelManager" /> class.</returns>
 internal static CodeModelManager GetInstance(CodeMaidPackage package)
 {
     return _instance ?? (_instance = new CodeModelManager(package));
 }