当前位置: 首页>>代码示例>>C#>>正文


C# ISession.handleSessionTimeout方法代码示例

本文整理汇总了C#中ISession.handleSessionTimeout方法的典型用法代码示例。如果您正苦于以下问题:C# ISession.handleSessionTimeout方法的具体用法?C# ISession.handleSessionTimeout怎么用?C# ISession.handleSessionTimeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISession的用法示例。


在下文中一共展示了ISession.handleSessionTimeout方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateUser

        public bool UpdateUser(IUser user, string sessionID, ISession sessionHandler)
        {
            try
            {
                XmlRpcStruct userStruct = ((User)user).toStruct();

                sysLog.Info("Request: UpdateUser - Requested User: '" + user + "', Userdata: FIRSTNAME=" + user.Firstname
                                                                                   + " LASTNAME=" + user.Lastname
                                                                                   + " EMAIL=" + user.Email);

                UserHandler privateUserHandler = HandlerHelper.getPrivateUserHandler(privateXmlRpcUrl, sessionID);
                privateUserHandler.Modify("NICKNAME == '" + user.Nickname + "'", userStruct);
            }
            catch (Exception e)
            {
                if (e.Message.Contains(corruptSession) || e.Message.Contains(invalidSession))
                    sessionHandler.handleSessionTimeout();
                else
                    sysLog.Error("Error when updating user '" + user.Nickname + "'", e);

                return false;
            }

            return true;
        }
开发者ID:maleadt,项目名称:stockplay,代码行数:25,代码来源:DataAccess.cs

示例2: CancelOrder

        public void CancelOrder(int orderId, string sessionID, ISession sessionHandler)
        {
            try
            {
                sysLog.Info("Request: CancelOrder - Requested OrderId: " + orderId);

                OrderHandler privateOrderHandler = HandlerHelper.getPrivateOrderHandler(privateXmlRpcUrl, sessionID);
                privateOrderHandler.Cancel("ID == '" + orderId + "'");
            }
            catch (Exception e)
            {
                if (e.Message.Contains(corruptSession) || e.Message.Contains(invalidSession))
                    sessionHandler.handleSessionTimeout();
                else
                    sysLog.Error("Error when cancelling Order", e);
            }
        }
开发者ID:maleadt,项目名称:stockplay,代码行数:17,代码来源:DataAccess.cs

示例3: GetUserTransactions

        /******************************************************
         * TRANSACTIONS
         ******************************************************/
        public List<ITransaction> GetUserTransactions(int id, string sessionID, ISession sessionHandler)
        {
            try
            {
                sysLog.Info("Request: UserTransactions - Requested UserID: '" + id + "'");

                List<ITransaction> userTransactions = new List<ITransaction>();

                TransactionHandler privateTransactionHandler = HandlerHelper.getPrivateTransactionHandler(privateXmlRpcUrl, sessionID);
                XmlRpcStruct[] transactionStruct = privateTransactionHandler.List("USERID == '" + id + "'");

                foreach (XmlRpcStruct userTransaction in transactionStruct)
                    userTransactions.Add(new Transaction(userTransaction));

                return userTransactions;
            }
            catch (Exception e)
            {
                if (e.Message.Contains(corruptSession) || e.Message.Contains(invalidSession))
                    sessionHandler.handleSessionTimeout();
                else
                    sysLog.Error("Error when requesting UserTransactions", e);

                return new List<ITransaction>();
            }
        }
开发者ID:maleadt,项目名称:stockplay,代码行数:29,代码来源:DataAccess.cs

示例4: RemoveUser

        public bool RemoveUser(string nickname, string sessionID, ISession sessionHandler)
        {
            try
            {
                sysLog.Info("Request: RemoveUser - Requested User: '" + nickname + "'");

                UserHandler privateUserHandler = HandlerHelper.getPrivateUserHandler(privateXmlRpcUrl, sessionID);
                privateUserHandler.Remove("NICKNAME == '" + nickname + "'");
            }
            catch (Exception e)
            {
                if (e.Message.Contains(corruptSession) || e.Message.Contains(invalidSession))
                    sessionHandler.handleSessionTimeout();
                else
                    sysLog.Error("Error when removing user '" + nickname + "'", e);

                return false;
            }
            return false;
        }
开发者ID:maleadt,项目名称:stockplay,代码行数:20,代码来源:DataAccess.cs

示例5: GetUserSecurities

        public List<IUserSecurity> GetUserSecurities(int id, string sessionID, ISession session)
        {
            try
            {
                sysLog.Info("Request: UserSecurities - Requested UserID: '" + id + "'");

                List<IUserSecurity> userSecurities = new List<IUserSecurity>();

                PortfolioHandler privatePortfolioHandler = HandlerHelper.getPrivatePortfolioHandler(privateXmlRpcUrl, sessionID);
                XmlRpcStruct[] portfolioStruct = privatePortfolioHandler.List("USERID == '" + id + "'");

                foreach (XmlRpcStruct userSecurity in portfolioStruct)
                    userSecurities.Add(new UserSecurity(userSecurity));

                return userSecurities;
            }
            catch (Exception e)
            {
                if(e.Message.Contains("Session Corrupt"))
                    session.handleSessionTimeout();
                else
                    sysLog.Error("Error when requesting UserSecurities", e);

                return new List<IUserSecurity>();
            }
        }
开发者ID:maleadt,项目名称:stockplay,代码行数:26,代码来源:DataAccess.cs

示例6: GetUserOrders

        public List<IOrder> GetUserOrders(int id, string sessionID, ISession sessionHandler)
        {
            try
            {
                sysLog.Info("Request: UserOrders - Requested User: " + id);

                List<IOrder> userOrders = new List<IOrder>();

                OrderHandler privateOrderHandler = HandlerHelper.getPrivateOrderHandler(privateXmlRpcUrl, sessionID);
                XmlRpcStruct[] orderStruct = privateOrderHandler.List("USERID == '" + id + "'");

                foreach (XmlRpcStruct userOrder in orderStruct)
                    userOrders.Add(new Order(userOrder));

                return userOrders;
            }
            catch (Exception e)
            {
                if(e.Message.Contains(corruptSession) || e.Message.Contains(invalidSession))
                    sessionHandler.handleSessionTimeout();
                else
                    sysLog.Error("Error when requesting UserOrders", e);

                return new List<IOrder>();
            }
        }
开发者ID:maleadt,项目名称:stockplay,代码行数:26,代码来源:DataAccess.cs

示例7: GetUserDetailsByNickname

        public IUser GetUserDetailsByNickname(string nickname, string sessionID, ISession sessionHandler)
        {
            try
            {
                sysLog.Info("Request: UserByNickname - Requested User: '" + nickname +"'");

                IUser user = null;

                UserHandler privateUserHandler = HandlerHelper.getPrivateUserHandler(privateXmlRpcUrl, sessionID);
                XmlRpcStruct[] userStruct = privateUserHandler.Details(); //Filter is niet nodig, deze wordt samengesteld in de backend adhv sessie
                if (userStruct.Length > 0)
                    user = new User(userStruct[0]);

                return user;
            }
            catch(Exception e)
            {
                if (e.Message.Contains(corruptSession) || e.Message.Contains(invalidSession))
                    sessionHandler.handleSessionTimeout();
                else
                    sysLog.Error("Error when requesting user", e);

                return null;
            }
        }
开发者ID:maleadt,项目名称:stockplay,代码行数:25,代码来源:DataAccess.cs

示例8: GetPointTransactions

        public List<IPointsTransaction> GetPointTransactions(int userID, string sessionId, ISession sessionHandler)
        {
            try
            {
                sysLog.Info("Request: GetPointTransactions - Requested UserID: '" + userID + "'");

                List<IPointsTransaction> pointTransactions = new List<IPointsTransaction>();

                PointsTransactionHandler privatePointsTransactionHandler = HandlerHelper.getPrivatePointsTransactionHandler(privateXmlRpcUrl, sessionId);
                XmlRpcStruct[] pointTransactionStruct = privatePointsTransactionHandler.List("USERID == '" + userID + "'");

                foreach (XmlRpcStruct pointTransaction in pointTransactionStruct)
                    pointTransactions.Add(new PointsTransaction(pointTransaction));

                return pointTransactions;
            }
            catch (Exception e)
            {
                if (e.Message.Contains(corruptSession) || e.Message.Contains(invalidSession))
                    sessionHandler.handleSessionTimeout();
                else
                sysLog.Error("Error when getting rankings", e);

                return new List<IPointsTransaction>();
            }
        }
开发者ID:maleadt,项目名称:stockplay,代码行数:26,代码来源:DataAccess.cs

示例9: CreateOrder

        /******************************************************
         * ORDERS
         ******************************************************/
        public void CreateOrder(int userId, string isin, int amount, double price, double alternativeOrder, string type, string sessionID, ISession sessionHandler)
        {
            try
            {
                sysLog.Info("Request: CreateOrder - Created Order: USERID=" + userId + " ISIN=" + isin + " AMOUNT=" + amount
                                                                   + " PRICE=" + price + " TYPE=" + type);

                OrderHandler privateOrderHandler = HandlerHelper.getPrivateOrderHandler(privateXmlRpcUrl, sessionID);
                Order order = new Order(-1, userId, isin, amount, price, alternativeOrder, type, "ACCEPTED", DateTime.Now, DateTime.MinValue, DateTime.MinValue);
                privateOrderHandler.Create(order.toStruct());
            }
            catch (Exception e)
            {
                if (e.Message.Contains(corruptSession) || e.Message.Contains(invalidSession))
                    sessionHandler.handleSessionTimeout();
                else
                    sysLog.Error("Error when creating Order", e);
            }
        }
开发者ID:maleadt,项目名称:stockplay,代码行数:22,代码来源:DataAccess.cs


注:本文中的ISession.handleSessionTimeout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。