YAMP.ParseContext.ApplyPlotTemplate C# (CSharp) Method

ApplyPlotTemplate() private method

Applies the template set for plots.
private ApplyPlotTemplate ( PlotValue plot ) : ParseContext
plot PlotValue The plot which will adjusted to the default values.
return ParseContext
        ParseContext ApplyPlotTemplate(PlotValue plot)
        {
            if (_defaultProperties.ContainsKey("plot"))
            {
                var bin = _defaultProperties["plot"];

                foreach (var pair in bin)
                {
                    try { SetFunction.AlterProperty(plot, pair.Key, pair.Value); }
                    catch { }
                }
            }

            if (_defaultProperties.ContainsKey("series"))
            {
                var bin = _defaultProperties["series"];

                foreach (var pair in bin)
                {
                    try
                    {
                        for(var i = 0; i < plot.Count; i++)
                            SetFunction.AlterSeriesProperty(plot, i, pair.Key, pair.Value);
                    }
                    catch { }
                }
            }

            return this;
        }