private void ApplyQualifierCodeStyle([NotNull] IReferenceExpression referenceExpression)
            {
                var psiServices = referenceExpression.GetPsiServices();

                psiServices.Transactions.Execute(
                    commandName: typeof(StaticMethodBehavior).FullName,
                    handler: () =>
                {
                    CodeStyleUtil.ApplyStyle <StaticQualifierStyleSuggestion>(referenceExpression);

                    var qualifierExpression = referenceExpression.QualifierExpression;
                    if (qualifierExpression != null && qualifierExpression.IsValid())
                    {
                        CodeStyleUtil.ApplyStyle <IBuiltInTypeReferenceStyleSuggestion>(qualifierExpression);
                    }
                });
            }
Example #2
0
 /// <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)
 {
     // TODO: This relies on the settings being correct
     // It should probably have a custom adviser that
     CodeStyleUtil.ApplyStyle <ThisQualifierCodeStyleSuggestion>(Utils.GetElementAtCaret(solution, textControl));
 }