internal static ParseRecorder CreateRecorders(TemplateParser parser)
        {
            if (_factories == null)
            {
                return(ParseRecorder.Null);
            }

            List <ParseRecorder> recorders = new List <ParseRecorder>();

            foreach (Func <ParseRecorder> factory in _factories)
            {
                ParseRecorder recorder = factory();

                if (recorder != null)
                {
                    recorders.Add(recorder);
                }
            }

            ParseRecorderList list = new ParseRecorderList(recorders);

            list.Initialize(parser);

            return(list);
        }
示例#2
0
        internal static ParseRecorder CreateRecorders(TemplateParser parser)
        {
            List <ParseRecorder> recorders = new List <ParseRecorder>();

            if (_factories != null)
            {
                foreach (Func <ParseRecorder> factory in _factories)
                {
                    ParseRecorder recorder = factory();

                    if (recorder != null)
                    {
                        recorders.Add(recorder);
                    }
                }
            }
            else
            {
                if (!BinaryCompatibility.Current.TargetsAtLeastFramework472)
                {
                    return(ParseRecorder.Null);
                }
            }

            // Support depedency injection in control type.
            // Have to replace the codeAssignStatement through a ParseRecorder,
            // because some existing ParseRecorder(e.g. PageInspector) may have hard dependency on the old codedom tree structure
            if (BinaryCompatibility.Current.TargetsAtLeastFramework472)
            {
                recorders.Add(new WebObjectActivatorParseRecorder());
            }

            ParseRecorderList list = new ParseRecorderList(recorders);

            list.Initialize(parser);

            return(list);
        }
示例#3
0
    private void InitializeParseRecorders() {
        if (FInDesigner)
            return;

        _parseRecorders = ParseRecorder.CreateRecorders(this);
    }