C# Class MixinRefactoring.MixinCommandBase

base class for mixin operations
Inheritance: IMixinCommand
Datei anzeigen Open project: pgenfer/mixinSharp

Protected Properties

Property Type Description
_mixin MixinReference

Public Methods

Method Description
CanExecute ( ClassWithSourceCode childClass, Settings settings = null ) : bool

called to check if the command can be executed.

Execute ( Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax childDeclaration, Microsoft.CodeAnalysis.SemanticModel semantic, Settings settings = null ) : Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax

Template method that checks if command can be executed and if yes, executes the command. Otherwise the original source code of the child is returned.

Protected Methods

Method Description
InternalExecute ( ClassWithSourceCode childClass, Microsoft.CodeAnalysis.SemanticModel semantic, Settings settings = null ) : Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax

executes the command on the given child class. Logic of command execution must be implemented in derived classes.

MixinCommandBase ( MixinReference mixin ) : Microsoft.CodeAnalysis

initializes the base fields of the command object

Method Details

CanExecute() public abstract method

called to check if the command can be executed.
public abstract CanExecute ( ClassWithSourceCode childClass, Settings settings = null ) : bool
childClass ClassWithSourceCode
settings Settings optional settings
return bool

Execute() public method

Template method that checks if command can be executed and if yes, executes the command. Otherwise the original source code of the child is returned.
public Execute ( Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax childDeclaration, Microsoft.CodeAnalysis.SemanticModel semantic, Settings settings = null ) : Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax
childDeclaration Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax
semantic Microsoft.CodeAnalysis.SemanticModel semantic model of the child's and mixin's source code
settings Settings optional settings object
return Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax

InternalExecute() protected abstract method

executes the command on the given child class. Logic of command execution must be implemented in derived classes.
protected abstract InternalExecute ( ClassWithSourceCode childClass, Microsoft.CodeAnalysis.SemanticModel semantic, Settings settings = null ) : Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax
childClass ClassWithSourceCode
semantic Microsoft.CodeAnalysis.SemanticModel semantic model of the child's and mixin's source code
settings Settings optional settings object
return Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax

MixinCommandBase() protected method

initializes the base fields of the command object
protected MixinCommandBase ( MixinReference mixin ) : Microsoft.CodeAnalysis
mixin MixinReference mixin that should be added to the child class
return Microsoft.CodeAnalysis

Property Details

_mixin protected_oe property

a reference to the mixin that should be included in the child class
protected MixinReference,MixinRefactoring _mixin
return MixinReference