|
7 | 7 |
|
8 | 8 | namespace Microsoft.Generator.CSharp |
9 | 9 | { |
| 10 | + /// <summary> |
| 11 | + /// Base class for visiting and potentially modifying the output library. |
| 12 | + /// </summary> |
10 | 13 | public abstract class LibraryVisitor |
11 | 14 | { |
12 | 15 | internal virtual void Visit(OutputLibrary library) |
@@ -100,46 +103,94 @@ internal virtual void Visit(OutputLibrary library) |
100 | 103 | return type; |
101 | 104 | } |
102 | 105 |
|
| 106 | + /// <summary> |
| 107 | + /// Visits an <see cref="InputModelType"/> and the converted <see cref="ModelProvider"/> and returns a possibly modified version of the <see cref="ModelProvider"/>. |
| 108 | + /// </summary> |
| 109 | + /// <param name="model">The original input model.</param> |
| 110 | + /// <param name="type">The current conversion.</param> |
| 111 | + /// <returns>Null if it should be removed otherwise the modified version of the <see cref="ModelProvider"/>.</returns> |
103 | 112 | protected internal virtual ModelProvider? Visit(InputModelType model, ModelProvider? type) |
104 | 113 | { |
105 | 114 | return type; |
106 | 115 | } |
107 | 116 |
|
| 117 | + /// <summary> |
| 118 | + /// Visits an <see cref="InputModelProperty"/> and the converted <see cref="PropertyProvider"/> and returns a possibly modified version of the <see cref="PropertyProvider"/>. |
| 119 | + /// </summary> |
| 120 | + /// <param name="property">The original input model property.</param> |
| 121 | + /// <param name="propertyProvider">The current conversion.</param> |
| 122 | + /// <returns>Null if it should be removed otherwise the modified version of the <see cref="PropertyProvider"/>.</returns> |
108 | 123 | protected internal virtual PropertyProvider? Visit(InputModelProperty property, PropertyProvider? propertyProvider) |
109 | 124 | { |
110 | 125 | return propertyProvider; |
111 | 126 | } |
112 | 127 |
|
| 128 | + /// <summary> |
| 129 | + /// Visits an <see cref="InputEnumType"/> and the converted <see cref="TypeProvider"/> and returns a possibly modified version of the <see cref="TypeProvider"/>. |
| 130 | + /// </summary> |
| 131 | + /// <param name="enumType">The original input enum.</param> |
| 132 | + /// <param name="type">The current conversion.</param> |
| 133 | + /// <returns>Null if it should be removed otherwise the modified version of the <see cref="TypeProvider"/>.</returns> |
113 | 134 | protected internal virtual TypeProvider? Visit(InputEnumType enumType, TypeProvider? type) |
114 | 135 | { |
115 | 136 | return type; |
116 | 137 | } |
117 | 138 |
|
| 139 | + /// <summary> |
| 140 | + /// Visits a <see cref="TypeProvider"/> and returns a possibly modified version of it. |
| 141 | + /// </summary> |
| 142 | + /// <param name="type">The original <see cref="TypeProvider"/>.</param> |
| 143 | + /// <returns>Null if it should be removed otherwise the modified version of the <see cref="TypeProvider"/>.</returns> |
118 | 144 | protected virtual TypeProvider? Visit(TypeProvider type) |
119 | 145 | { |
120 | 146 | return type; |
121 | 147 | } |
122 | 148 |
|
| 149 | + /// <summary> |
| 150 | + /// Visits a <see cref="TypeProvider"/> after all its members have been visited and returns a possibly modified version of it. |
| 151 | + /// </summary> |
| 152 | + /// <param name="type">The original <see cref="TypeProvider"/>.</param> |
| 153 | + /// <returns>Null if it should be removed otherwise the modified version of the <see cref="TypeProvider"/>.</returns> |
123 | 154 | protected virtual TypeProvider? PostVisit(TypeProvider type) |
124 | 155 | { |
125 | 156 | return type; |
126 | 157 | } |
127 | 158 |
|
| 159 | + /// <summary> |
| 160 | + /// Visits a <see cref="ConstructorProvider"/> and returns a possibly modified version of it. |
| 161 | + /// </summary> |
| 162 | + /// <param name="constructor">The original <see cref="ConstructorProvider"/>.</param> |
| 163 | + /// <returns>Null if it should be removed otherwise the modified version of the <see cref="ConstructorProvider"/>.</returns> |
128 | 164 | protected virtual ConstructorProvider? Visit(ConstructorProvider constructor) |
129 | 165 | { |
130 | 166 | return constructor; |
131 | 167 | } |
132 | 168 |
|
| 169 | + /// <summary> |
| 170 | + /// Visits a <see cref="MethodProvider"/> and returns a possibly modified version of it. |
| 171 | + /// </summary> |
| 172 | + /// <param name="method">The original <see cref="MethodProvider"/>.</param> |
| 173 | + /// <returns>Null if it should be removed otherwise the modified version of the <see cref="MethodProvider"/>.</returns> |
133 | 174 | protected virtual MethodProvider? Visit(MethodProvider method) |
134 | 175 | { |
135 | 176 | return method; |
136 | 177 | } |
137 | 178 |
|
| 179 | + /// <summary> |
| 180 | + /// Visits a <see cref="PropertyProvider"/> and returns a possibly modified version of it. |
| 181 | + /// </summary> |
| 182 | + /// <param name="property">The original <see cref="PropertyProvider"/>.</param> |
| 183 | + /// <returns>Null if it should be removed otherwise the modified version of the <see cref="PropertyProvider"/>.</returns> |
138 | 184 | protected virtual PropertyProvider? Visit(PropertyProvider property) |
139 | 185 | { |
140 | 186 | return property; |
141 | 187 | } |
142 | 188 |
|
| 189 | + /// <summary> |
| 190 | + /// Visits a <see cref="FieldProvider"/> and returns a possibly modified version of it. |
| 191 | + /// </summary> |
| 192 | + /// <param name="field">The original <see cref="FieldProvider"/>.</param> |
| 193 | + /// <returns>Null if it should be removed otherwise the modified version of the <see cref="FieldProvider"/>.</returns> |
143 | 194 | protected virtual FieldProvider? Visit(FieldProvider field) |
144 | 195 | { |
145 | 196 | return field; |
|
0 commit comments