public void Load(IPortalApplication portalApplication)
    {
      var settings = portalApplication.GetSettings<LarmSettings>("Larm");

      portalApplication.OnModuleLoaded += (o, args) =>
        {
          var mcm = args.Module as IMcmModule;

          if (mcm == null) return;

          var s3 = new S3(settings.Aws);
          var transcoder = new ElasticTranscoder(settings.Aws);

          portalApplication.MapRoute("/v6/Search", () => new Search(portalApplication));
          portalApplication.MapRoute("/v6/WayfProfile", () => new WayfProfile(portalApplication, mcm.McmRepository, settings));
          portalApplication.MapRoute("/v6/Upload", () => new Upload(portalApplication, mcm.McmRepository, s3, transcoder, settings));
          portalApplication.MapRoute("/v6/Annotation", () => new Annotation(portalApplication, mcm.McmRepository));
          portalApplication.MapRoute("/v6/RadioProgram", () => new RadioProgram(portalApplication, mcm.McmRepository));
          portalApplication.MapRoute("/v6/Profile", () => new Profile(portalApplication, mcm.McmRepository, settings));

          portalApplication.AddView(new SearchView(mcm.McmRepository), settings.Index.SearchCoreName);
          portalApplication.AddView(new AnnotationView(mcm.McmRepository), settings.Index.AnnotationCoreName);
          portalApplication.AddView(new UserSearchView(), settings.Index.UserSearchCoreName);
          portalApplication.AddView(new ObjectView(mcm.PermissionManager), mcm.Configuration.ObjectCoreName, true);

          portalApplication.AddBinding(typeof(ProfileResult), new JsonParameterBinding<ProfileResult>());
        };
    }
 public void TestStructVCall() {
     Func<string> f = () => {
         var s = new S3();
         return s.ToString();
     };
     this.Test(f);
 }
Esempio n. 3
0
	public static int Main ()
	{
		S? s = null;
		bool res = s > 1;
		if (res)
			return 1;

		S2 s2 = new S2 ();

		var b = s2 >> 3;
		if (b != 1250)
			return 2;

		var b2 = s2 >> s2;
		if (b2 != 0)
			return 3;

		var b3 = s2 + 1;
		if (b3 != 10001)
			return 4;

		var s3 = new S3 ();
		if ((s3 == null) != false)
			return 5;

		if ((s3 != null) != true)
			return 6;
		
		if (S3.counter != 2)
			return 7;

		Console.WriteLine ("ok");
		return 0;
	}
Esempio n. 4
0
	static int Main ()
	{
		var s = new S1 ();
		if (s.Value != 17)
			return 1;

		var s2 = new S2 ();
		if (s2.Value != 23)
			return 2;

		var s3 = new S3 ();
		if (s3.Value != 5)
			return 3;

		var s4 = new S4 (5);
		if (s4.Value != 11)
			return 4;

		var s5 = new S5 (2);
		if (s5.Value != 9)
			return 5;

		Console.WriteLine ("ok");
		return 0;
	}
 public void TestPassStructWithRef() {
     Func<int> f = () => {
         var s3 = new S3 { l = new List<int>() };
         var r = MutateS3(s3);
         return r + s3.l.Count;
     };
     this.Test(f);
 }
Esempio n. 6
0
        public FormSettings(S3 mainClass)
        {
            InitializeComponent();

            this.mainClass = mainClass;

            bucket.Text = mainClass.bucketName;
            AWSKey.Text = mainClass.AWSKey;
            AWSSecretKet.Text = mainClass.AWSSecretKey;
            prefix.Text = mainClass.prefix;
            checkPrivate.Checked = mainClass.isPrivate;
            shorten.Checked = mainClass.shorten;
            https.Checked = mainClass.https;
            appendext.Checked = mainClass.appendExt;
            expires.Value = mainClass.expires;

            int selIndex = 0;
            switch (mainClass.imageFormat.ToLower()) {
                case "png": selIndex = 0; break;
                case "jpg": selIndex = 1; break;
                case "gif": selIndex = 2; break;
            }
            comboFormat.SelectedIndex = selIndex;

            {
                string[] parts = mainClass.shortCutDragModifiers.Split('+');
                foreach (string part in parts) {
                    switch (part) {
                        case "Ctrl": checkDragModCtrl.Checked = true; break;
                        case "Alt": checkDragModAlt.Checked = true; break;
                        case "Shift": checkDragModShift.Checked = true; break;
                    }
                }
            }

            {
                string[] parts = mainClass.shortCutPasteModifiers.Split('+');
                foreach (string part in parts) {
                    switch (part) {
                        case "Ctrl": checkPasteModCtrl.Checked = true; break;
                        case "Alt": checkPasteModAlt.Checked = true; break;
                        case "Shift": checkPasteModShift.Checked = true; break;
                    }
                }
            }

            mainClass.PopulateKeysCombobox(comboDragKeys);
            mainClass.PopulateKeysCombobox(comboPasteKeys);

            comboDragKeys.SelectedItem = mainClass.shortCutDragKey;
            comboPasteKeys.SelectedItem = mainClass.shortCutPasteKey;
        }
        public void Write__ResponseWithAckFromS3()
        {
            var s3 = new S3(new LarmSettings.AwsSettings
                {
                    AccessKey = ConfigurationManager.AppSettings["AccessKey"],
                    SecretAccessKey = ConfigurationManager.AppSettings["SecretAccessKey"],
                    UploadBucket = "integrationtests"
                });

            var stream = new FileStream("Ballad_of_Serenity.mp3", FileMode.Open);

            s3.Write("larm/Ballad_of_Serenity.mp3", stream);
        }
        public void Transcode__ResponseWithAckFromS3()
        {
            var aws = new LarmSettings.AwsSettings
                {
                    AccessKey = ConfigurationManager.AppSettings["AccessKey"],
                    SecretAccessKey = ConfigurationManager.AppSettings["SecretAccessKey"], 
                    UploadBucket = "integrationtests",
                    PipelineId = "1402593766282-xnnqcd",
                    PresetId = "1351620000001-300040"
                };
            var s3 = new S3(aws);
            var transcode = new ElasticTranscoder(aws);
            var stream = new FileStream("Ballad_of_Serenity.mp3", FileMode.Open);
            s3.Write("larm/Ballad_of_Serenity.mp3", stream);

            transcode.Transcode("larm/Ballad_of_Serenity.mp3", "larm/result.mp3");
        }
Esempio n. 9
0
	public static int Main ()
	{
		S1? s1 = new S1 ();
		switch (s1) {
		case 1:
			break;
		default:
			return 1;
		}

		S2? s2 = new S2 ();
		switch (s2) {
		case null:
			break;
		default:
			return 2;
		}

		S3? s3 = new S3 ();
		switch (s3) {
		case 2:
			break;
		default:
			return 3;
		}

		S4 s4 = new S4 ();
		switch (s4) {
		case 3:
			break;
		default:
			return 4;
		}

		return 0;
	}
Esempio n. 10
0
 public override void Start()
 {
     lock (_locker)
     {
         _s3 = new S3(_accessKey, _secretKey);
         base.Start();
     }
 }
Esempio n. 11
0
 public static bool ValidateS3(S3 str1, S3 str2, string methodName)
 {
     int iflag = 0;
     if (str1.flag != str2.flag || str1.str != str2.str)
     {
         Console.WriteLine("\tFAILED! " + methodName + "did not recieve result as expected.");
         Console.WriteLine("\tThe Actual flag field is...");
         Console.WriteLine("\t{0}.flag = {1}", str1.ToString(), str1.flag);
         Console.WriteLine("\t{0}.str = {1}", str1.ToString(), str1.str);
         Console.WriteLine("\tThe Expected is...");
         Console.WriteLine("\t{0}.flag = {1}", str2.ToString(), str2.flag);
         Console.WriteLine("\t{0}.str = {1}", str2.ToString(), str2.str);
         return false;
     }
     for (int i = 0; i < 256; i++)
     {
         if (str1.vals[i] != str2.vals[i])
         {
             Console.WriteLine("\tFAILED! " + methodName + "did not recieve result as expected.");
             Console.WriteLine("\tThe Actual vals field is...");
             Console.WriteLine("\t{0}.vals[{1}] = {2}", str1.ToString(), i, str1.vals[i]);
             Console.WriteLine("\tThe Expected vals field is...");
             Console.WriteLine("\t{0}.vals[{1}] = {2}", str2.ToString(), i, str2.vals[i]);
             iflag++;
         }
     }
     if (iflag != 0)
     {
         return false;
     }
     Console.WriteLine("\tPASSED!");
     return true;
 }
Esempio n. 12
0
 public static void PrintS3(S3 str1, string name)
 {
     Console.WriteLine("\t{0}.flag = {1}", name, str1.flag);
     Console.WriteLine("\t{0}.flag = {1}", name, str1.str);
     for (int i = 0; i < str1.vals.Length; i++)
     {
         Console.WriteLine("\t{0}.vals[{1}] = {2}", name, i, str1.vals[i]);
     }
 }
Esempio n. 13
0
 public static S3 NewS3(bool flag, string str, int[] vals)
 {
     S3 str1 = new S3();
     str1.flag = flag;
     str1.str = str;
     str1.vals = vals;
     return str1;
 }
Esempio n. 14
0
 public LinkInfo(string bucketName, string key, string region)
 {
     if (bucketName == null) throw new ArgumentNullException("bucketName");
     if (key == null) throw new ArgumentNullException("key");
     if (String.IsNullOrEmpty(region))
     {
         region = null;
     }
     s3 = new S3(bucketName, key, region);
 }
Esempio n. 15
0
 public static extern void InvokeCallback3(MyCallback3 callback, S3 s);
Esempio n. 16
0
 public static extern S3 InvokeCallback3R(MyCallback3 callback, S3 s);
Esempio n. 17
0
 static extern bool MarshalStructAsParam_AsSeqByVal7(S3 str1);
Esempio n. 18
0
 static extern bool MarshalStructAsParam_AsSeqByRef7(ref S3 str1);
Esempio n. 19
0
 static extern bool MarshalStructAsParam_AsSeqByRefOut7(out S3 str1);