Esempio n. 1
0
        // -------------------------------------------------------------------------

        /// <summary>
        /// makes a warmup request to the server and returns a response object in the form of RESPONSE_
        /// </summary>
        public static void make_request(CollabrifyClient c, HttpRequest__Object obj, List <string> tags)
        {
            CollabrifyRequest_PB req_pb = new CollabrifyRequest_PB();

            req_pb.request_type = CollabrifyRequestType_PB.LIST_SESSIONS_REQUEST;

            Request_ListSessions_PB cs_pb = new Request_ListSessions_PB();

            cs_pb.account_gmail = c.getAccountGmail();
            cs_pb.access_token  = c.getAccessToken();
            foreach (string s in tags)
            {
                cs_pb.session_tag.Add(s);
            }
            cs_pb.limit_query_to_organization_account = true;
            cs_pb.use_subset_query = true;
            cs_pb.account_gmail    = c.getAccountGmail();
            cs_pb.access_token     = c.getAccessToken();
            foreach (string s in tags)
            {
                cs_pb.session_tag.Add(s);
            }

            HttpWebRequest request = obj.BuildRequest(req_pb, cs_pb);

            try
            {
                request.BeginGetRequestStream(new AsyncCallback(obj.getReqStream), request);
            }
            catch (WebException e)
            {
                System.Diagnostics.Debug.WriteLine("  -- EXCEPTION THROWN \n" + e.Message);
            }
        } // make_request
        // -------------------------------------------------------------------------

        /// <summary>
        /// makes a warmup request to the server and returns a response object in the form of RESPONSE_
        /// </summary>
        public static void make_request(CollabrifyClient c, HttpRequest__Object obj)
        {
            CollabrifyRequest_PB req_pb = new CollabrifyRequest_PB();

            req_pb.request_type = CollabrifyRequestType_PB.GET_EVENT_REQUEST;

            HttpWebRequest request = obj.BuildRequest(req_pb);

            Request_GetEvent_PB cs_pb = new Request_GetEvent_PB();

            cs_pb.access_token   = c.getAccessToken();
            cs_pb.account_gmail  = c.getAccountGmail();
            cs_pb.participant_id = c.participant.getId();
            cs_pb.session_id     = c.getSession().getId();
            cs_pb.order_id       = c.getSession().getCurrentOrderId();

            try
            {
                request.BeginGetRequestStream(new AsyncCallback(obj.getReqStream), request);
            }
            catch (WebException e)
            {
                System.Diagnostics.Debug.WriteLine("  -- EXCEPTION THROWN \n" + e.Message);
            }
        } // make_request
Esempio n. 3
0
        // -------------------------------------------------------------------------

        /// <summary>
        /// makes a request to the server
        /// </summary>
        public static void make_request(CollabrifyClient c, HttpRequest__Object obj, long id, string password)
        {
            CollabrifyRequest_PB req_pb = new CollabrifyRequest_PB();

            req_pb.request_type = CollabrifyRequestType_PB.ADD_PARTICIPANT_REQUEST;

            Request_AddParticipant_PB cs_pb = new Request_AddParticipant_PB();

            cs_pb.account_gmail                 = c.getAccountGmail();
            cs_pb.access_token                  = c.getAccessToken();
            cs_pb.participant_display_name      = c.participant.getDisplayName();
            cs_pb.participant_user_id           = c.participant.getUserID();
            cs_pb.participant_notification_id   = c.participant.getId().ToString();
            cs_pb.participant_notification_type = NotificationMediumType_PB.COLLABRIFY_CLOUD_CHANNEL;

            cs_pb.session_id       = id;
            cs_pb.session_password = password;

            HttpWebRequest request = obj.BuildRequest(req_pb, cs_pb);

            try
            {
                request.BeginGetRequestStream(new AsyncCallback(obj.getReqStream), request);
            }
            catch (WebException e)
            {
                System.Diagnostics.Debug.WriteLine("  -- EXCEPTION THROWN \n" + e.Message);
            }
        } // make_request
Esempio n. 4
0
        // -------------------------------------------------------------------------

        /// <summary>
        /// makes a warmup request to the server and returns a response object in the form of RESPONSE_
        /// </summary>
        public static void make_request(CollabrifyClient c, HttpRequest__Object obj)
        {
            /* if user isnt owner of session, dont delete the session */
            if (c.currentSessionOwner().getId() != c.participant.getId())
            {
                return;
            }

            CollabrifyRequest_PB req_pb = new CollabrifyRequest_PB();

            req_pb.request_type = CollabrifyRequestType_PB.DELETE_SESSION_REQUEST;

            Request_DeleteSession_PB cs_pb = new Request_DeleteSession_PB();

            cs_pb.account_gmail  = c.getAccountGmail();
            cs_pb.access_token   = c.getAccessToken();
            cs_pb.participant_id = c.participant.getId();
            cs_pb.session_id     = c.currentSessionID();

            CollabrifyParticipant owner   = c.currentSessionOwner();
            HttpWebRequest        request = obj.BuildRequest(req_pb, cs_pb);

            try
            {
                request.BeginGetRequestStream(new AsyncCallback(obj.getReqStream), request);
            }
            catch (WebException e)
            {
                System.Diagnostics.Debug.WriteLine("BeginGetRequestStream FAILED:\n" + e.Message);
            }
        } // make_request
Esempio n. 5
0
        // -------------------------------------------------------------------------

        /// <summary>
        /// makes a warmup request to the server and returns a response object in the form of RESPONSE_
        /// </summary>
        public static void make_request(CollabrifyClient c, HttpRequest__Object obj)
        {
            CollabrifyRequest_PB req_pb = new CollabrifyRequest_PB();

            req_pb.request_type = CollabrifyRequestType_PB.REMOVE_PARTICIPANT_REQUEST;

            Request_RemoveParticipant_PB cs_pb = new Request_RemoveParticipant_PB();

            cs_pb.account_gmail = c.getAccountGmail();
            cs_pb.access_token  = c.getAccessToken();
            cs_pb.session_id    = c.currentSessionID();

            if (c.getSession().getIsPasswordProtected())
            {
                cs_pb.session_password = "";
            }

            cs_pb.accessing_participant_id     = c.participant.getId();
            cs_pb.to_be_removed_participant_id = c.participant.getId();

            HttpWebRequest request = obj.BuildRequest(req_pb, cs_pb);

            try
            {
                request.BeginGetRequestStream(new AsyncCallback(obj.getReqStream), request);
            }
            catch (WebException e)
            {
                System.Diagnostics.Debug.WriteLine("  -- EXCEPTION THROWN \n" + e.Message);
            }
        } // make_request
Esempio n. 6
0
        // -------------------------------------------------------------------------

        /// <summary>
        /// makes a warmup request to the server and returns a response object in the form of RESPONSE_
        /// </summary>
        public static void make_request(CollabrifyClient c, HttpRequest__Object obj, string name, List <string> tags, string password, int participantLimit = 0)
        {
            CollabrifyRequest_PB req_pb = new CollabrifyRequest_PB();

            req_pb.request_type = CollabrifyRequestType_PB.CREATE_SESSION_WITH_BASE_FILE_REQUEST;

            Random rd = new Random();
            Request_CreateSession_PB cs_pb = new Request_CreateSession_PB();

            cs_pb.owner_display_name = c.participant.getDisplayName();
            cs_pb.session_name       = name;
            if (password != "")
            {
                cs_pb.session_password = password;
            }

            foreach (string s in tags)
            {
                cs_pb.session_tag.Add(s);
            }
            cs_pb.account_gmail      = c.getAccountGmail();
            cs_pb.access_token       = c.getAccessToken();
            cs_pb.owner_display_name = c.participant.getDisplayName();
            cs_pb.owner_user_id      = c.participant.getUserID();

            if (participantLimit > 0)
            {
                cs_pb.participant_limit = participantLimit;
            }

            cs_pb.owner_notification_id   = "0";
            cs_pb.owner_notification_type = NotificationMediumType_PB.COLLABRIFY_CLOUD_CHANNEL;
            byte[]         baseFile = null;
            HttpWebRequest request  = obj.BuildRequest(req_pb, cs_pb, baseFile);

            try
            {
                request.BeginGetRequestStream(new AsyncCallback(obj.getReqStream), request);
            }
            catch (WebException e)
            {
                System.Diagnostics.Debug.WriteLine("  -- EXCEPTION THROWN \n" + e.Message);
            }
        } // make_request
Esempio n. 7
0
        // -------------------------------------------------------------------------

        /// <summary>
        /// makes a warmup request to the server and returns a response object in the form of RESPONSE_
        /// </summary>
        public static void make_request(CollabrifyClient c, HttpRequest__Object obj)
        {
            CollabrifyRequest_PB req_pb = new CollabrifyRequest_PB();

            req_pb.request_type = CollabrifyRequestType_PB.ADD_TO_BASE_FILE_REQUEST;

            Request_AddToBaseFile_PB cs_pb = new Request_AddToBaseFile_PB();

            cs_pb.account_gmail = c.getAccountGmail();
            cs_pb.access_token  = c.getAccessToken();

            HttpWebRequest request = obj.BuildRequest(req_pb, cs_pb);

            try
            {
                request.BeginGetRequestStream(new AsyncCallback(obj.getReqStream), request);
            }
            catch (WebException e)
            {
                System.Diagnostics.Debug.WriteLine("  -- EXCEPTION THROWN \n" + e.Message);
            }
        } // make_request