Example #1
0
        public static void OnUploadTerminated(GenericPageFile pageFile, string fileName, string filePath, bool succes, long size)
        {
            var message = Message.CreateEmtpyMessage("ServerMessage");

            message["Message"] = "" + DateTime.Now + " OnUploadTerminated " + succes + " ; " + fileName + " ; " + size + " ; " + filePath;
            LongPolling.HttpHandler.MessageHandlerStatic.SendMessageToConnection(pageFile.ConnectionID, message);
        }
Example #2
0
        public static void OnUploadStarted(GenericPageFile pageFile, string uploadFileName)
        {
            var message = Message.CreateEmtpyMessage("ServerMessage");

            message["Message"] = "" + DateTime.Now + " OnUploadStarted ; " + uploadFileName;
            LongPolling.HttpHandler.MessageHandlerStatic.SendMessageToConnection(pageFile.ConnectionID, message);
        }
Example #3
0
        public override ISyncedRequestHandler GetHandler(HttpContext context, string handlerType, string sessionID, string connectionID)
        {
            switch (handlerType)
            {
            case GenericPageFile.HandlerType: {
                var instance = GenericPageFile.GenericSyncedHandler(HttpHandler.ConnectionListStatic, context.Request, connectionID, () => { return(new GenericPageFile(HttpHandler.MessageHandlerStatic, connectionID)); });
                return(instance);
            }

            default:
                throw new NotImplementedException("Unknown handler type '" + handlerType + "'");
            }
        }
Example #4
0
        public static Dictionary <string, string> GetQueryParameters(Type receiverType, string methodName = "OnUploadPageFileCreated")
        {
            CommonLibs.Utils.Debug.ASSERT(receiverType != null, System.Reflection.MethodInfo.GetCurrentMethod(), "Missing parameter 'receiverType'");

            return(GenericPageFile.GetQueryParameters(receiverType: receiverType, methodName: methodName));
        }
Example #5
0
        public static void OnUploadCreated(ConnectionList connectionList, string connectionID, GenericPageFile pageFile, HttpRequest request)
        {
            var message = Message.CreateEmtpyMessage("ServerMessage");

            message["Message"] = "" + DateTime.Now + " OnUploadCreated";
            LongPolling.HttpHandler.MessageHandlerStatic.SendMessageToConnection(connectionID, message);

            pageFile.OnUploadStarted    = (rqst, uploadFileName) => { OnUploadStarted(pageFile, uploadFileName); };
            pageFile.OnUploadTerminated = (rqst, fileName, filePath, succes, size) => { OnUploadTerminated(pageFile, fileName, filePath, succes, size); };
        }