public ApplicationCallWebMethodExpression(SolutionBuilderInteractive Interactive) { this.Comment = "Send data from JavaScript to the server tier"; // why isn't this showing up? //this.GetObject = () => Interactive.Application_service; this.Object = new PseudoExpressions.PseudoThisExpression(); this.Method = Interactive.ApplicationWebServiceType.WebMethod2; // promote to stockmethod? var YieldMethod = new SolutionProjectLanguageMethod { Code = new SolutionProjectLanguageCode { Interactive.ApplicationYieldToDocumentTitle } }; YieldMethod.Parameters.Add(Interactive.YieldMethod_doc); this.ParameterExpressions = new object[] { (PseudoStringConstantExpression)"A string from JavaScript.", YieldMethod }; }
public ApplicationCallWebMethodExpression(SolutionBuilderInteractive Interactive) { this.Comment = "Send data from JavaScript to the server tier"; // why isn't this showing up? //this.GetObject = () => Interactive.Application_service; this.Object = new PseudoExpressions.PseudoThisExpression(); this.Method = Interactive.ApplicationWebServiceType.WebMethod2; // promote to stockmethod? var YieldMethod = new SolutionProjectLanguageMethod { Code = new SolutionProjectLanguageCode { Interactive.ApplicationYieldToDocumentTitle } }; YieldMethod.Parameters.Add(Interactive.YieldMethod_doc); this.ParameterExpressions = new object[] { (PseudoStringConstantExpression) "A string from JavaScript.", YieldMethod }; }
public StockApplicationWebServiceType(SolutionBuilderInteractive Interactive) { // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201406/20140602 // we can now use it as a base type for our client side apps //this.IsSealed = true; // Cassini will not be able to support debugging if WebService is made internal? //this.IsInternal = true; // will this help us? //this.IsPartial = true; this.Name = "ApplicationWebService"; this.Summary = "Methods defined in this type can be used from JavaScript. The method calls will seamlessly be proxied to the server."; this.UsingNamespaces.Add("System"); this.UsingNamespaces.Add("System.Linq"); this.UsingNamespaces.Add("System.Xml.Linq"); this.UsingNamespaces.Add("System.Collections.Generic"); this.UsingNamespaces.Add("System.Threading.Tasks"); this.UsingNamespaces.Add("System.Text"); this.UsingNamespaces.Add("System.Data"); this.UsingNamespaces.Add("System.Diagnostics"); this.UsingNamespaces.Add("System.Runtime.CompilerServices"); this.UsingNamespaces.Add("ScriptCoreLib"); this.UsingNamespaces.Add("ScriptCoreLib.Extensions"); this.UsingNamespaces.Add("ScriptCoreLib.Delegates"); // <h1 id='Header'>JSC - The .NET crosscompiler for web platforms.</h1> var HeaderField = new SolutionProjectLanguageField { Name = "Header", FieldType = new StockTypes.KnownStockTypes.System.Xml.Linq.XElement() }; // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201406/20140602 HeaderField.Summary = "The static content defined in the HTML file will be update to the dynamic content once application is running."; HeaderField.FieldConstructor = new PseudoCallExpression { Method = new StockTypes.KnownStockTypes.System.Xml.Linq.XElement().GetDefaultConstructorDefinition(), ParameterExpressions = new object[] { new PseudoStringConstantExpression { Value = "h1" }, new PseudoStringConstantExpression { Value = "JSC - The .NET crosscompiler for web platforms. ready." } } }; this.Fields.Add(HeaderField); this.WebMethod2 = new StockMethodWebMethod(Interactive); this.Methods.Add(WebMethod2); }
public ApplicationYieldToDocumentTitleExpression(SolutionBuilderInteractive Interactive) { this.Comment = "Show the server message as document title"; this.Method = new KnownStockTypes.ScriptCoreLib.JavaScript.Extensions.JavaScriptStringExtensions.ToDocumentTitle(); this.ParameterExpressions = new[] { Interactive.YieldMethod_doc }; }
public StockApplicationWebServiceType(SolutionBuilderInteractive Interactive) { // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201406/20140602 // we can now use it as a base type for our client side apps //this.IsSealed = true; // Cassini will not be able to support debugging if WebService is made internal? //this.IsInternal = true; // will this help us? //this.IsPartial = true; this.Name = "ApplicationWebService"; this.Summary = "Methods defined in this type can be used from JavaScript. The method calls will seamlessly be proxied to the server."; this.UsingNamespaces.Add("System"); this.UsingNamespaces.Add("System.Linq"); this.UsingNamespaces.Add("System.Xml.Linq"); this.UsingNamespaces.Add("System.Collections.Generic"); this.UsingNamespaces.Add("System.Threading.Tasks"); this.UsingNamespaces.Add("System.Text"); this.UsingNamespaces.Add("System.Data"); this.UsingNamespaces.Add("System.Diagnostics"); this.UsingNamespaces.Add("System.Runtime.CompilerServices"); this.UsingNamespaces.Add("ScriptCoreLib"); this.UsingNamespaces.Add("ScriptCoreLib.Extensions"); this.UsingNamespaces.Add("ScriptCoreLib.Delegates"); // <h1 id='Header'>JSC - The .NET crosscompiler for web platforms.</h1> var HeaderField = new SolutionProjectLanguageField { Name = "Header", FieldType = new StockTypes.KnownStockTypes.System.Xml.Linq.XElement() }; // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201406/20140602 HeaderField.Summary = "The static content defined in the HTML file will be update to the dynamic content once application is running."; HeaderField.FieldConstructor = new PseudoCallExpression { Method = new StockTypes.KnownStockTypes.System.Xml.Linq.XElement().GetDefaultConstructorDefinition(), ParameterExpressions = new object[] { new PseudoStringConstantExpression { Value = "h1"}, new PseudoStringConstantExpression { Value = "JSC - The .NET crosscompiler for web platforms. ready."} } }; this.Fields.Add(HeaderField); this.WebMethod2 = new StockMethodWebMethod(Interactive); this.Methods.Add(WebMethod2); }
public StockMethodWebMethod(SolutionBuilderInteractive Interactive) { // note: this method will run under javascript #region Parameters e y var _e = new SolutionProjectLanguageArgument { Type = new KnownStockTypes.System.String(), Name = "e", Summary = "A parameter from javascript." }; var _y = new SolutionProjectLanguageArgument { Type = new KnownStockTypes.System.ActionOfString(), Name = "y", Summary = "A callback to javascript." }; #endregion this.Name = "WebMethod2"; this.Summary = "This Method is a javascript callable method."; this.Code = new SolutionProjectLanguageCode { //Interactive.WebMethod2, "Send it back to the caller.", new PseudoCallExpression { Object = _y.Name, Method = new SolutionProjectLanguageMethod { Name = "Invoke" }, ParameterExpressions = new [] { _e.Name } } }; this.Parameters.Add(_e); this.Parameters.Add(_y); }
public StockMethodApplication(SolutionProjectLanguageType DeclaringType, SolutionBuilderInteractive Interactive /*, SolutionProjectLanguageField style*/) { // note: this method will run under javascript #region Parameters args var _page = new SolutionProjectLanguageArgument { Type = new SolutionProjectLanguageType { Name = "IApp" }, //Name = "document", Name = "page", Summary = "HTML document rendered by the web server which can now be enhanced." }; #endregion this.Name = SolutionProjectLanguageMethod.ConstructorName; this.Summary = "This is a javascript application."; this.Code = new SolutionProjectLanguageCode(); Interactive.RaiseGenerateApplicationExpressions(this.Code.Add); //#region style.Content.AttachToHead //var style_get_Content = // new PseudoCallExpression // { // Object = style, // Method = // new SolutionProjectLanguageMethod // { // IsProperty = true, // Name = "get_Content", // ReturnType = new KnownStockTypes.ScriptCoreLib.JavaScript.DOM.HTML.IHTMLElement() // } // }; //this.Code.Add( // new KnownStockTypes.ScriptCoreLib.JavaScript.Extensions.INodeExtensions.AttachToHead().ToCallExpression( // style_get_Content // ) //); //#endregion this.Code.Add(Interactive.ApplicationToDocumentTitle); // visual basic demands a local variable! this.Code.Add(Interactive.ApplicationCallWebMethod); this.DeclaringType = DeclaringType; this.Parameters.Add(_page); }