private DOCollection GetPropertyValue()
        {
            _rm    = (ResourceManage)_p.GetValue(ParameterKey.RESOURCE_MANAGER);
            _token = (TransactionToken)_p.GetValue(ParameterKey.TOKEN);
            DOCollection rtn = null;

            lock (lockobj)
            {
                rtn = GetCache(_p.PropertyName);
                if (rtn == null)
                {
                    Init(_p);
                    var action = GetSourceDefinition(_p.PropertyName);
                    if (action != null)
                    {
                        CacheSetting setting = new CacheSetting();
                        rtn = action.Invoke(setting);

                        if (setting.IsCache)
                        {
                            SetCache(_p.PropertyName, rtn, setting.CacheExpiration, setting.CacheSlidingExpiration);
                        }
                    }
                    After(_p);
                }
            }
            return(rtn);
        }
Esempio n. 2
0
            /// <summary>
            /// 呼叫本地logic
            /// </summary>
            /// <param name="logic"></param>
            /// <param name="action"></param>
            /// <param name="p"></param>
            /// <returns></returns>
            public object CallLocalLogic(string logic, string action, FrameDLRObject p)
            {
                var copyp = (WebParameter)_logic.CallContext_Parameter.WebParam.Clone();
                var copyd = (GoData)_logic.CallContext_DataCollection.WebData.Clone();

                copyp.RequestResourceName = logic;
                copyp.Action = action;
                ResourceManage rema = new ResourceManage();

                copyp.SetValue(ParameterKey.RESOURCE_MANAGER, rema);
                var defaulttoken = TransactionToken.NewToken();

                copyp.TransTokenList.Add(defaulttoken);
                copyp.SetValue(ParameterKey.TOKEN, defaulttoken);
                copyp.SetValue("IsAjaxAsync", false);
                if (p != null)
                {
                    foreach (var key in p.Keys)
                    {
                        copyp.SetValue(DomainKey.CUSTOMER_PARAMETER, key, p.GetValue(key));
                    }
                }

                return(CallLocalLogic(logic, action, copyp, copyd));
            }
Esempio n. 3
0
 /// <summary>
 /// 创建一个效果实例
 /// </summary>
 /// <param name="effID">效果ID</param>
 /// <param name="Position">位置</param>
 /// <param name="StartF">开始帧</param>
 /// <param name="EndF">结束帧</param>
 /// <param name="Width">宽度</param>
 /// <param name="Height">高度</param>
 public Effect(string effID, Point Position, int StartF, int EndF, double Width, double Height, int background = 0)
 {
     this.CacheMode = new BitmapCache();
     EffectID       = effID;
     StartFrame     = StartF;
     EndFrame       = EndF;
     effectPosition = Position;
     eff            = new Image()
     {
         Stretch = Stretch.None, CacheMode = new BitmapCache()
     };
     //BitmapImage BI = new BitmapImage(new Uri(string.Format(@"Images/Effect/{0}/{1}.png", EffectID, StartFrame), UriKind.Relative));
     effWidth   = Width;
     effHeight  = Height;
     eff.Source = ResourceManage.GetImageResource(string.Format(@"Images/Effect/{0}/{1}.png", EffectID, StartFrame));//BI;
     currFrame  = StartFrame;
     Canvas.SetLeft(eff, effectPosition.X - Width / 2);
     Canvas.SetTop(eff, effectPosition.Y - Height / 2);
     Canvas.SetZIndex(eff, 1);
     if (background > 0)
     {
         //Background
         EffectBackground        = new Image();
         EffectBackground.Source = new BitmapImage(new Uri(string.Format(@"Images/Effect/{0}/{1}.png", EffectID, background), UriKind.Relative));
         Canvas.SetLeft(EffectBackground, effectPosition.X - Width / 2);
         Canvas.SetTop(EffectBackground, effectPosition.Y - Height / 2);
         Canvas.SetZIndex(EffectBackground, 2);
         //this.Children.Add(EffectBackground);
     }
     this.Loaded += new RoutedEventHandler(Effect_Loaded);
 }
Esempio n. 4
0
            /// <summary>
            /// 获得一个新的UnitParamter
            /// </summary>
            /// <typeparam name="T"></typeparam>
            /// <param name="rm">指定的资源管理器</param>
            /// <param name="token">指定的TransactionToken</param>
            /// <returns></returns>
            public T NewUnitParameter <T>(ResourceManage rm, TransactionToken token) where T : UnitParameter
            {
                var t = Activator.CreateInstance <T>();

                t.SetValue(ParameterKey.TOKEN, token);
                t.SetValue(ParameterKey.RESOURCE_MANAGER, rm);
                foreach (var item in _logic.CallContext_Parameter.Domain(DomainKey.CONFIG))
                {
                    t.SetValue(DomainKey.CONFIG, item.Key, item.Value);
                }
                return(t);
            }
Esempio n. 5
0
 void Heart_Tick(object sender, EventArgs e)
 {
     //BitmapImage BI = new BitmapImage(new Uri(string.Format(@"Images/Effect/{0}/{1}.png", EffectID, currFrame), UriKind.Relative));
     currFrame++;
     if (currFrame > EndFrame)
     {
         this.Children.Remove(eff);
         Heart.Stop();
         currFrame = StartFrame;
         EffectOver(this, null);
     }
     eff.Source = ResourceManage.GetImageResource(string.Format(@"Images/Effect/{0}/{1}.png", EffectID, currFrame));//BI;
     //throw new NotImplementedException();
 }
Esempio n. 6
0
    public void enableButton(bool enable)
    {
        ResourceManage rm = GameObject.Find("ResourceManager").transform.GetComponent <ResourceManage> ();

        if (rm.gameInclude)
        {
            game.SetActive(enable);
        }

        if (rm.quizInclude)
        {
            quiz.SetActive(enable);
        }
    }
Esempio n. 7
0
        public virtual void BeforeInit(EventArgs e)
        {
            //System key
            s_systemPostFields.Add("__EVENTTARGET");
            s_systemPostFields.Add("__EVENTARGUMENT");
            s_systemPostFields.Add("__VIEWSTATEFIELDCOUNT");
            s_systemPostFields.Add("__VIEWSTATE");
            s_systemPostFields.Add("__VIEWSTATEENCRYPTED");
            s_systemPostFields.Add("__PREVIOUSPAGE");
            s_systemPostFields.Add("__CALLBACKID");
            s_systemPostFields.Add("__CALLBACKPARAM");
            s_systemPostFields.Add("__LASTFOCUS");
            s_systemPostFields.Add(UniqueFilePathSuffixID);
            s_systemPostFields.Add("__redir");
            s_systemPostFields.Add("__EVENTVALIDATION");

            //获取请求的资源和参数
            ResourceManage rema = new ResourceManage();

            _wp.SetValue <ResourceManage>(ParameterKey.RESOURCE_MANAGER, rema);
            _wp[DomainKey.SESSION, "SessionID"] = Context.Session.SessionID;
            _wp.SetValue(DomainKey.APPLICATION_ENVIRONMENT, "ServerRootPath", Context.Server.MapPath("~"));
            _wp.SetValue(DomainKey.APPLICATION_ENVIRONMENT, "ServerRootPath_URL", Context.Request.Url.AbsoluteUri.Replace(Context.Request.FilePath, ""));

            _wp.SetValue(DomainKey.APPLICATION_ENVIRONMENT, "WebPath", Context.Request.Url.AbsoluteUri.Replace(Context.Request.RawUrl, ""));
            //设置serverinfo
            _wp[DomainKey.APPLICATION_ENVIRONMENT, "server_servername"] = Context.Server.MachineName;
            _wp[DomainKey.APPLICATION_ENVIRONMENT, "serverinfo_ip"]     = Context.Request.ServerVariables["LOCAl_ADDR"];
            //设置clientinfo
            _wp[DomainKey.APPLICATION_ENVIRONMENT, "clientinfo_ip"]             = Context.Request.UserHostAddress;
            _wp[DomainKey.APPLICATION_ENVIRONMENT, "clientinfo_browserversion"] = Context.Request.Browser.Version;
            _wp[DomainKey.APPLICATION_ENVIRONMENT, "clientinfo_platform"]       = Context.Request.Browser.Platform;
            _wp[DomainKey.APPLICATION_ENVIRONMENT, "clientinfo_userhostname"]   = Context.Request.UserHostName;


            if (Context.Request.Path != "/")
            {
                _wp.RequestResourcePath = Context.Request.PhysicalPath;
                string   reqpath = Path.GetFileNameWithoutExtension(_wp.RequestResourcePath);
                string[] ss      = reqpath.Split('.');
                _wp.Action = ss.Length > 1 ? ss[1] : "";
                _wp.RequestResourceName = ss[0];
            }

            foreach (string s in Context.Request.QueryString.Keys)
            {
                _wp[DomainKey.QUERY_STRING, s] = Context.Request.QueryString[s];
            }
        }
Esempio n. 8
0
        protected virtual void BeforeProcess(TParameter p, TData d)
        {
            //获取请求的资源和参数
            ResourceManage rema = new ResourceManage();

            p.SetValue(ParameterKey.RESOURCE_MANAGER, rema);
            var defaulttoken = TransactionToken.NewToken();

            p.TransTokenList.Add(defaulttoken);
            p.SetValue(ParameterKey.TOKEN, defaulttoken);
            p.SetValue("IsAjaxAsync", false);

            ProcessRequestInfo(p, d);
            ProcessRequestSession(p, d);
            ProcessResponseCookie(p, d);
        }
        protected virtual void BeforeProcess(TParameter p, TData d)
        {
            //获取请求的资源和参数
            ResourceManage rema = new ResourceManage();

            p.SetValue(ParameterKey.RESOURCE_MANAGER, rema);
            var defaulttoken = TransactionToken.NewToken();

            p.TransTokenList.Add(defaulttoken);
            p.SetValue(ParameterKey.TOKEN, defaulttoken);
            p.RequestUri         = new Uri($"{p.CurrentHttpContext.Request.Scheme}://{p.CurrentHttpContext.Request.Host}{p.CurrentHttpContext.Request.Path}{p.CurrentHttpContext.Request.QueryString}");
            p.RequestRoute       = p.CurrentHttpContext.Request.Path.Value;
            p.RestResourcesArray = p.CurrentHttpContext.Request.Path.Value.Split('/');

            ProcessRequestInfo(p, d);
            ProcessRequestHeader(p, d);
        }
Esempio n. 10
0
        protected virtual void Init(WP p, WD d)
        {
            //获取请求的资源和参数
            ResourceManage rema = new ResourceManage();

            p.SetValue <ResourceManage>(ParameterKey.RESOURCE_MANAGER, rema);
            p.SetValue <TransactionToken>(ParameterKey.TOKEN, TransactionToken.NewToken());
            if (p.ExtentionObj.args != null)
            {
                if (p.ExtentionObj.args.Length > 0)
                {
                    string   reqstr = ComFunc.nvl(p.ExtentionObj.args[0]);
                    string[] arr    = reqstr.Split('.');
                    p[ParameterKey.LOGIC]  = arr[0];
                    p[ParameterKey.ACTION] = arr.Length > 1 ? arr[1] : "";
                }
            }
        }
        protected virtual void BeforeProcess(TParameter p, TData d)
        {
            //获取请求的资源和参数
            ResourceManage rema = new ResourceManage();

            p.SetValue(ParameterKey.RESOURCE_MANAGER, rema);
            var defaulttoken = TransactionToken.NewToken();

            p.TransTokenList.Add(defaulttoken);
            p.SetValue(ParameterKey.TOKEN, defaulttoken);
            p.SetValue("IsAjaxAsync", IsAjaxAsync);
            p.RequestUri = new Uri($"{p.CurrentHttpContext.Request.Scheme}://{p.CurrentHttpContext.Request.Host}{p.CurrentHttpContext.Request.Path}{(p.CurrentHttpContext.Request.QueryString.Value)}");
            GlobalCommon.Logger.WriteLog(LoggerLevel.DEBUG, $"excute request URI:{CurrentContext.Request.Method} \"{p.RequestUri}\"");

            ProcessRequestPath(p, d);
            ProcessRequestHeader(p, d);
            ProcessRequestInfo(p, d);
            ProcessRequestSession(p, d);
            ProcessRequestCookie(p, d);
            ////hostview的引擎
            //p.ExtentionObj.hostviewengine = new HostJsView();
        }
Esempio n. 12
0
        /// <summary>
        /// 获取消息列表
        /// </summary>
        /// <param name="from">发件人邮件地址</param>
        /// <param name="sender">发件人显示名称</param>
        /// <param name="to">收件人地址</param>
        /// <param name="subject">邮件标题</param>
        /// <param name="body">邮件正文</param>
        protected List <MailMessage> GetSendMessageList(string from, string sender, string[] recvierArray, string subject, string body)
        {
            if (recvierArray.Any(MAddress => !Regex.IsMatch(MAddress, ResourceManage.GetString(ResourceManage.MAIL_URL_EXPRESSION))))
            {
                return(null);
            }

            List <MailMessage> messageList = new List <MailMessage>();

            foreach (string recvier in recvierArray)
            {
                MailMessage message = new MailMessage(new MailAddress(from, sender), new MailAddress(recvier));
                message.Subject         = subject;
                message.SubjectEncoding = Encoding.UTF8;
                message.Body            = body;
                message.BodyEncoding    = Encoding.UTF8;
                message.IsBodyHtml      = true;
                message.Priority        = MailPriority.Normal;
                messageList.Add(message);
            }
            return(messageList);
        }
Esempio n. 13
0
        protected virtual void Init(HttpContext context, WP p, WD d)
        {
            //获取请求的资源和参数
            ResourceManage rema = new ResourceManage();

            p.SetValue <ResourceManage>(ParameterKey.RESOURCE_MANAGER, rema);
            var defaulttoken = TransactionToken.NewToken();

            p.TransTokenList.Add(defaulttoken);
            p.SetValue <TransactionToken>(ParameterKey.TOKEN, defaulttoken);
            p.SetValue("IsAjaxAsync", IsAjaxAsync);
            //设置serverinfo
            p[DomainKey.APPLICATION_ENVIRONMENT, "server_servername"] = context.Server.MachineName;
            p[DomainKey.APPLICATION_ENVIRONMENT, "serverinfo_ip"]     = context.Request.ServerVariables["LOCAl_ADDR"];
            //设置clientinfo
            var ip = "";

            if (context.Request.ServerVariables["HTTP_VIA"] != null)          // using proxy
            {
                ip = context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; // Return real client IP.
            }
            else// not using proxy or can't get the Client IP
            {
                ip = context.Request.ServerVariables["REMOTE_ADDR"]; //While it can't get the Client IP, it will return proxy IP.
            }
            p[DomainKey.APPLICATION_ENVIRONMENT, "clientinfo_ip"]             = ip;
            p[DomainKey.APPLICATION_ENVIRONMENT, "clientinfo_browserversion"] = context.Request.Browser.Version;
            p[DomainKey.APPLICATION_ENVIRONMENT, "clientinfo_platform"]       = context.Request.Browser.Platform;
            p[DomainKey.APPLICATION_ENVIRONMENT, "clientinfo_userhostname"]   = context.Request.UserHostName;
            p.IsNeedSessionAbandon = false;
            p.IsWebSocket          = context.IsWebSocketRequest;
            //hostview的引擎
            p.ExtentionObj.hostviewengine = new HostJsView();
            lock (lockobj)
            {
                Prepare(context, ref p, ref d);
            }
        }