- One element needs to be replaced by another. This is typically achieved by either calling the
ReplaceBy()method on the element to be replaced or, if this method is not available, by physically removing one element and adding another.
- An element needs to be inserted as a child of another element. In this case, there is typically a method in the API for doing exactly that.
The Element Factory
The Element Factory is a class which is used to manufacture all types of entities, be it statements or whole declarations. The element factory is created via a
GetInstance() method, which is supplied the corresponding
int @event = 0;
The Type Factory
Creating types is an important task in the ReSharper ecosystem. For example, say you wanted to write a context action to implement change notification in a class. This would require you to create, say, an
INotifyPropertyChanged interface type.
Please note that if you want to use the type to create, e.g., statements with the
$ notation, you cannot simply use the parameter of
IDeclaredType - you need to call
GetTypeElement() on it. For more information on the ReSharper type systems, please see 3.1 Type System.