protected override Action <ITextControl> ExecutePsiTransaction(ISolution solution, IProgressIndicator progress) { if (myIsSerialized) { AttributeUtil.RemoveAttributeFromAllDeclarations(myFieldDeclaration, KnownTypes.SerializeField); if (myFieldDeclaration.GetAccessRights() == AccessRights.PUBLIC) { AttributeUtil.AddAttributeToEntireDeclaration(myMultipleFieldDeclaration, PredefinedType.NONSERIALIZED_ATTRIBUTE_CLASS, EmptyArray <AttributeValue> .Instance, myModule, myElementFactory); } } else { if (myFieldDeclaration.IsStatic) { ModifiersUtil.SetStatic(myMultipleFieldDeclaration, false); } if (myFieldDeclaration.IsReadonly) { ModifiersUtil.SetReadonly(myMultipleFieldDeclaration, false); } AttributeUtil.RemoveAttributeFromAllDeclarations(myFieldDeclaration, PredefinedType.NONSERIALIZED_ATTRIBUTE_CLASS); if (myFieldDeclaration.GetAccessRights() != AccessRights.PUBLIC) { AttributeUtil.AddAttributeToEntireDeclaration(myMultipleFieldDeclaration, KnownTypes.SerializeField, EmptyArray <AttributeValue> .Instance, myModule, myElementFactory); } } return(null); }
public UnionCasePart([NotNull] INestedTypeUnionCaseDeclaration declaration, [NotNull] ICacheBuilder cacheBuilder) : base(declaration, ModifiersUtil.GetDecoration(declaration), TreeNodeCollection <ITypeParameterOfTypeDeclaration> .Empty, cacheBuilder) { var unionShortName = declaration.GetContainingNode <IUnionDeclaration>()?.ShortName; ExtendsListShortNames = unionShortName != null ? new[] { cacheBuilder.Intern(unionShortName) } : EmptyArray <string> .Instance; }
private void FixReferencedMemberAccess(AccessRights memberAccessRights) { var declaration = _highlighting.LessVisibleReferencedMember.DeclaredElement .GetDeclarations().FirstOrDefault(); Contract.Assert(declaration != null); ModifiersUtil.SetAccessRights( declaration, memberAccessRights); }
protected FSharpTypeMembersOwnerTypePart([NotNull] IFSharpTypeOldDeclaration declaration, [NotNull] ICacheBuilder cacheBuilder) : base(declaration, ModifiersUtil.GetDecoration(declaration.AccessModifier, declaration.Attributes), declaration.TypeParameters, cacheBuilder) { var extendListShortNames = new FrugalLocalHashSet <string>(); extendListShortNames = ProcessMembers(declaration.TypeMembersEnumerable, extendListShortNames); if (declaration is IFSharpTypeDeclaration { TypeRepresentation : IObjectModelTypeRepresentation repr })
private void FixReferencedTypeAccess(AccessRights newTypeAccess) { var declaration = _highlighting.LessVisibleReferencedMember.DeclaredElement .With(x => x.GetContainingType()) .With(x => x.GetDeclarations().FirstOrDefault()); Contract.Assert(declaration != null); ModifiersUtil.SetAccessRights( declaration, newTypeAccess); }
protected override Action <ITextControl> ExecutePsiTransaction(ISolution solution, IProgressIndicator progress) { var declaration = _highlighting.ExceptionClass.GetDeclarations().FirstOrDefault(); Contract.Assert(declaration != null); ModifiersUtil.SetAccessRights( declaration, _highlighting.PreconditionContainer.TypeAccessRights); return(null); }
/// <summary> /// The execute transaction inner. /// </summary> /// <param name="solution"> /// The solution. /// </param> /// <param name="textControl"> /// The text control. /// </param> public override void ExecuteTransactionInner(ISolution solution, ITextControl textControl) { IElement element = Utils.GetElementAtCaret(solution, textControl); IElement containingElement = (IElement)element.GetContainingElement <IFieldDeclarationNode>(true) ?? element.GetContainingElement <IMultipleDeclarationNode>(true); if (containingElement == null) { ITreeNode treeNode = (ITreeNode)element; containingElement = treeNode.PrevSibling; } ModifiersUtil.SetAccessRights(containingElement, AccessRights.PRIVATE); }
public UnionCasePart([NotNull] INestedTypeUnionCaseDeclaration declaration, [NotNull] ICacheBuilder cacheBuilder) : base(declaration, ModifiersUtil.GetDecoration(declaration), TreeNodeCollection <ITypeParameterOfTypeDeclaration> .Empty, cacheBuilder) =>
public NestedModulePart([NotNull] INestedModuleDeclaration declaration, [NotNull] ICacheBuilder cacheBuilder) : base(declaration, declaration.GetNestedModuleShortName(cacheBuilder), ModifiersUtil.GetDecoration(declaration.AccessModifiers, declaration.AttributesEnumerable), cacheBuilder) { }
public override AccessRights GetAccessRights() => ModifiersUtil.GetAccessRights(AccessModifier);
public UnionCasePart([NotNull] IUnionCaseDeclaration declaration, [NotNull] ICacheBuilder cacheBuilder, bool isHiddenCase) : base(declaration, ModifiersUtil.GetDecoration(declaration), TreeNodeCollection <ITypeParameterOfTypeDeclaration> .Empty, cacheBuilder) { myIsHiddenCase = isHiddenCase; }
public HiddenTypePart([NotNull] IFSharpTypeDeclaration declaration, [NotNull] ICacheBuilder cacheBuilder) : base(declaration, ModifiersUtil.GetDecoration(declaration.AccessModifiers, declaration.AttributesEnumerable), declaration.TypeParameters, cacheBuilder) { }
protected override Action <ITextControl> ExecutePsiTransaction(ISolution solution, IProgressIndicator progress) { ModifiersUtil.SetReadonly(myFieldDeclarations, false); return(null); }