public static ClassDeclaration FindWrapperClass(WrappingResult wrapper, ProtocolDeclaration protocol)
        {
            var className = protocol.HasAssociatedTypes ? OverrideBuilder.AssociatedTypeProxyClassName(protocol) :
                            OverrideBuilder.ProxyClassName(protocol);
            var theClass = wrapper.Module.Classes.FirstOrDefault(cl => cl.Name == className);

            return(wrapper.FunctionReferenceCodeMap.OriginalOrReflectedClassFor(theClass) as ClassDeclaration);
        }
Пример #2
0
        /// <summary>
        /// Enables processing of the result of an action method by a custom type that inherits from the <see cref="T:System.Web.Mvc.ActionResult"/> class.
        /// </summary>
        /// <param name="context">The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data.</param>
        public override void ExecuteResult([NotNull] ControllerContext context)
        {
            Invariant.IsNotNull(context, "context");

            FlashStorage storage = new FlashStorage(context.Controller.TempData);

            foreach (KeyValuePair <string, string> pair in FlashMessages)
            {
                storage.Add(pair.Key, pair.Value);
            }

            WrappingResult.ExecuteResult(context);
        }
Пример #3
0
        public override void ExecuteResult(ControllerContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var storage = new FlashStorage(context.Controller.TempData);

            foreach (var pair in FlashMessages)
            {
                storage.Add(pair.Key, pair.Value);
            }

            WrappingResult.ExecuteResult(context);
        }
        public ObjCProtocolCompiler(PlatformName targetPlatform, IEnumerable <ProtocolDeclaration> protocols, TempDirectoryFilenameProvider provider,
                                    ModuleDeclaration module, string swiftLibPath, string outputDirectory, TypeMapper typeMapper,
                                    WrappingResult wrapper, ErrorHandling errors, bool verbose)
        {
            this.targetPlatform  = targetPlatform;
            this.protocols       = protocols.Where(p => p.IsObjC && p.IsPublicOrOpen && !p.IsUnavailable && !p.IsDeprecated).ToList();
            this.provider        = provider;
            this.module          = module;
            this.swiftLibPath    = swiftLibPath;
            this.outputDirectory = outputDirectory;
            this.typeMapper      = typeMapper;
            this.wrapper         = wrapper;
            this.errors          = errors;
            this.verbose         = verbose;

            topLevelFunctionCompiler = new TopLevelFunctionCompiler(this.typeMapper);
        }
 public ProtocolMethodMatcher(ProtocolDeclaration protocol, List <FunctionDeclaration> originalFuncs, WrappingResult wrapper)
 {
     this.protocol      = Ex.ThrowOnNull(protocol, nameof(protocol));
     this.originalFuncs = Ex.ThrowOnNull(originalFuncs, nameof(originalFuncs));
     this.wrapper       = Ex.ThrowOnNull(wrapper, nameof(wrapper));
 }