コード例 #1
0
ファイル: ScriptManager.cs プロジェクト: alesliehughes/olive
		protected override void Render (HtmlTextWriter writer)
		{
			ScriptTextWriter scriptwriter = new ScriptTextWriter (writer);

			scriptwriter.WriteStartElement ("script");
			scriptwriter.WriteAttributeString ("type", "text/xml-script");
			scriptwriter.WriteStartElement ("page");
			scriptwriter.WriteAttributeString ("xmlns:script", "http://schemas.microsoft.com/xml-script/2005");

			scriptwriter.WriteStartElement ("components");
			foreach (IScriptComponent component in mgr.Components) {
				if (((IScriptObject)component).Owner == null) // only render the toplevel script objects
					component.RenderScript (scriptwriter);
			}
			scriptwriter.WriteEndElement (); // components 

			scriptwriter.WriteStartElement ("references");
			foreach (string scriptPath in mgr.ScriptRefs.Keys) {
				if ((bool)mgr.ScriptRefs[scriptPath]) {
					scriptwriter.WriteStartElement ("add");
					scriptwriter.WriteAttributeString ("src", scriptPath);
					scriptwriter.WriteEndElement ();
				}
			}
			scriptwriter.WriteEndElement (); //references

			scriptwriter.WriteEndElement (); // page
			scriptwriter.WriteEndElement (); // script

			ScriptManager.Pages.Remove (Page);
		}
コード例 #2
0
ファイル: ListView.cs プロジェクト: stanasse/olive
        protected override void RenderScriptTagContents(ScriptTextWriter writer)
        {
            base.RenderScriptTagContents(writer);

            writer.WriteStartElement("layoutTemplate");
            writer.WriteStartElement("template");
            writer.WriteAttributeString("layoutElement", ID + "_layoutTemplate"); // XXX ?
            writer.WriteEndElement();                                             // template
            writer.WriteEndElement();                                             // layoutTemplate

            writer.WriteStartElement("itemTemplate");
            writer.WriteEndElement();              // itemTemplate
        }
コード例 #3
0
ファイル: TextBox.cs プロジェクト: stanasse/olive
        protected override void RenderScriptTagContents(ScriptTextWriter writer)
        {
            base.RenderScriptTagContents(writer);

            if (AutoCompletionServiceMethod != "" &&
                AutoCompletionServiceUrl != "")
            {
                writer.WriteStartElement("behaviors");
                writer.WriteStartElement("autoComplete");
                writer.WriteAttributeString("serviceURL", AutoCompletionServiceUrl);
                writer.WriteAttributeString("serviceMethod", AutoCompletionServiceMethod);
                if (AutoCompletionMinimumPrefixLength != 0)
                {
                    writer.WriteAttributeString("minimumPrefixLength", AutoCompletionMinimumPrefixLength.ToString());
                }

                writer.WriteAttributeString("completionList", ID + "__autocomplete"); // XXX ?

                writer.WriteEndElement();                                             // autoComplete
                writer.WriteEndElement();                                             // behaviors
            }
        }
コード例 #4
0
        protected override void Render(HtmlTextWriter writer)
        {
            ScriptTextWriter scriptwriter = new ScriptTextWriter(writer);

            scriptwriter.WriteStartElement("script");
            scriptwriter.WriteAttributeString("type", "text/xml-script");
            scriptwriter.WriteStartElement("page");
            scriptwriter.WriteAttributeString("xmlns:script", "http://schemas.microsoft.com/xml-script/2005");

            scriptwriter.WriteStartElement("components");
            foreach (IScriptComponent component in mgr.Components)
            {
                if (((IScriptObject)component).Owner == null)                 // only render the toplevel script objects
                {
                    component.RenderScript(scriptwriter);
                }
            }
            scriptwriter.WriteEndElement();              // components

            scriptwriter.WriteStartElement("references");
            foreach (string scriptPath in mgr.ScriptRefs.Keys)
            {
                if ((bool)mgr.ScriptRefs[scriptPath])
                {
                    scriptwriter.WriteStartElement("add");
                    scriptwriter.WriteAttributeString("src", scriptPath);
                    scriptwriter.WriteEndElement();
                }
            }
            scriptwriter.WriteEndElement();              //references

            scriptwriter.WriteEndElement();              // page
            scriptwriter.WriteEndElement();              // script

            ScriptManager.Pages.Remove(Page);
        }