public FREObject InitController(FREContext ctx, uint argc, FREObject[] argv)
        {
            Amazon.RegionEndpoint region;
            FileHelper.Context = Context;


            AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolver.MyResolveEventHandler;

            ravenClient = new RavenClient("https://*****:*****@sentry.io/301641");

            // get a reference to the AIR Window HWND
            _airWindow = Process.GetCurrentProcess().MainWindowHandle;

            if (argc > 3)
            {
                _debug = argv[3].AsBool();
            }

            if (argv[0] == FREObject.Zero || argv[1] == FREObject.Zero)
            {
                SendEvent(S3Event.CREDENTIALS_INVALID, "AWS Access Key and/or Secret key are missing.");
                return(FREObject.Zero);
            }

            var accessKey = argv[0].AsString();
            var secretKey = argv[1].AsString();

            switch (argv[2].AsString())
            {
            case "us-east-2":
                region = Amazon.RegionEndpoint.USEast2;
                break;

            case "us-west-1":
                region = Amazon.RegionEndpoint.USWest1;
                break;

            case "us-west-2":
                region = Amazon.RegionEndpoint.USWest2;
                break;

            case "ca-central-1":
                region = Amazon.RegionEndpoint.CACentral1;
                break;

            case "ap-south-1":
                region = Amazon.RegionEndpoint.APSouth1;
                break;

            case "ap-northeast-1":
                region = Amazon.RegionEndpoint.APNortheast1;
                break;

            case "ap-northeast-2":
                region = Amazon.RegionEndpoint.APNortheast2;
                break;

            case "ap-southeast-1":
                region = Amazon.RegionEndpoint.APSoutheast1;
                break;

            case "ap-southeast-2":
                region = Amazon.RegionEndpoint.APSoutheast2;
                break;

            case "cn-north-1":
                region = Amazon.RegionEndpoint.CNNorth1;
                break;

            case "cn-northwest-1":
                region = Amazon.RegionEndpoint.CNNorthWest1;
                break;

            case "eu-central-1":
                region = Amazon.RegionEndpoint.EUCentral1;
                break;

            case "eu-west-1":
                region = Amazon.RegionEndpoint.EUWest1;
                break;

            case "eu-west-2":
                region = Amazon.RegionEndpoint.EUWest2;
                break;

            case "eu-west-3":
                region = Amazon.RegionEndpoint.EUWest3;
                break;

            case "sa-east-1":
                region = Amazon.RegionEndpoint.SAEast1;
                break;

            default:
                region = Amazon.RegionEndpoint.USEast1;
                break;
            }

            client             = new AmazonS3Client(accessKey, secretKey, region);
            _clientInitialized = true;

            SendEvent(S3Event.CLIENT_INITIALIZED, "AWS Client Initialized in region: " + region.DisplayName + " " + ravenClient.ToString());
            return(true.ToFREObject());
        }