protected string MethodDeclaration(string name, ScopeAccess scope, string returnTypeName, IEnumerable <IHasParameterInfo> parameters) { return(MethodDeclaration(name, scope, false, returnTypeName, parameters)); }
protected override string FieldDeclaration(string name, ScopeAccess scope, bool isStatic, string fieldTypeName) { return ToStringHelper.ToStringWithCulture(scope) + " " + (isStatic ? "static " : "") + fieldTypeName + " " + MakeFieldName(name); }
protected override string PropertyDeclaration(string name, ScopeAccess scope, bool isStatic, string propertyTypeName) { return ToStringHelper.ToStringWithCulture(scope) + " " + (isStatic ? "static " : "") + propertyTypeName + " " + MakePublicName(name); }
protected override string FieldDeclaration(string name, ScopeAccess scope, bool isStatic, string fieldTypeName) { return(ToStringHelper.ToStringWithCulture(scope) + " " + (isStatic ? "static " : "") + fieldTypeName + " " + MakeFieldName(name)); }
protected override string PropertyDeclaration(string name, ScopeAccess scope, bool isStatic, string propertyTypeName) { return(ToStringHelper.ToStringWithCulture(scope) + " " + (isStatic ? "static " : "") + propertyTypeName + " " + MakePublicName(name)); }
static public bool CanAccess(this ScopeAccess item, Referenceable referenceable) { if (referenceable != null) { return(item.CanAccess(referenceable.GetScopeAccessLevel())); } return(false); }
protected override string MethodDeclaration(string name, ScopeAccess scope, bool isStatic, string returnTypeName, IEnumerable<IHasParameterInfo> parameters) { var indent = this.CurrentIndent + new string(' ', MethodContinueIndent); return ToStringHelper.ToStringWithCulture(scope) + " " + (isStatic ? "static " : "") + returnTypeName + " " + name + "(" + ParameterDeclarations(parameters) + ")"; }
protected override string MethodDeclaration(string name, ScopeAccess scope, bool isStatic, string returnTypeName, IEnumerable <IHasParameterInfo> parameters) { var indent = this.CurrentIndent + new string(' ', MethodContinueIndent); return(ToStringHelper.ToStringWithCulture(scope) + " " + (isStatic ? "static " : "") + returnTypeName + " " + name + "(" + ParameterDeclarations(parameters) + ")"); }
private void CheckClass(CodeFirstClass eventSource, string className, string namespaceName, ScopeAccess scopeAccess, string comments, string xmlCommentString) { Assert.AreEqual(className, eventSource.Name, "ClassName is wrong"); Assert.AreEqual(namespaceName, eventSource.Namespace, "Namespace is wrong"); Assert.AreEqual(scopeAccess, eventSource.ScopeAccess, "ScopeAccess is wrong"); Assert.AreEqual(comments, eventSource.Comments, "Comments is wrong"); Assert.AreEqual(xmlCommentString, eventSource.XmlCommentString, "XmlCommentString is wrong"); }
static public ScopeAccess GetFromInside(this ScopeAccess item) { switch (item) { case ScopeAccess.Inside: return(ScopeAccess.Inside); case ScopeAccess.Lateral: return(ScopeAccess.Lateral); case ScopeAccess.Outside: return(ScopeAccess.Outside); } return(ScopeAccess.Outside); }
static public bool CanAccess(this ScopeAccess item, ScopeAccessLevel modifier) { switch (item) { case ScopeAccess.Inside: return(Enumerable.New(ScopeAccessLevel.Private, ScopeAccessLevel.Protected, ScopeAccessLevel.Public).Has(modifier)); case ScopeAccess.Lateral: return(Enumerable.New(ScopeAccessLevel.Protected, ScopeAccessLevel.Public).Has(modifier)); case ScopeAccess.Outside: return(Enumerable.New(ScopeAccessLevel.Public).Has(modifier)); } return(false); }
private void CheckEventSource(CodeFirstEventSource eventSource, string name, bool isLocalized, string localizationResources, string eventSourceName, string namespaceName, ScopeAccess scopeAccess, string comments, string xmlCommentString) { Assert.AreEqual(name, eventSource.Name, "Name is wrong"); Assert.AreEqual(localizationResources, eventSource.LocalizationResources, "LocalizationResources is wrong"); Assert.AreEqual(isLocalized, eventSource.IsLocalized, "IsLocalized is wrong"); Assert.AreEqual(eventSourceName, eventSource.EventSourceName, "EventSourceName is wrong"); Assert.AreEqual(namespaceName, eventSource.Namespace, "Namespace is wrong"); Assert.AreEqual(scopeAccess, eventSource.ScopeAccess, "ScopeAccess is wrong"); Assert.AreEqual(comments, eventSource.Comments, "Comments is wrong"); Assert.AreEqual(xmlCommentString, eventSource.XmlCommentString, "XmlCommentString is wrong"); }
protected abstract string MethodDeclaration(string name, ScopeAccess scope, bool isStatic, string returnTypeName, IEnumerable <IHasParameterInfo> parameters);
protected abstract string FieldDeclaration(string name, ScopeAccess scope, bool isStatic, string fieldTypeName);
protected abstract string PropertyDeclaration(string name, ScopeAccess scope, bool isStatic, string propertyTypeNam);
protected string PropertyDeclaration(string name, ScopeAccess scope, string propertyTypeNam) { return(PropertyDeclaration(name, scope, false, propertyTypeNam)); }
static public IEnumerable <IEnumerable <T> > GetReferenceables <T>(this Scope item, string id, ScopeAccess access, IList <Scope> path) { return(item.GetReferenceables(id, access, path).InnerConvert <Referenceable, T>()); }
static public IEnumerable <IEnumerable <Referenceable> > GetReferenceables(this Scope item, string id, ScopeAccess access, IList <Scope> path) { if (item != null) { yield return(item.GetLocalReferenceables(id) .Narrow(r => access.CanAccess(r))); foreach (Scope scope in item.RetrieveMarkedInstanceValues <Scope, SidewaysScopeAttribute>()) { path.Add(scope); foreach (IEnumerable <Referenceable> enumerable in scope.GetReferenceables(id, access.GetFromSide(), path)) { yield return(enumerable); } path.PopLast(); } if (access == ScopeAccess.Inside) { Scope scope = item.GetParentScope(); path.Add(scope); foreach (IEnumerable <Referenceable> enumerable in scope.GetReferenceables(id, access.GetFromInside(), path)) { yield return(enumerable); } path.PopLast(); } } }
protected string FieldDeclaration(string name, ScopeAccess scope, string fieldTypeName) { return(FieldDeclaration(name, scope, false, fieldTypeName)); }
static public IEnumerable <IEnumerable <T> > GetReferenceables <T>(this ScopeElement item, string id, ScopeAccess access, IList <Scope> path) { return(item.GetLocalScope().GetReferenceables <T>(id, access, path)); }