예제 #1
0
 private IEnumerable <string> GetPropertyNamespaces()
 {
     foreach (var ns in Type.GetUsedNamespaces())
     {
         yield return(ns);
     }
     if (BackingField != null)
     {
         foreach (var ns in BackingField.GetUsedNamespaces())
         {
             yield return(ns);
         }
     }
     if (HasGetter)
     {
         foreach (var ns in Getter.GetUsedNamespaces())
         {
             yield return(ns);
         }
     }
     if (HasSetter)
     {
         foreach (var ns in Setter.GetUsedNamespaces())
         {
             yield return(ns);
         }
     }
     if (ExplicitInterface != null)
     {
         foreach (var ns in ExplicitInterface.GetUsedNamespaces(true))
         {
             yield return(ns);
         }
     }
 }
예제 #2
0
        public void ExplicitInterfaceProperty()
        {
            var obj = new ExplicitInterface();

            obj.Property = "foo";
            IExplicitInterface intf = obj;

            AssertEquals(intf.Property, "foo");
        }
예제 #3
0
        public void ExplicitInterfacePropertyReflection()
        {
            var obj = new ExplicitInterface();

            obj.Property = "foo";
            IExplicitInterface intf = obj;
            Expression <Func <IExplicitInterface, object> > expression = x => x.Property;
            var compiled = expression.Compile();
            var value    = compiled(intf);

            AssertEquals(value, "foo");
        }
예제 #4
0
 public void FilterNamespace(NamespaceFilter filter)
 {
     ReturnType.FilterNamespace(filter);
     ExplicitInterface?.FilterNamespace(filter);
     foreach (var name in Generics)
     {
         name.FilterNamespace(filter);
     }
     foreach (var parameter in Parameters)
     {
         parameter.TypeName.FilterNamespace(filter);
     }
 }
예제 #5
0
        /// <summary>
        /// Returns deep clone of qualified name.
        /// </summary>
        public virtual DotNetQualifiedName Clone()
        {
            DotNetQualifiedName clonedFullNamespace = null;

            if (FullNamespace != null)
            {
                clonedFullNamespace = FullNamespace.Clone();
            }

            DotNetQualifiedName clonedExplicitInterface = null;

            if (ExplicitInterface != null)
            {
                clonedExplicitInterface = ExplicitInterface.Clone();
            }

            return(new DotNetQualifiedName(localName, clonedFullNamespace, clonedExplicitInterface));
        }
예제 #6
0
 public void removeObserver(ExplicitInterface observer)
 {
     this.observers.Remove(observer);
 }
예제 #7
0
 public void addObserver(ExplicitInterface observer)
 {
     this.observers.Add(observer);
 }
예제 #8
0
 public void ExplicitInterfacePropertyReflection()
 {
     var obj = new ExplicitInterface();
     obj.Property = "foo";
     IExplicitInterface intf = obj;
     Expression<Func<IExplicitInterface, object>> expression = x => x.Property;
     var compiled = expression.Compile();
     var value = compiled(intf);
     AssertEquals(value, "foo");
 }
예제 #9
0
 public void ExplicitInterfaceProperty()
 {
     var obj = new ExplicitInterface();
     obj.Property = "foo";
     IExplicitInterface intf = obj;
     AssertEquals(intf.Property, "foo");
 }