public GenericTypeTranslationContext(
            IDiscoveredTypeRegistrator discoveredTypeRegistrator,
            ITranslatedTypeMetadataFactory translatedTypeMetadataFactory,
            ISourceTypeMetadataFactory sourceTypeMetadataFactory,
            ITranslationContext translationContext,
            ISkipTypeRule skipTypeRule,
            ITypeScriptExpression expression,
            ISymbolNamer symbolNamer,
            ICommenter commenter,
            TypeInfo typeInfo)
        {
            DiscoveredTypeRegistrator = discoveredTypeRegistrator.NullToException(new ArgumentNullException(nameof(discoveredTypeRegistrator)));

            TranslatedTypeMetadataFactory = translatedTypeMetadataFactory
                                            .NullToException(new ArgumentNullException(nameof(translatedTypeMetadataFactory)));

            TranslatedTypeMetadata = TranslatedTypeMetadataFactory.CreateNew();

            SourceTypeMetadataFactory = sourceTypeMetadataFactory
                                        .NullToException(new ArgumentNullException(nameof(sourceTypeMetadataFactory)));

            SourceTypeMetadata = sourceTypeMetadataFactory.CreateNew();

            TranslationContext = translationContext.NullToException(new ArgumentNullException(nameof(translationContext)));
            SkipTypeRule       = skipTypeRule.NullToException(new ArgumentNullException(nameof(skipTypeRule)));
            Expression         = expression.NullToException(new ArgumentNullException(nameof(expression)));
            SymbolNamer        = symbolNamer.NullToException(new ArgumentNullException(nameof(symbolNamer)));
            Commenter          = commenter.NullToException(new ArgumentNullException(nameof(commenter)));
            TypeInfo           = typeInfo.NullToException(new ArgumentNullException(nameof(typeInfo)));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CommenterFilter"/> class for
        /// the specified text view and commenter.
        /// </summary>
        /// <param name="textViewAdapter"></param>
        /// <param name="textView">The text view.</param>
        /// <param name="commenter">The commenter implementation.</param>
        /// <param name="editorOperations">The <see cref="IEditorOperations"/> instance for the text view.</param>
        /// <param name="textUndoHistoryRegistry">The global <see cref="ITextUndoHistoryRegistry"/> service provided by
        /// Visual Studio.</param>
        /// <exception cref="ArgumentNullException">
        /// <para>If <paramref name="textViewAdapter"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="textView"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="commenter"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="editorOperations"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="textUndoHistoryRegistry"/> is <see langword="null"/>.</para>
        /// </exception>
        public CommenterFilter(IVsTextView textViewAdapter, ITextView textView, ICommenter commenter, IEditorOperations editorOperations, ITextUndoHistoryRegistry textUndoHistoryRegistry)
            : base(textViewAdapter)
        {
            if (textViewAdapter == null)
            {
                throw new ArgumentNullException(nameof(textViewAdapter));
            }
            if (textView == null)
            {
                throw new ArgumentNullException(nameof(textView));
            }
            if (commenter == null)
            {
                throw new ArgumentNullException(nameof(commenter));
            }
            if (editorOperations == null)
            {
                throw new ArgumentNullException(nameof(editorOperations));
            }
            if (textUndoHistoryRegistry == null)
            {
                throw new ArgumentNullException(nameof(textUndoHistoryRegistry));
            }

            this.TextView                = textView;
            this.Commenter               = commenter;
            this.EditorOperations        = editorOperations;
            this.TextUndoHistoryRegistry = textUndoHistoryRegistry;
            textView.Closed             += (sender, e) => Dispose();
        }
        public CommenterFilter(IVsTextView textViewAdapter, ITextView textView, ICommenter commenter)
            : base(textViewAdapter)
        {
            Contract.Requires(textViewAdapter != null);
            Contract.Requires <ArgumentNullException>(textView != null, "textView");
            Contract.Requires <ArgumentNullException>(commenter != null, "commenter");

            this.TextView    = textView;
            this.Commenter   = commenter;
            textView.Closed += (sender, e) => Dispose();
        }
        public CommenterFilter(IVsTextView textViewAdapter, ITextView textView, ICommenter commenter)
            : base(textViewAdapter)
        {
            Contract.Requires(textViewAdapter != null);
            Contract.Requires<ArgumentNullException>(textView != null, "textView");
            Contract.Requires<ArgumentNullException>(commenter != null, "commenter");

            this.TextView = textView;
            this.Commenter = commenter;
            textView.Closed += (sender, e) => Dispose();
        }
Exemple #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommenterFilter"/> class for
        /// the specified text view and commenter.
        /// </summary>
        /// <param name="textViewAdapter"></param>
        /// <param name="textView">The text view.</param>
        /// <param name="commenter">The commenter implementation.</param>
        /// <param name="editorOperations">The <see cref="IEditorOperations"/> instance for the text view.</param>
        /// <param name="textUndoHistoryRegistry">The global <see cref="ITextUndoHistoryRegistry"/> service provided by
        /// Visual Studio.</param>
        /// <exception cref="ArgumentNullException">
        /// <para>If <paramref name="textViewAdapter"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="textView"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="commenter"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="editorOperations"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="textUndoHistoryRegistry"/> is <see langword="null"/>.</para>
        /// </exception>
        public CommenterFilter(IVsTextView textViewAdapter, ITextView textView, ICommenter commenter, IEditorOperations editorOperations, ITextUndoHistoryRegistry textUndoHistoryRegistry)
            : base(textViewAdapter)
        {
            Contract.Requires(textViewAdapter != null);
            Contract.Requires <ArgumentNullException>(textView != null, "textView");
            Contract.Requires <ArgumentNullException>(commenter != null, "commenter");
            Contract.Requires <ArgumentNullException>(editorOperations != null, "editorOperations");
            Contract.Requires <ArgumentNullException>(textUndoHistoryRegistry != null, "textUndoHistoryRegistry");

            this.TextView                = textView;
            this.Commenter               = commenter;
            this.EditorOperations        = editorOperations;
            this.TextUndoHistoryRegistry = textUndoHistoryRegistry;
            textView.Closed             += (sender, e) => Dispose();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CommenterFilter"/> class for
        /// the specified text view and commenter.
        /// </summary>
        /// <param name="textViewAdapter"></param>
        /// <param name="textView">The text view.</param>
        /// <param name="commenter">The commenter implementation.</param>
        /// <param name="editorOperations">The <see cref="IEditorOperations"/> instance for the text view.</param>
        /// <param name="textUndoHistoryRegistry">The global <see cref="ITextUndoHistoryRegistry"/> service provided by
        /// Visual Studio.</param>
        /// <exception cref="ArgumentNullException">
        /// <para>If <paramref name="textViewAdapter"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="textView"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="commenter"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="editorOperations"/> is <see langword="null"/>.</para>
        /// <para>-or-</para>
        /// <para>If <paramref name="textUndoHistoryRegistry"/> is <see langword="null"/>.</para>
        /// </exception>
        public CommenterFilter(IVsTextView textViewAdapter, ITextView textView, ICommenter commenter, IEditorOperations editorOperations, ITextUndoHistoryRegistry textUndoHistoryRegistry)
            : base(textViewAdapter)
        {
            Contract.Requires(textViewAdapter != null);
            Contract.Requires<ArgumentNullException>(textView != null, "textView");
            Contract.Requires<ArgumentNullException>(commenter != null, "commenter");
            Contract.Requires<ArgumentNullException>(editorOperations != null, "editorOperations");
            Contract.Requires<ArgumentNullException>(textUndoHistoryRegistry != null, "textUndoHistoryRegistry");

            this.TextView = textView;
            this.Commenter = commenter;
            this.EditorOperations = editorOperations;
            this.TextUndoHistoryRegistry = textUndoHistoryRegistry;
            textView.Closed += (sender, e) => Dispose();
        }
 public DiscoveredTypeRegistrator(
     ISourceTypeMetadataFactory sourceTypeMetadataFactory,
     ITranslatedTypeMetadataFactory translatedTypeMetadataFactory,
     ITranslationContext translationContext,
     ISkipTypeRule skipTypeRule,
     ITypeScriptExpression expression,
     ISymbolNamer symbolNamer,
     ICommenter commenter)
 {
     // TODO NullCheck
     SourceTypeMetadataFactory     = sourceTypeMetadataFactory;
     TranslatedTypeMetadataFactory = translatedTypeMetadataFactory;
     TranslationContext            = translationContext;
     SkipTypeRule = skipTypeRule;
     Expression   = expression;
     SymbolNamer  = symbolNamer;
     Commenter    = commenter;
 }
        public EnumTypeTranslationContext(
            ITranslatedTypeMetadataFactory translatedTypeMetadataFactory,
            ITranslationContext translationContext,
            ITypeScriptExpression expression,
            ISymbolNamer symbolNamer,
            ICommenter commenter)
        {
            TranslatedTypeMetadata =
                translatedTypeMetadataFactory
                .NullToException(new ArgumentNullException(nameof(translatedTypeMetadataFactory)))
                .CreateNew();

            TranslationContext = translationContext.NullToException(new ArgumentNullException(nameof(translationContext)));

            Expression = expression.NullToException(new ArgumentNullException(nameof(expression)));

            SymbolNamer = symbolNamer.NullToException(new ArgumentNullException(nameof(symbolNamer)));

            Commenter = commenter.NullToException(new ArgumentNullException(nameof(commenter)));
        }
Exemple #9
0
        public CommenterFilter([NotNull] IVsTextView textViewAdapter, [NotNull] ITextView textView, [NotNull] ICommenter commenter)
            : base(textViewAdapter)
        {
            Debug.Assert(textViewAdapter != null);
            Requires.NotNull(textView, nameof(textView));
            Requires.NotNull(commenter, nameof(commenter));

            this.TextView    = textView;
            this.Commenter   = commenter;
            textView.Closed += (sender, e) => Dispose();
        }