internal WeixinToolkitSettings(WeixinExtraXml xml, BaseAppSetting appsetting)
        {
            fCurrent = this;

            fEngine = new MessageEngine();
            if (xml.Weixin.Normal != null)
            {
                fNormalDefault = new DefaultEngine(xml.Weixin.Normal.DefaultMessage);

                fAuthConfig = new WeixinAuthConfig();
                string authFileName = Path.Combine(appsetting.XmlPath, @"Weixin\Auth.xml");
                if (File.Exists(authFileName))
                    fAuthConfig.ReadXmlFromFile(authFileName);
            }
            else if (xml.Weixin.CorpApps != null)
            {
                fCorpDefault = new Dictionary<int, DefaultEngine>();
                foreach (var item in xml.Weixin.CorpApps)
                    fCorpDefault.Add(item.AppId, new DefaultEngine(item.DefaultMessage));

                fCorpAuthConfig = new WeixinCorpAuthConfig();
                string authFileName = Path.Combine(appsetting.XmlPath, @"Weixin\CorpAuth.xml");
                if (File.Exists(authFileName))
                    fCorpAuthConfig.ReadXmlFromFile(authFileName);
            }
            else
                TkDebug.ThrowImpossibleCode(this);

            if (xml.Weixin.MessageLog != null)
                fLog = xml.Weixin.MessageLog.CreateObject();

        }
Exemple #2
0
        public void AppStarted(object application, BaseAppSetting appsetting, BaseGlobalVariable globalVariable)
        {
            TkDebug.ThrowIfNoGlobalVariable();
            EvaluateAdditionPlugInFactory factory = BaseGlobalVariable.Current.FactoryManager.GetCodeFactory(
                EvaluateAdditionPlugInFactory.REG_NAME).Convert <EvaluateAdditionPlugInFactory>();

            factory.Initialize();
        }
Exemple #3
0
        public void AppStarted(object application, BaseAppSetting appsetting, BaseGlobalVariable globalVariable)
        {
            string fileName = Path.Combine(appsetting.XmlPath, "AliyunOSS.xml");

            if (File.Exists(fileName))
            {
                AliyunOSSConfigXml xml = new AliyunOSSConfigXml();
                xml.ReadXmlFromFile(fileName);
                AliyunOSSSetting.CreateAliyunOSSSetting(xml);
            }
        }
        public void AppStarted(object application, BaseAppSetting appsetting,
            BaseGlobalVariable globalVariable)
        {
            string path = Path.Combine(appsetting.XmlPath, "weixin.xml");
            if (File.Exists(path))
            {
                WeixinExtraXml xml = new WeixinExtraXml();
                xml.ReadXmlFromFile(path);
                WeixinToolkitSettings.Current = new WeixinToolkitSettings(xml, appsetting);
            }

            RulePlugInFactory factory = globalVariable.FactoryManager.GetCodeFactory(
                RulePlugInFactory.REG_NAME).Convert<RulePlugInFactory>();

            factory.EnumableCodePlugIn(AddCodeRule);
            factory.EnumableXmlPlugIn(AddXmlRule);
        }
        public void AppStarted(object application, BaseAppSetting appsetting,
                               BaseGlobalVariable globalVariable)
        {
            string path = Path.Combine(appsetting.XmlPath, "weixin.xml");

            if (File.Exists(path))
            {
                WeixinExtraXml xml = new WeixinExtraXml();
                xml.ReadXmlFromFile(path);
                WeixinToolkitSettings.Current = new WeixinToolkitSettings(xml, appsetting);
            }

            RulePlugInFactory factory = globalVariable.FactoryManager.GetCodeFactory(
                RulePlugInFactory.REG_NAME).Convert <RulePlugInFactory>();

            factory.EnumableCodePlugIn(AddCodeRule);
            factory.EnumableXmlPlugIn(AddXmlRule);
        }
        protected virtual Vector3 getLookatPosition()
        {
            float step = 1.0f;

            if (BaseAppSetting.GetInstance().isFarView == false)
            {
                step = 0.8f;
            }

            Quaternion rotation = Quaternion.Euler(this.rotationAngle);

            calDistance = rotation * Vector3.forward * this.distance * step;
            calOffset   = rotation * this.cameraOffset;
            Vector3 retV = calDistance - calOffset + (rotation * this.offsetLookAt);

            retV.y = retV.y - height + this.heightLookAt;

            return(retV);
        }
 public void AppStarting(object application, BaseAppSetting appsetting,
     BaseGlobalVariable globalVariable)
 {
     string path = Path.Combine(appsetting.XmlPath, "weixin.xml");
     if (File.Exists(path))
     {
         WeixinXml xml = new WeixinXml();
         xml.ReadXmlFromFile(path);
         WeixinSettings.Current = new WeixinSettings(xml);
         if (WeixinSettings.Current.Mode == WeixinMode.Normal)
         {
             AccessToken.LoadToken();
             JsAccessToken.LoadToken();
         }
         else
         {
             CorpAccessTokenList.LoadToken();
         }
     }
 }
Exemple #8
0
        internal WeixinToolkitSettings(WeixinExtraXml xml, BaseAppSetting appsetting)
        {
            fCurrent = this;

            fEngine = new MessageEngine();
            if (xml.Weixin.Normal != null)
            {
                fNormalDefault = new DefaultEngine(xml.Weixin.Normal.DefaultMessage);

                fAuthConfig = new WeixinAuthConfig();
                string authFileName = Path.Combine(appsetting.XmlPath, @"Weixin\Auth.xml");
                if (File.Exists(authFileName))
                {
                    fAuthConfig.ReadXmlFromFile(authFileName);
                }
            }
            else if (xml.Weixin.CorpApps != null)
            {
                fCorpDefault = new Dictionary <int, DefaultEngine>();
                foreach (var item in xml.Weixin.CorpApps)
                {
                    fCorpDefault.Add(item.AppId, new DefaultEngine(item.DefaultMessage));
                }

                fCorpAuthConfig = new WeixinCorpAuthConfig();
                string authFileName = Path.Combine(appsetting.XmlPath, @"Weixin\CorpAuth.xml");
                if (File.Exists(authFileName))
                {
                    fCorpAuthConfig.ReadXmlFromFile(authFileName);
                }
            }
            else
            {
                TkDebug.ThrowImpossibleCode(this);
            }

            if (xml.Weixin.MessageLog != null)
            {
                fLog = xml.Weixin.MessageLog.CreateObject();
            }
        }
        public void AppStarting(object application, BaseAppSetting appsetting,
                                BaseGlobalVariable globalVariable)
        {
            string path = Path.Combine(appsetting.XmlPath, "weixin.xml");

            if (File.Exists(path))
            {
                WeixinXml xml = new WeixinXml();
                xml.ReadXmlFromFile(path);
                WeixinSettings.Current = new WeixinSettings(xml);
                if (WeixinSettings.Current.Mode == WeixinMode.Normal)
                {
                    AccessToken.LoadToken();
                    JsAccessToken.LoadToken();
                }
                else
                {
                    CorpAccessTokenList.LoadToken();
                }
            }
        }
Exemple #10
0
 public void AppStarting(object application, BaseAppSetting appsetting, BaseGlobalVariable globalVariable)
 {
 }
 public void AppStarting(object application, BaseAppSetting appsetting, BaseGlobalVariable globalVariable)
 {
     EvaluatorExtension.SetExtension(new EvaluatorExtensionImpl());
 }
 public void AppStarting(object application, BaseAppSetting appsetting,
     BaseGlobalVariable globalVariable)
 {
 }
Exemple #13
0
 protected virtual void Start()
 {
     appSetting      = BaseAppSetting.GetInstance();
     this.enabled    = appSetting.soundEnabled;
     this.soundValue = appSetting.soundPercent;
 }
 public void AppStarted(object application, BaseAppSetting appsetting, BaseGlobalVariable globalVariable)
 {
     RedisUtil.CreateCache();
 }