Esempio n. 1
0
        public override void VisitVariableDeclaration(VariableDeclarationSyntax node)
        {
            ITypeSymbol typeOfNode = _model.GetTypeInfo(node).Type;

            if (typeOfNode.Equals(typeof(DataLoadOptions)))
            {
                this._dataLoadOptionsVariables.Add(node);
            }
            else
            {
                DataContextDeclaration <LINQToSQL> dataContextDeclaration = _dataContextDeclarations.Where(x => x.Name == typeOfNode.ToString()).FirstOrDefault();

                if (dataContextDeclaration != null)
                {
                    this._dataContextVariables.Add(node);
                    var dataContextInitializationStatement = new DataContextInitializationStatement <LINQToSQL>(dataContextDeclaration, node.GetCompilationInfo(_model));
                    this._dataContextInitializationStatements.Add(dataContextInitializationStatement);
                }
            }
            base.VisitVariableDeclaration(node);
        }