コード例 #1
0
    // Use this for initialization
    public void Initialize()
    {
        //App42API.Initialize(KEY_API, KEY_SECRET);

        serviceAPI    = new ServiceAPI(KEY_API, KEY_SECRET);
        uploadService = serviceAPI.BuildUploadService();
    }
コード例 #2
0
        //Pre: N/A
        //Post: OnlineStorage class is initialized
        //Description: This method initializes the online storage class.
        public static void Initialize()
        {
            App42API.Initialize(KEY_API, KEY_SECRET);

            ServiceAPI api = new ServiceAPI(KEY_API, KEY_SECRET);

            uploadService = api.BuildUploadService();
        }
コード例 #3
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     photoChooserTask            = new PhotoChooserTask();
     photoChooserTask.Completed += new EventHandler <PhotoResult>(photoChooserTask_Completed);
     uploadservice = serviceApi.BuildUploadService();
     userService   = serviceApi.BuildUserService();
 }
コード例 #4
0
    void OnGUI()
    {
        if (Time.time % 2 < 1)
        {
            success = callBack.getResult();
        }
        // For Setting Up ResponseBox.
        GUI.TextArea(new Rect(10, 5, 1000, 175), success);

        //===================================**************=========================================
        if (GUI.Button(new Rect(50, 200, 200, 30), "UploadFile"))
        {
            uploadService = sp.BuildUploadService();              // Initializing UploadService.
            uploadService.UploadFile(cons.fileName, cons.filePath, UploadFileType.IMAGE, cons.description, callBack);
        }

        //===================================**************=========================================
        if (GUI.Button(new Rect(260, 200, 200, 30), "GetFileByName"))
        {
            uploadService = sp.BuildUploadService();              // Initializing UploadService.
            uploadService.GetFileByName(cons.fileName, callBack);
        }

        //===================================**************=========================================
        if (GUI.Button(new Rect(470, 200, 200, 30), "UploadFileForUser"))
        {
            uploadService = sp.BuildUploadService();              // Initializing UploadService.
            uploadService.UploadFileForUser(cons.fileName, cons.userName, cons.filePath, UploadFileType.IMAGE, cons.description, callBack);
        }

        //===================================**************=========================================
        if (GUI.Button(new Rect(680, 200, 200, 30), "UploadFileStream"))
        {
            uploadService = sp.BuildUploadService();              // Initializing UploadService.
            Stream stream = new FileStream(cons.filePath, FileMode.Open);
            uploadService.UploadFile(cons.fileName, stream, UploadFileType.IMAGE, cons.description, callBack);
        }
    }
コード例 #5
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("On navigated to loading");
            timeout = 0;

            MediaElementData[0] = t1;
            MediaElementData[1] = t2;

            Global.MyAudio[0] = App.GlobalMediaElement0;
            Global.MyAudio[1] = App.GlobalMediaElement1;
            Global.MyAudio[2] = App.GlobalMediaElement2;
            Global.MyAudio[3] = App.GlobalMediaElement3;
            Global.MyAudio[4] = App.GlobalMediaElement4;

            Global.opponentUsername = "";
            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                ready.Text = Global.localUsername + " \nvs\n";
            });

            _dispatcherTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
            _dispatcherTimer.Tick += UpdateMediaData;
            _dispatcherTimer.Start();

            i = 0;
            k = 0;
            B(false);

            requestCallback = this;
            App42API.Initialize(Constants.API_KEY, Constants.SECRET_KEY);
            App42Log.SetDebug(true);

            ServiceAPI api = new ServiceAPI(Constants.API_KEY, Constants.SECRET_KEY);

            storage = api.BuildStorageService();
            uploadService = api.BuildUploadService();

            System.Diagnostics.Debug.WriteLine("Before warp");

            WarpClient.initialize(Constants.API_KEY, Constants.SECRET_KEY);

            WarpClient.setRecoveryAllowance(60);

            Global.warpClient = WarpClient.GetInstance();


            //trivia
            if ((int)settings["trigger"] == 0)
                TriviaTB.Text = Global.TriviaB[(new Random()).Next(Global.TriviaB.Length)];
            else
                TriviaTB.Text = Global.TriviaH[(new Random()).Next(Global.TriviaH.Length)];

            Global.disconnectSuccess = false;
            Global.deleteSuccess = false;
            Global.conListenObj = new ConnectionListener(this);
            Global.roomReqListenerObj = new RoomReqListener(this);
            Global.zoneReqListenerObj = new ZoneRequestListener(this);
            Global.notificationListenerObj = new NotificationListener(this);
     
            Global.warpClient.AddConnectionRequestListener(Global.conListenObj);
            Global.warpClient.AddRoomRequestListener(Global.roomReqListenerObj);
            Global.warpClient.AddNotificationListener(Global.notificationListenerObj);
            Global.warpClient.AddZoneRequestListener(Global.zoneReqListenerObj);

            Global.warpClient.Connect(Global.localUsername);

            System.Diagnostics.Debug.WriteLine("after warp");
        }
コード例 #6
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("On navigated to loading");
            timeout = 0;

            MediaElementData[0] = t1;
            MediaElementData[1] = t2;

            Global.MyAudio[0] = App.GlobalMediaElement0;
            Global.MyAudio[1] = App.GlobalMediaElement1;
            Global.MyAudio[2] = App.GlobalMediaElement2;
            Global.MyAudio[3] = App.GlobalMediaElement3;
            Global.MyAudio[4] = App.GlobalMediaElement4;

            Global.opponentUsername = "";
            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                ready.Text = Global.localUsername + " \nvs\n";
            });

            _dispatcherTimer = new DispatcherTimer {
                Interval = TimeSpan.FromSeconds(1)
            };
            _dispatcherTimer.Tick += UpdateMediaData;
            _dispatcherTimer.Start();

            i = 0;
            k = 0;
            B(false);

            requestCallback = this;
            App42API.Initialize(Constants.API_KEY, Constants.SECRET_KEY);
            App42Log.SetDebug(true);

            ServiceAPI api = new ServiceAPI(Constants.API_KEY, Constants.SECRET_KEY);

            storage       = api.BuildStorageService();
            uploadService = api.BuildUploadService();

            System.Diagnostics.Debug.WriteLine("Before warp");

            WarpClient.initialize(Constants.API_KEY, Constants.SECRET_KEY);

            WarpClient.setRecoveryAllowance(60);

            Global.warpClient = WarpClient.GetInstance();


            //trivia
            if ((int)settings["trigger"] == 0)
            {
                TriviaTB.Text = Global.TriviaB[(new Random()).Next(Global.TriviaB.Length)];
            }
            else
            {
                TriviaTB.Text = Global.TriviaH[(new Random()).Next(Global.TriviaH.Length)];
            }

            Global.disconnectSuccess       = false;
            Global.deleteSuccess           = false;
            Global.conListenObj            = new ConnectionListener(this);
            Global.roomReqListenerObj      = new RoomReqListener(this);
            Global.zoneReqListenerObj      = new ZoneRequestListener(this);
            Global.notificationListenerObj = new NotificationListener(this);

            Global.warpClient.AddConnectionRequestListener(Global.conListenObj);
            Global.warpClient.AddRoomRequestListener(Global.roomReqListenerObj);
            Global.warpClient.AddNotificationListener(Global.notificationListenerObj);
            Global.warpClient.AddZoneRequestListener(Global.zoneReqListenerObj);

            Global.warpClient.Connect(Global.localUsername);

            System.Diagnostics.Debug.WriteLine("after warp");
        }
コード例 #7
0
 //=============================GUI_CONTENT===========================================
 // Use this for initialization
 void Start()
 {
     sp = new ServiceAPI("YOUR_API_KEY","YOUR_SECRET_KEY");
     uploadService = sp.BuildUploadService(); // Initializing Upload Service.
 }