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);
            }
Ejemplo n.º 2
0
 public void SetStatic(bool value)
 {
     _fieldDeclaration.SetStatic(value);
 }