/// <summary>
        /// Removes an <paramref name="includedType"/> from the <see cref="ScopeCoercionCollection"/>
        /// provided it is present.
        /// </summary>
        /// <param name="includedType">The <see cref="IType"/> to remove.</param>
        /// <returns>true if the <paramref name="includedType"/> was found within the
        /// <see cref="IScopeCoercionCollection"/>.</returns>
        public bool Remove(IType includedType)
        {
            ITypeInclusionScopeCoercion foundItem = null;

            foreach (var element in this)
            {
                if ((element is ITypeInclusionScopeCoercion) &&
                    (foundItem = (ITypeInclusionScopeCoercion)element).IncludedType == includedType)
                {
                    break;
                }
                else
                {
                    foundItem = null;
                }
            }
            if (foundItem == null)
            {
                return(false);
            }
            lock (this.baseList)
                this.baseList.Remove(foundItem);
            return(true);
        }
Example #2
0
 public abstract IScopeCoercion Transform(ITypeInclusionScopeCoercion inclusion);
Example #3
0
 void IScopeCoercionVisitor.Visit(ITypeInclusionScopeCoercion scopeCoercion)
 {
     this.Translate(scopeCoercion);
 }
Example #4
0
 TransformationImpact IInclusionVisitor <TransformationImpact> .Visit(ITypeInclusionScopeCoercion inclusion)
 {
     return(CalculateRefactorImpact(inclusion));
 }
Example #5
0
        /// <summary><para>Creates a C&#9839; compiler warning, relative to the abstract model, (level 3) &#35;105:</para><para>The using directive for <paramref name="coercion"/> appeared previously in this namespace</para></summary>
        /// <param name="coercion">The <see cref="ITypeInclusionScopeCoercion"/> which appeared previously in the
        /// active scope.</param>
        public static ICompilerSourceModelWarning <ITypeInclusionScopeCoercion> WarningCS0105(ITypeInclusionScopeCoercion coercion)
        {
            var start = coercion.Start ?? LineColumnPair.Zero;
            var end   = coercion.End ?? LineColumnPair.Zero;

            return(new CompilerSourceModelWarning <ITypeInclusionScopeCoercion>(CS0105, coercion, coercion.Location, start, end, coercion.IncludedType.FullName));
        }
Example #6
0
 public TestLinkerResult Visit(ITypeInclusionScopeCoercion typeInclusion, ICompilationContext context)
 {
     throw new NotImplementedException();
 }
Example #7
0
 public abstract TransformationImpact CalculateRefactorImpact(ITypeInclusionScopeCoercion inclusion);
Example #8
0
 public abstract void Translate(ITypeInclusionScopeCoercion inclusion);
Example #9
0
 public TransformationKind Visit(ITypeInclusionScopeCoercion typeInclusion, ITransformationContext context)
 {
     throw new NotImplementedException();
 }