Ejemplo n.º 1
0
 protected override void OnPreRender(EventArgs e)
 {
     if (!DesignMode)
     {
         CurrentScriptManager.RegisterScriptControl(this);
         Page.PreRenderComplete += delegate
         {
             Update();
             if (AllowInvokeUpdateMethod && !IsEmptyJavaControls())
             {
                 //todo: ћожно попробовать сделать провероку на необходимость обновлени¤
                 var panel = Parent as UpdatePanel;
                 if (panel != null)
                 {
                     panel.Update();
                 }
                 else
                 {
                     panel = Parent.Parent as UpdatePanel;
                     if (panel != null && panel.ContentTemplateContainer == Parent)
                     {
                         panel.Update();
                     }
                 }
             }
         };
     }
     base.OnPreRender(e);
 }
Ejemplo n.º 2
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (!DesignMode && !ScriptRegistred1)
            {
                CurrentScriptManager.RegisterScriptControl(this);
                ScriptRegistred1 = true;
            }
        }
    private void Awake()
    {
        if (instance != null)
        {
            Debug.LogWarning("There is more than one instance of CurrentScripManager");
            return;
        }
        instance = this;

        playerSpawn = GameObject.FindGameObjectWithTag("Player").transform.position;
    }
Ejemplo n.º 4
0
        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);
//            string Script =
//            @"
//            function SaveState(){
//                debugger;
//                var Ctrls=document.getElementsByTagName('*');
//                x=Ctrls.length;
//                var i;
//                for(i=0;i<x;i++){
//                    if (Ctrls[i].scrollTop!=null && Ctrls[i].scrollLeft!=null){
//                    if (Ctrls[i].scrollTop!=0 || Ctrls[i].scrollLeft!=0)
//                        document.getElementById ('" + ClientID + @"').value+=
//                            Ctrls[i].id+','+Ctrls[i].scrollTop+','+Ctrls[i].scrollLeft+';';
//                    }
//                }
//            }";

//            Script +=
//            @"
//            function LoadState() {
//                var Ctrls=document.getElementsByTagName('*');
//                x=Ctrls.length;
//                mass=document.getElementById ('" + ClientID + @"').value.split(';');
//                var i;var j;
//                for(i=0;i<mass.length-1;i++) {
//                    m2=mass[i].split(',');
//                    if (m2.length==3){
//                        for(j=0;j<x;j++){
//                            if (m2[0]==Ctrls[j].id){
//                                Ctrls[j].scrollTop=m2[1];
//                                Ctrls[j].scrollLeft=m2[2];
//                            }
//                        }
//                    }
//                }
//            }";

//            Page.ClientScript.RegisterStartupScript(Page.GetType(), "Scroll", Script, true);
//            Page.ClientScript.RegisterStartupScript(Page.GetType(), "Scroll2", "LoadState();", true);
//            Page.ClientScript.RegisterStartupScript(Page.GetType(), "Scroll3", "document.getElementById('" + Page.Form.ClientID + "').onsubmit=function(){SaveState();};", true);

            if (!DesignMode && !ScriptRegistred)
            {
                CurrentScriptManager.RegisterScriptDescriptors(this);
                ScriptRegistred = true;
            }
        }
Ejemplo n.º 5
0
 protected override void Render(HtmlTextWriter writer)
 {
     if (!DesignMode)
     {
         if (IsEmptyJavaControls())
         {
             Update();
         }
         CurrentScriptManager.RegisterScriptDescriptors(this);
         base.Render(writer);
     }
     else
     {
         writer.Write("EnableControls - " + ID);
     }
 }