private void InitFromDeclaration(IJavaMethodDeclaration declaration) { RaiseChangedEvent = false; try { ClearModifiers(); if (JavaLanguage.Instance.IsForbiddenName(declaration.Name)) { throw new BadSyntaxException(Strings.ErrorInvalidName); } if (JavaLanguage.Instance.IsForbiddenTypeName(declaration.Type)) { throw new BadSyntaxException(Strings.ErrorInvalidTypeName); } ValidName = declaration.Name; ValidType = declaration.Type; ArgumentList.InitFromDeclaration(declaration.ArgumentList); AccessModifier = declaration.AccessModifier; IsStatic = declaration.IsStatic; IsAbstract = declaration.IsAbstract; IsSealed = declaration.IsSealed; } finally { RaiseChangedEvent = true; } }
private void InitFromDeclaration(IJavaConstructorDeclaration declaration) { RaiseChangedEvent = false; try { ValidName = declaration.Name; AccessModifier = declaration.AccessModifier; ArgumentList.InitFromDeclaration(declaration.ArgumentList); } finally { RaiseChangedEvent = true; } }
private void InitFromDeclaration(ICSharpPropertyDeclaration declaration) { RaiseChangedEvent = false; try { ClearModifiers(); ReadAccess = AccessModifier.Default; WriteAccess = AccessModifier.Default; ArgumentList.InitFromDeclaration(declaration.ArgumentList); // Validating identifier's name if ((declaration.Name != "this" || !HasParameter) && CSharpLanguage.Instance.IsForbiddenName(declaration.Name)) { throw new BadSyntaxException(Strings.ErrorInvalidName); } else { ValidName = declaration.Name; } // Validating type's name if (CSharpLanguage.Instance.IsForbiddenTypeName(declaration.Type)) { throw new BadSyntaxException(Strings.ErrorInvalidTypeName); } else { ValidType = declaration.Type; } IsExplicitImplementation = declaration.IsExplicitImplementation; AccessModifier = declaration.AccessModifier; IsReadonly = declaration.IsReadonly; IsWriteonly = declaration.IsWriteonly; ReadAccess = declaration.ReadAccess; WriteAccess = declaration.WriteAccess; IsStatic = declaration.IsStatic; IsVirtual = declaration.IsVirtual; IsAbstract = declaration.IsAbstract; IsOverride = declaration.IsOverride; IsSealed = declaration.IsSealed; IsHider = declaration.IsHider; } finally { RaiseChangedEvent = true; } }
private void InitFromDeclaration(ICSharpMethodDeclaration declaration) { RaiseChangedEvent = false; try { ClearModifiers(); if (CSharpLanguage.Instance.IsForbiddenName(declaration.Name)) { throw new BadSyntaxException(Strings.ErrorInvalidName); } if (CSharpLanguage.Instance.IsForbiddenTypeName(declaration.Type)) { throw new BadSyntaxException(Strings.ErrorInvalidTypeName); } ValidName = declaration.Name; ValidType = declaration.Type; isOperator = declaration.IsOperator; isConversionOperator = declaration.IsConversionOperator; if (IsOperator) { ClearModifiers(); IsStatic = true; AccessModifier = AccessModifier.Public; } else { AccessModifier = declaration.AccessModifier; } IsExplicitImplementation = declaration.IsExplicitImplementation; ArgumentList.InitFromDeclaration(declaration.ArgumentList); if (!declaration.IsSealed && !declaration.IsOverride) { IsVirtual = declaration.IsVirtual; } IsStatic = declaration.IsStatic; IsAbstract = declaration.IsAbstract; IsOverride = declaration.IsOverride; IsSealed = declaration.IsSealed; IsHider = declaration.IsHider; } finally { RaiseChangedEvent = true; } }
private void InitFromDeclaration(ICSharpConstructorDeclaration declaration) { RaiseChangedEvent = false; try { ClearModifiers(); ValidName = declaration.Name; AccessModifier = declaration.AccessModifier; ArgumentList.InitFromDeclaration(declaration.ArgumentList); IsStatic = declaration.IsStatic; } finally { RaiseChangedEvent = true; } }