Beispiel #1
0
 public void DefineDeclaration(IIntermediateDelegateType declaration)
 {
 }
Beispiel #2
0
 public void ReferenceDeclaration(IIntermediateDelegateType declaration)
 {
 }
Beispiel #3
0
 void IIntermediateTypeVisitor.Visit(IIntermediateDelegateType intermediateType)
 {
     this.Translate(intermediateType);
 }
Beispiel #4
0
 public string Visit(IIntermediateDelegateType @delegate, IntermediateNameRequestDetails context)
 {
     return(VisitIntermediateType(@delegate, context));
 }
Beispiel #5
0
 public TestLinkerResult Visit(IIntermediateDelegateType @delegate, ICompilationContext context)
 {
     throw new NotImplementedException();
 }
Beispiel #6
0
        public IIntermediateGenericType Add(string name, TypeKindGeneric kind, params GenericParameterData[] genParamData)
        {
            if (genParamData == null)
            {
                throw new ArgumentNullException("genParamData");
            }
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            IIntermediateGenericType rResult = null;
            var assembly = this.Parent.Assembly;

            switch (kind)
            {
            case TypeKindGeneric.Class:
            {
                IIntermediateClassType insertionElement = null;
                if (assembly != null)
                {
                    IIntermediateTypeCtorLanguageService <IIntermediateClassType> classService;
                    if (assembly.Provider.TryGetService(LanguageGuids.Services.ClassServices.ClassCreatorService, out classService))
                    {
                        insertionElement = classService.New(name, this.Parent);
                    }
                }
                if (insertionElement == null)
                {
                    insertionElement = new IntermediateClassType(name, this.Parent);
                }
                if (genParamData.Length > 0)
                {
                    insertionElement.TypeParameters.AddRange(genParamData);
                }
                rResult = insertionElement;
                this.Parent.Classes.Add(insertionElement);
            }
            break;

            case TypeKindGeneric.Delegate:
            {
                IIntermediateDelegateType insertionElement = null;
                if (assembly != null && assembly.Provider != null)
                {
                    IIntermediateTypeCtorLanguageService <IIntermediateDelegateType> delegateService;
                    if (assembly.Provider.TryGetService(LanguageGuids.Services.IntermediateDelegateCreatorService, out delegateService))
                    {
                        insertionElement = delegateService.New(name, this.Parent);
                    }
                }
                if (insertionElement == null)
                {
                    insertionElement = new IntermediateDelegateType(name, this.Parent);
                }
                if (genParamData.Length > 0)
                {
                    insertionElement.TypeParameters.AddRange(genParamData);
                }
                rResult = insertionElement;
                this.Parent.Delegates.Add(insertionElement);
            }
            break;

            case TypeKindGeneric.Interface:
            {
                IIntermediateInterfaceType insertionElement = null;
                if (assembly != null && assembly.Provider != null)
                {
                    IIntermediateTypeCtorLanguageService <IIntermediateInterfaceType> interfaceService;
                    if (assembly.Provider.TryGetService(LanguageGuids.Services.InterfaceServices.InterfaceCreatorService, out interfaceService))
                    {
                        insertionElement = interfaceService.New(name, this.Parent);
                    }
                }
                if (insertionElement == null)
                {
                    insertionElement = new IntermediateInterfaceType(name, this.Parent);
                }
                if (genParamData.Length > 0)
                {
                    insertionElement.TypeParameters.AddRange(genParamData);
                }
                rResult = insertionElement;
                this.Parent.Interfaces.Add(insertionElement);
            }
            break;

            case TypeKindGeneric.Struct:
            {
                IIntermediateStructType insertionElement = null;
                if (assembly != null && assembly.Provider != null)
                {
                    IIntermediateTypeCtorLanguageService <IIntermediateStructType> structService;
                    if (assembly.Provider.TryGetService(LanguageGuids.Services.StructServices.StructCreatorService, out structService))
                    {
                        insertionElement = structService.New(name, this.Parent);
                    }
                }
                if (insertionElement == null)
                {
                    insertionElement = new IntermediateStructType(name, this.Parent);
                }
                if (genParamData.Length > 0)
                {
                    insertionElement.TypeParameters.AddRange(genParamData);
                }
                rResult = insertionElement;
                this.Parent.Structs.Add(insertionElement);
            }
            break;

            default:
                throw new NotSupportedException();
            }
            return(rResult);
        }
 public string Visit(IIntermediateDelegateType @delegate, DefaultAssemblyFilenameVisitorContext context)
 {
     context.CurrentResult = string.Format(@"{0}\{1}", ToBaselineNamespaceName(@delegate.NamespaceName, context), @delegate.FullName.Substring(@delegate.NamespaceName.Length == 0 ? 0 : @delegate.NamespaceName.Length + 1));
     return(context.CurrentResult);
 }
Beispiel #8
0
 public void DefineDeclaration(IIntermediateDelegateType declaration)
 {
     this.DefineDeclaration((IIntermediateType)declaration);
 }
Beispiel #9
0
 public abstract void Translate(IIntermediateDelegateType intermediateType);
Beispiel #10
0
 public void ReferenceDeclaration(IIntermediateDelegateType declaration)
 {
     this.Formatter.ReferenceDeclaration(declaration);
 }
Beispiel #11
0
 public void DefineDeclaration(IIntermediateDelegateType declaration)
 {
     this.Formatter.DefineDeclaration(declaration);
 }
Beispiel #12
0
 public CSharpAssemblyFileInfo Visit(IIntermediateDelegateType @delegate, CSharpAssemblyFileContext context)
 {
     context.CurrentResult.FileName = string.Format(@"{0}\{1}", ToBaselineNamespaceName(@delegate.NamespaceName, context), @delegate.FullName.Substring(@delegate.NamespaceName.Length == 0 ? 0 : @delegate.NamespaceName.Length + 1));
     return(context.CurrentResult);
 }
Beispiel #13
0
 public TransformationKind Visit(IIntermediateDelegateType @delegate, ITransformationContext context)
 {
     throw new NotImplementedException();
 }