protected override Action <ITextControl> ExecutePsiTransaction(ISolution solution, IProgressIndicator progress)
            {
                if (myIsSerialized)
                {
                    AttributeUtil.RemoveAttributeFromSingleDeclaration(myFieldDeclaration, KnownTypes.SerializeField);
                    if (myFieldDeclaration.GetAccessRights() == AccessRights.PUBLIC)
                    {
                        AttributeUtil.AddAttributeToSingleDeclaration(myFieldDeclaration,
                                                                      PredefinedType.NONSERIALIZED_ATTRIBUTE_CLASS, myModule, myElementFactory);
                    }
                }
                else
                {
                    if (myFieldDeclaration.IsStatic)
                    {
                        myFieldDeclaration.SetStatic(false);
                    }

                    if (myFieldDeclaration.IsReadonly)
                    {
                        myFieldDeclaration.SetReadonly(false);
                    }

                    AttributeUtil.RemoveAttributeFromSingleDeclaration(myFieldDeclaration,
                                                                       PredefinedType.NONSERIALIZED_ATTRIBUTE_CLASS);
                    if (myFieldDeclaration.GetAccessRights() != AccessRights.PUBLIC)
                    {
                        AttributeUtil.AddAttributeToSingleDeclaration(myFieldDeclaration, KnownTypes.SerializeField,
                                                                      myModule, myElementFactory);
                    }
                }

                return(null);
            }
Esempio n. 2
0
 public void SetReadonly(bool value)
 {
     _fieldDeclaration.SetReadonly(value);
 }
Esempio n. 3
0
 protected override Action <ITextControl> ExecutePsiTransaction(ISolution solution, IProgressIndicator progress)
 {
     myFieldDeclaration.SetReadonly(false);
     return(null);
 }