@@ -174,149 +174,6 @@ public IRenderingContext GetFullyExtendedContext(IRenderingContext macroContext,
174174 return ExtendAndSubstitute ( macroContext , extendedMacro , ref macroStack , _extensionSubstitutor ) ;
175175 }
176176
177-
178-
179-
180-
181-
182-
183-
184-
185-
186-
187-
188-
189- //
190- // /// <summary>
191- // /// Expands the given macro and uses it to replace the element exposed by the given context.
192- // /// </summary>
193- // /// <param name="context">The context to expand.</param>
194- // /// <param name="macro">The macro element to replace the original.</param>
195- // public virtual IRenderingContext ExpandAndReplace(IRenderingContext context, IZptElement macro)
196- // {
197- // if(context == null)
198- // {
199- // throw new ArgumentNullException(nameof(context));
200- // }
201- // if(macro == null)
202- // {
203- // throw new ArgumentNullException(nameof(macro));
204- // }
205- // if(macro.GetMetalAttribute(ZptConstants.Metal.DefineMacroAttribute) == null)
206- // {
207- // string message = String.Format(ExceptionMessages.MetalMacroMustBeDefined,
208- // ZptConstants.Metal.DefineMacroAttribute,
209- // ZptConstants.Metal.Namespace);
210- // throw new ArgumentException(message, "macro");
211- // }
212- //
213- // var macroContext = context.CreateSiblingContext(macro);
214- //
215- // macroContext = this.ApplyMacroExtension(macroContext);
216- // var extendedMacro = context.Element.ReplaceWith(macroContext.Element);
217- //
218- // this.FillSlots(context, extendedMacro);
219- //
220- // return context.CreateSiblingContext(extendedMacro);
221- // }
222- //
223- // /// <summary>
224- // /// Fills slots defined in the <paramref name="macro"/> with content defined in the <paramref name="sourceContext"/>.
225- // /// </summary>
226- // /// <param name="sourceContext">Source rendering context.</param>
227- // /// <param name="macro">The macro providing the slots to fill.</param>
228- // private void FillSlots(IRenderingContext sourceContext, IZptElement macro)
229- // {
230- // if(sourceContext == null)
231- // {
232- // throw new ArgumentNullException(nameof(sourceContext));
233- // }
234- // if(macro == null)
235- // {
236- // throw new ArgumentNullException(nameof(macro));
237- // }
238- //
239- // var slotsToHandle = (from defineSlot in this.GetElementsByValue(macro, ZptConstants.Metal.DefineSlotAttribute)
240- // join fillSlot in this.GetElementsByValue(sourceContext.Element, ZptConstants.Metal.FillSlotAttribute)
241- // on defineSlot.Key equals fillSlot.Key
242- // select new { Slot = sourceContext.CreateSiblingContext(defineSlot.Value),
243- // Filler = sourceContext.CreateSiblingContext(fillSlot.Value) });
244- //
245- // foreach(var replacement in slotsToHandle)
246- // {
247- // var replacementElement = replacement.Slot.Element.ReplaceWith(replacement.Filler.Element);
248- // var replacementContext = replacement.Filler.CreateSiblingContext(replacementElement);
249- // _annotator.ProcessAnnotation(replacementContext,
250- // originalContext: replacement.Slot,
251- // replacementContext: replacement.Filler);
252- // LogSlotFilling(replacement.Slot.Element, replacement.Filler.Element);
253- // }
254- // }
255- //
256- // /// <summary>
257- // /// Applies METAL macro extension, recursively extending the given macro where applicable.
258- // /// </summary>
259- // /// <returns>A rendering context, exposing the METAL macro element, after all required extension has been applied.</returns>
260- // /// <param name="context">The context exposing the macro element to expand.</param>
261- // private IRenderingContext ApplyMacroExtension(IRenderingContext context)
262- // {
263- // if(context == null)
264- // {
265- // throw new ArgumentNullException(nameof(context));
266- // }
267- //
268- // var extended = _macroFinder.GetExtendedMacro(context);
269- // IRenderingContext output;
270- //
271- // if(extended != null)
272- // {
273- // LogMacroExtension(context.Element, extended);
274- // output = ExpandAndReplace(context, extended);
275- // }
276- // else
277- // {
278- // output = context;
279- // }
280- //
281- // return output;
282- // }
283- //
284- // private void LogMacroUsage(IZptElement defineMacro, IZptElement useMacro)
285- // {
286- // ZptConstants.TraceSource.TraceEvent(System.Diagnostics.TraceEventType.Verbose,
287- // 4,
288- // Resources.LogMessageFormats.MacroUsage,
289- // defineMacro.GetMetalAttribute(ZptConstants.Metal.DefineMacroAttribute).Value,
290- // useMacro.GetFullFilePathAndLocation(),
291- // defineMacro.GetFullFilePathAndLocation(),
292- // nameof(MacroExpander),
293- // nameof(LogMacroUsage));
294- // }
295- //
296- // private void LogMacroExtension(IZptElement defineMacro, IZptElement extendedMacro)
297- // {
298- // ZptConstants.TraceSource.TraceEvent(System.Diagnostics.TraceEventType.Verbose,
299- // 4,
300- // Resources.LogMessageFormats.MacroExtension,
301- // defineMacro.GetMetalAttribute(ZptConstants.Metal.ExtendMacroAttribute).Value,
302- // extendedMacro.GetFullFilePathAndLocation(),
303- // defineMacro.GetFullFilePathAndLocation(),
304- // nameof(MacroExpander),
305- // nameof(LogMacroExtension));
306- // }
307- //
308- // private void LogSlotFilling(IZptElement defineSlot, IZptElement fillSlot)
309- // {
310- // ZptConstants.TraceSource.TraceEvent(System.Diagnostics.TraceEventType.Verbose,
311- // 4,
312- // Resources.LogMessageFormats.SlotFilling,
313- // fillSlot.GetMetalAttribute(ZptConstants.Metal.FillSlotAttribute).Value,
314- // defineSlot.GetFullFilePathAndLocation(),
315- // fillSlot.GetFullFilePathAndLocation(),
316- // nameof(MacroExpander),
317- // nameof(LogSlotFilling));
318- // }
319-
320177 #endregion
321178
322179 #region constructor
0 commit comments