/// <summary>
        /// Removes a <see cref="String"/> based namespace inclusion scope
        /// coercion.
        /// </summary>
        /// <param name="namespaceName">The name of the namespace
        /// which was included by the <see cref="INamespaceInclusionScopeCoercion"/>.</param>
        /// <returns>true if the namespace name was found and removed; false, otherwise.</returns>
        public bool Remove(string namespaceName)
        {
            INamespaceInclusionScopeCoercion foundItem = null;

            foreach (var element in this)
            {
                if ((element is INamespaceInclusionScopeCoercion) &&
                    (foundItem = (INamespaceInclusionScopeCoercion)element).Namespace == namespaceName)
                {
                    break;
                }
                else
                {
                    foundItem = null;
                }
            }
            if (foundItem == null)
            {
                return(false);
            }
            lock (this.baseList)
                this.baseList.Remove(foundItem);
            return(true);
        }
Ejemplo n.º 2
0
 public abstract IScopeCoercion Transform(INamespaceInclusionScopeCoercion inclusion);
Ejemplo n.º 3
0
 void IScopeCoercionVisitor.Visit(INamespaceInclusionScopeCoercion scopeCoercion)
 {
     this.Translate(scopeCoercion);
 }
Ejemplo n.º 4
0
 TransformationImpact IInclusionVisitor <TransformationImpact> .Visit(INamespaceInclusionScopeCoercion inclusion)
 {
     return(CalculateRefactorImpact(inclusion));
 }
Ejemplo n.º 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="INamespaceInclusionScopeCoercion"/> which appeared previously in the
        /// active scope.</param>
        public static ICompilerSourceModelWarning <INamespaceInclusionScopeCoercion> WarningCS0105(INamespaceInclusionScopeCoercion coercion)
        {
            var start = coercion.Start ?? LineColumnPair.Zero;
            var end   = coercion.End ?? LineColumnPair.Zero;

            return(new CompilerSourceModelWarning <INamespaceInclusionScopeCoercion>(CS0105, coercion, coercion.Location, start, end, coercion.Namespace));
        }
Ejemplo n.º 6
0
 public TestLinkerResult Visit(INamespaceInclusionScopeCoercion namespaceInclusion, ICompilationContext context)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 7
0
 public abstract TransformationImpact CalculateRefactorImpact(INamespaceInclusionScopeCoercion inclusion);
Ejemplo n.º 8
0
 public abstract void Translate(INamespaceInclusionScopeCoercion inclusion);
Ejemplo n.º 9
0
 public TransformationKind Visit(INamespaceInclusionScopeCoercion namespaceInclusion, ITransformationContext context)
 {
     throw new NotImplementedException();
 }