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); } } }
public void ExplicitInterfaceProperty() { var obj = new ExplicitInterface(); obj.Property = "foo"; IExplicitInterface intf = obj; AssertEquals(intf.Property, "foo"); }
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"); }
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); } }
/// <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)); }
public void removeObserver(ExplicitInterface observer) { this.observers.Remove(observer); }
public void addObserver(ExplicitInterface observer) { this.observers.Add(observer); }
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"); }
public void ExplicitInterfaceProperty() { var obj = new ExplicitInterface(); obj.Property = "foo"; IExplicitInterface intf = obj; AssertEquals(intf.Property, "foo"); }