示例#1
0
        private void BuildCode(PropertySymbol propertySymbol)
        {
            if (propertySymbol.IsAbstract)
            {
                return;
            }

            ImplementationBuilder implBuilder = new ImplementationBuilder(options, errorHandler);

            SymbolImplementation getter = implBuilder.BuildPropertyGetter(propertySymbol);

            if (getter != null)
            {
                propertySymbol.AddImplementation(getter, /* getter */ true);
                implementations.Add(getter);
            }

            SymbolImplementation setter = implBuilder.BuildPropertySetter(propertySymbol);

            if (setter != null)
            {
                propertySymbol.AddImplementation(setter, /* getter */ false);
                implementations.Add(setter);
            }

            if (propertySymbol.AnonymousMethods != null)
            {
                foreach (AnonymousMethodSymbol anonymousMethod in propertySymbol.AnonymousMethods)
                {
                    Debug.Assert(anonymousMethod.Implementation != null);

                    implementations.Add(anonymousMethod.Implementation);
                }
            }
        }
示例#2
0
        private void BuildCode(IndexerSymbol indexerSymbol)
        {
            if (indexerSymbol.IsAbstract)
            {
                return;
            }

            ImplementationBuilder implBuilder = new ImplementationBuilder(options, errorHandler);

            indexerSymbol.AddImplementation(implBuilder.BuildIndexerGetter(indexerSymbol), /* getter */ true);
            implementations.Add(indexerSymbol.GetterImplementation);

            if (indexerSymbol.IsReadOnly == false)
            {
                indexerSymbol.AddImplementation(implBuilder.BuildPropertySetter(indexerSymbol), /* getter */ false);
                implementations.Add(indexerSymbol.SetterImplementation);
            }

            if (indexerSymbol.AnonymousMethods != null)
            {
                foreach (AnonymousMethodSymbol anonymousMethod in indexerSymbol.AnonymousMethods)
                {
                    Debug.Assert(anonymousMethod.Implementation != null);

                    implementations.Add(anonymousMethod.Implementation);
                }
            }
        }
示例#3
0
        private void BuildCode(EventSymbol eventSymbol)
        {
            if (eventSymbol.IsAbstract || eventSymbol.DefaultImplementation)
            {
                return;
            }

            ImplementationBuilder implBuilder = new ImplementationBuilder(options, errorHandler);

            eventSymbol.AddImplementation(implBuilder.BuildEventAdd(eventSymbol), /* adder */ true);
            eventSymbol.AddImplementation(implBuilder.BuildEventRemove(eventSymbol), /* adder */ false);

            implementations.Add(eventSymbol.AdderImplementation);
            implementations.Add(eventSymbol.RemoverImplementation);

            if (eventSymbol.AnonymousMethods != null)
            {
                foreach (AnonymousMethodSymbol anonymousMethod in eventSymbol.AnonymousMethods)
                {
                    Debug.Assert(anonymousMethod.Implementation != null);

                    implementations.Add(anonymousMethod.Implementation);
                }
            }
        }
示例#4
0
        private void BuildCode(FieldSymbol fieldSymbol)
        {
            ImplementationBuilder implBuilder    = new ImplementationBuilder(options, errorHandler);
            SymbolImplementation  implementation = implBuilder.BuildField(fieldSymbol);

            if (implementation != null)
            {
                fieldSymbol.AddImplementation(implementation);
                implementations.Add(fieldSymbol.Implementation);
            }
        }
示例#5
0
        private void BuildCode(MethodSymbol methodSymbol)
        {
            if (methodSymbol.IsAbstract)
            {
                return;
            }

            ImplementationBuilder implBuilder = new ImplementationBuilder(options, errorHandler);

            methodSymbol.AddImplementation(implBuilder.BuildMethod(methodSymbol));

            implementations.Add(methodSymbol.Implementation);

            if (methodSymbol.AnonymousMethods != null)
            {
                foreach (AnonymousMethodSymbol anonymousMethod in methodSymbol.AnonymousMethods)
                {
                    Debug.Assert(anonymousMethod.Implementation != null);

                    implementations.Add(anonymousMethod.Implementation);
                }
            }
        }