コード例 #1
0
        internal static void Initialize(IConnection connection)
        {
            FluorineRtmpContext fluorineContext = new FluorineRtmpContext(connection);

            WebSafeCallContext.SetData(FluorineContext.FluorineContextKey, fluorineContext);
            if (log.IsDebugEnabled)
            {
                log.Debug(__Res.GetString(__Res.Context_Initialized, connection.ConnectionId, connection.Client != null ? connection.Client.Id : "[not set]", connection.Session != null ? connection.Session.Id : "[not set]"));
            }
        }
コード例 #2
0
        /// <summary>
        /// Stores a given object and associates it with the specified name.
        /// </summary>
        /// <param name="name">The name with which to associate the new item in the call context.</param>
        /// <param name="value">The object to store in the call context.</param>
        public static void SetData(string name, object value)
        {
#if !FXCLIENT
            HttpContext ctx = HttpContext.Current;
            if (ctx != null)
            {
                ctx.Items[name] = value;
                return;
            }
#endif
            try {
                // See if we're running in full trust
                new SecurityPermission(SecurityPermissionFlag.Infrastructure).Demand();
                WebSafeCallContext.SetData(name, value);
            } catch (SecurityException) {
                Data[name] = value;
            }
        }