コード例 #1
0
ファイル: ajaxHlp.cs プロジェクト: mgerasika/gam-gam
        private void SendInternal(string httpMethod, string type, JsString url, object data,
            JsAction<object, JsString, jqXHR> success,
            JsAction<JsError, JsString, jqXHR> failed)
        {
            url = addTimeToUrl(url);

            JsObject headers = new JsObject();
            AjaxSettings ajaxSettings = new AjaxSettings
            {
                type = httpMethod,
                dataType = type,
                data = data,
                url = jsUtils.inst.getLocation() + "/" + url,
                headers = headers,
                success = delegate(object o, JsString s, jqXHR arg3) { success(o, s, arg3); },
                error = delegate(jqXHR xhr, JsString s, JsError arg3) { failed(arg3, s, xhr); }
            };
            bool isString = data.As<JsObject>()["toLowerCase"] != null;
            if (isString)
            {
                ajaxSettings.processData = true;
                ajaxSettings.contentType = (type.As<JsString>().toLowerCase() == "xml")
                    ? "application/xml"
                    : "application/json";
            }

            jQuery.ajax(
                ajaxSettings);
        }
コード例 #2
0
ファイル: ajaxHlp.cs プロジェクト: mgerasika/gam-gam
        public void SendGet(string type, JsString url, JsAction<object, JsString, jqXHR> success,
            JsAction<JsError, JsString, jqXHR> failed)
        {
            url = addTimeToUrl(url);

            JsObject headers = new JsObject();
            jQuery.ajax(new AjaxSettings
            {
                type = "GET",
                dataType = type,
                url = jsUtils.inst.getLocation() + "/" + url,
                headers = headers,
                success = delegate(object o, JsString s, jqXHR arg3) { success(o, s, arg3); },
                error = delegate(jqXHR xhr, JsString s, JsError arg3) { failed(arg3, s, xhr); }
            });
        }
コード例 #3
0
ファイル: Tree.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Shorthand for removeManagedListener. ...
 /// </summary>
 public object mun(object item, object ename, JsAction fn, object scope){return null;}
コード例 #4
0
ファイル: TheMProject.cs プロジェクト: hultqvist/SharpKit-SDK
 /// <summary>
 /// The method returns the connection status of the device by invoking a callback function with the status passed.
 /// The status is retrieved by trying to insert an image (tag) into the DOM whose reference URL is a remote stored image
 /// (by default the google logo of google.de is used - we assume that if google is down, you're not connected.
 /// If this is not reliable enough, simply pass your URL as second parameter to the method call).
 /// </summary>
 /// <param name="callback">The callback object defining target and action.
 /// It is also possible to just pass a function to action instead of a string naming the method in a controller.
 /// A constant string (M.ONLINE or M.OFFLINE) is passed to the callback as parameter defining whether the device is online or offline.</param>
 /// <param name="url"> A URL defining a location of an image that is tried to include. If nothing is passed, a default url is used.</param>
 public void getConnectionStatus(JsAction callback, JsString url) { }
コード例 #5
0
ファイル: Cookie.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Returns the value of a subcookie.
 /// </summary>
 public object getSub(object name, object subName, JsAction converter){return null;}
コード例 #6
0
ファイル: Array.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Iterates an array and invoke the given callback function for each item. ...
 /// </summary>
 public static object forEach( JsArray array, JsAction fn, object scope ) { return null; }
コード例 #7
0
ファイル: Array.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Sorts the elements of an Array. ...
 /// </summary>
 public static JsArray sort( JsArray array, JsAction sortFn = null ) { return null; }
コード例 #8
0
ファイル: NodeList.cs プロジェクト: hultqvist/SharpKit-SDK
 /// <summary>
 /// Applies the given function to each Node in the NodeList.
 /// </summary>
 public void each(JsAction fn, object context){}
コード例 #9
0
 /// <summary>
 /// Listens for the "on" moment of events fired by the host,
 /// or injects code "before" a given method on the host.
 /// </summary>
 public EventHandle doBefore(object strMethod, JsAction fn, object context)
 {
     return(null);
 }
コード例 #10
0
 /// <summary>
 /// Injects a function to be executed before a given method on host object.
 /// The function will be detached when the plugin is unplugged.
 /// </summary>
 public EventHandle beforeHostMethod(object method, JsAction fn, object context)
 {
     return(null);
 }
コード例 #11
0
ファイル: breeze-1.3.2.cs プロジェクト: polytronicgr/sharpkit
 public JsNumber subscribe(JsAction <ValidationErrorsChangedEventArgs> callback = null)
 {
     return(null);
 }
コード例 #12
0
ファイル: breeze-1.3.2.cs プロジェクト: polytronicgr/sharpkit
 public JsNumber subscribe(JsAction <PropertyChangedEventArgs> callback = null)
 {
     return(null);
 }
コード例 #13
0
ファイル: breeze-1.3.2.cs プロジェクト: polytronicgr/sharpkit
 public Promise loadNavigationProperty(NavigationProperty navigationProperty, JsAction callback = null, JsAction errorCallback = null)
 {
     return(null);
 }
コード例 #14
0
ファイル: breeze-1.3.2.cs プロジェクト: polytronicgr/sharpkit
 public JsNumber subscribe(JsAction <object> callback = null)
 {
     return(null);
 }
コード例 #15
0
ファイル: breeze-1.3.2.cs プロジェクト: polytronicgr/sharpkit
 public Promise then(JsAction callback)
 {
     return(null);
 }
コード例 #16
0
ファイル: NodeList.cs プロジェクト: hultqvist/SharpKit-SDK
 /// <summary>
 /// Executes the function once for each node until a true value is returned.
 /// </summary>
 public object some(JsAction fn, object context){return null;}
コード例 #17
0
ファイル: NodeList.cs プロジェクト: hultqvist/SharpKit-SDK
 /// <summary>
 /// Displays or hides each node.
 /// If the "transition" module is loaded, toggleView optionally
 /// animates the toggling of the nodes using either the default
 /// transition effect ('fadeIn'), or the given named effect.
 /// </summary>
 public void toggleView(object on, JsAction callback){}
コード例 #18
0
 /// <summary>
 /// Listens for the "on" moment of events fired by the host object.
 /// Listeners attached through this method will be detached when the plugin is unplugged.
 /// </summary>
 public EventHandle onHostEvent(object type, JsAction fn, object context)
 {
     return(null);
 }
コード例 #19
0
        private void requestCanRefund(int day, JsAction complete)
        {
            JsService.Inst.MoneyApi.CanRefund(day, delegate(bool res) {
                ngEntry.canRefund = jsCommonUtils.inst.toBool(res);

                HtmlContext.console.log("request can refund for day = " + day + " response = " + ngEntry.canRefund);
                if (null != complete) {
                    complete();
                }
            });
        }
コード例 #20
0
 /// <summary>
 /// Adds a listener to be notified when the browser window is resized and provides resize event buffering (100 millisecon...
 /// </summary>
 public static object onWindowResize(JsAction fn, object scope, bool options)
 {
     return(null);
 }
コード例 #21
0
ファイル: Array.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Iterates an array or an iterable value and invoke the given callback function for each item. ...
 /// </summary>
 public static bool each( object iterable, JsAction fn ) { return false; }
コード例 #22
0
 /// <summary>
 /// Removes an event handler from an element. ...
 /// </summary>
 public static object removeListener(object el, JsString eventName, JsAction fn, object scope)
 {
     return(null);
 }
コード例 #23
0
ファイル: Array.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Returns the maximum value in the Array. ...
 /// </summary>
 public static object max( object array, JsAction comparisonFn = null ) { return null; }
コード例 #24
0
 /// <summary>
 /// Removes the passed window resize listener. ...
 /// </summary>
 public static object removeResizeListener(JsAction fn, object scope)
 {
     return(null);
 }
コード例 #25
0
 public void func2(JsAction<string> callback)
 {
 }
コード例 #26
0
 /// <summary>
 /// Removes the passed window unload listener. ...
 /// </summary>
 public static object removeUnloadListener(JsAction fn, object scope)
 {
     return(null);
 }
コード例 #27
0
ファイル: Tree.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Adds listeners to any Observable object (or Element) which are automatically removed when this Component is
 /// destroyed. ...
 /// </summary>
 public object addManagedListener(object item, object ename, JsAction fn=null, object scope=null, object opt=null){return null;}
コード例 #28
0
 /// <summary>
 /// Adds a listener to be notified when the document is ready (before onload and before images are loaded). ...
 /// </summary>
 public static object onDocumentReady(JsAction fn, object scope = null, bool options = false)
 {
     return(null);
 }
コード例 #29
0
ファイル: Tree.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Removes an event handler. ...
 /// </summary>
 public object removeListener(JsString eventName, JsAction handler, object scope=null){return null;}
コード例 #30
0
ファイル: Utils.cs プロジェクト: mustang2247/SharpKit-SDK
        //TODO: ServerOptions:  The options is similar to tls.createServer().

        /// <summary>
        /// Makes a request to a secure web server.
        /// </summary>
        /// <param name="options">options can be an object or a string. If options is a string, it is automatically parsed with url.parse().
        /// All options from http.request() are valid.</param>
        /// <param name="callback"></param>
        /// <returns></returns>
        /// <example>
        /// Example:
        /// <code>
        /// var https = require('https');
        ///
        ///var options = {
        ///  hostname: 'encrypted.google.com',
        ///  port: 443,
        ///  path: '/',
        ///  method: 'GET'
        ///};
        ///
        ///var req = https.request(options, function(res) {
        ///  console.log("statusCode: ", res.statusCode);
        ///  console.log("headers: ", res.headers);
        ///
        ///  res.on('data', function(d) {
        ///    process.stdout.write(d);
        ///  });
        ///});
        ///req.end();
        ///
        ///req.on('error', function(e) {
        ///  console.error(e);
        ///});
        /// </code>
        /// </example>
        /// The options argument has the following options:
        /// <list type = "bullet">
        ///host: A domain name or IP address of the server to issue the request to. Defaults to 'localhost'.
        ///hostname: To support url.parse() hostname is preferred over host
        ///port: Port of remote server. Defaults to 443.
        ///method: A string specifying the HTTP request method. Defaults to 'GET'.
        ///path: Request path. Defaults to '/'. Should include query string if any. E.G. '/index.html?page=12'
        ///headers: An object containing request headers.
        ///auth: Basic authentication i.e. 'user:password' to compute an Authorization header.
        ///agent: Controls Agent behavior. When an Agent is used request will default to Connection: keep-alive. Possible values:
        ///undefined (default): use globalAgent for this host and port.
        ///Agent object: explicitly use the passed in Agent.
        ///false: opts out of connection pooling with an Agent, defaults request to Connection: close.
        /// </list>
        ///The following options from tls.connect() can also be specified. However, a globalAgent silently ignores these.
        ///<list type = "bullet">
        ///pfx: Certificate, Private key and CA certificates to use for SSL. Default null.
        ///key: Private key to use for SSL. Default null.
        ///passphrase: A string of passphrase for the private key or pfx. Default null.
        ///cert: Public x509 certificate to use. Default null.
        ///ca: An authority certificate or array of authority certificates to check the remote host against.
        ///ciphers: A string describing the ciphers to use or exclude. Consult http:///www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT for details on the format.
        ///rejectUnauthorized: If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Verification happens at the connection level, before the HTTP request is sent. Default false.
        ///</list>
        ///In order to specify these options, use a custom Agent.
        /// <example>
        ///Example:
        /// <code>
        ///var options = {
        ///  hostname: 'encrypted.google.com',
        ///  port: 443,
        ///  path: '/',
        ///  method: 'GET',
        ///  key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
        ///  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
        ///};
        ///options.agent = new https.Agent(options);
        ///
        ///var req = https.request(options, function(res) {
        ///  ...
        ///}
        ///</code>
        ///</example>
        ///Or does not use an Agent.
        ///<example>
        ///Example:
        /// <code>
        ///var options = {
        ///  hostname: 'encrypted.google.com',
        ///  port: 443,
        ///  path: '/',
        ///  method: 'GET',
        ///  key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
        ///  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
        ///  agent: false
        ///};
        ///
        ///var req = https.request(options, function(res) {
        ///  ...
        ///}
        ///</code>
        ///</example>
        public object request(RequestOptions options, JsAction callback)
        {
            return(null);
        }
コード例 #31
0
 /// <summary>
 /// Adds listeners to any Observable object (or Element) which are automatically removed when this Component is
 /// destroyed. ...
 /// </summary>
 public object addManagedListener(object item, object ename, JsAction fn = null, object scope = null, object opt = null)
 {
     return(null);
 }
コード例 #32
0
ファイル: Utils.cs プロジェクト: mustang2247/SharpKit-SDK
        //TODO: can also use tls.connect() options

        /// <summary>
        /// Like http.get() but for HTTPS.
        /// </summary>
        /// <param name="options">options can be an object or a string. If options is a string, it is automatically parsed with url.parse(). </param>
        /// <param name="callback"></param>
        /// <returns></returns>
        /// <example>
        /// Example:
        /// <code>
        /// var https = require('https');
        ///
        /// https.get('https://encrypted.google.com/', function(res) {
        ///   console.log("statusCode: ", res.statusCode);
        ///   console.log("headers: ", res.headers);
        ///
        ///   res.on('data', function(d) {
        ///     process.stdout.write(d);
        ///   });
        ///
        /// }).on('error', function(e) {
        ///   console.error(e);
        /// });
        /// </code>
        /// </example>
        public object get(JsString options, JsAction callback)
        {
            return(null);
        }
コード例 #33
0
ファイル: NodeList.cs プロジェクト: hultqvist/SharpKit-SDK
 /// <summary>
 /// Displays or hides each node.
 /// If the "transition" module is loaded, toggleView optionally
 /// animates the toggling of the nodes using either the default
 /// transition effect ('fadeIn'), or the given named effect.
 /// </summary>
 public void toggleView(JsAction callback){}
コード例 #34
0
ファイル: Utils.cs プロジェクト: mustang2247/SharpKit-SDK
 /// <summary>
 /// Like http.get() but for HTTPS.
 /// </summary>
 /// <param name="options">options can be an object or a string. If options is a string, it is automatically parsed with url.parse(). </param>
 /// <param name="callback"></param>
 /// <returns></returns>
 /// <example>
 /// Example:
 /// <code>
 /// var https = require('https');
 ///
 /// https.get('https://encrypted.google.com/', function(res) {
 ///   console.log("statusCode: ", res.statusCode);
 ///   console.log("headers: ", res.headers);
 ///
 ///   res.on('data', function(d) {
 ///     process.stdout.write(d);
 ///   });
 ///
 /// }).on('error', function(e) {
 ///   console.error(e);
 /// });
 /// </code>
 /// </example>
 public object get(object options, JsAction callback)
 {
     return(null);
 }
コード例 #35
0
ファイル: NodeList.cs プロジェクト: hultqvist/SharpKit-SDK
 /// <summary>
 /// Animate one or more css properties to a given value. Requires the "transition" module.
 /// <pre>example usage:
 /// Y.all('.demo').transition({
 /// duration: 1, // in seconds, default is 0.5
 /// easing: 'ease-out', // default is 'ease'
 /// delay: '1', // delay start for 1 second, default is 0
 /// height: '10px',
 /// width: '10px',
 /// opacity: { // per property
 /// value: 0,
 /// duration: 2,
 /// delay: 2,
 /// easing: 'ease-in'
 /// }
 /// });
 /// </pre>
 /// </summary>
 public void transition(object config, JsAction callback){}
コード例 #36
0
ファイル: Utils.cs プロジェクト: mustang2247/SharpKit-SDK
        /// <summary>
        /// Returns a new HTTPS web server object. The options is similar to tls.createServer(). The requestListener is a function which is automatically added to the 'request' event.
        /// <example>
        /// Example:
        ///<code>
        /// // curl -k https://localhost:8000/
        /// var https = require('https');
        /// var fs = require('fs');

        /// var options = {
        ///  key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
        ///  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
        /// };

        /// https.createServer(options, function (req, res) {
        ///   res.writeHead(200);
        ///   res.end("hello world\n");
        /// }).listen(8000);
        /// </code>
        /// </example>
        /// <example>
        /// Or
        ///<code>
        /// var https = require('https');
        /// var fs = require('fs');
        ///
        /// var options = {
        ///  pfx: fs.readFileSync('server.pfx')
        /// };
        ///
        /// https.createServer(options, function (req, res) {
        ///   res.writeHead(200);
        ///   res.end("hello world\n");
        /// }).listen(8000);
        /// </code>
        /// </example>
        /// </summary>
        /// </summary>
        /// <param name="options"> The options is similar to tls.createServer(). </param>
        /// <param name="requestListener">The requestListener is a function which is automatically added to the 'request' event.</param>
        /// <returns>Returns a new HTTPS web server object.</returns>
        public object createServer(object options, JsAction requestListener)
        {
            return(null);
        }
コード例 #37
0
 public void requestGetMoney(string userId, JsAction<decimal> complete)
 {
     JsService.Inst.MoneyApi.GetMoney(userId, delegate(decimal res) {
         if (null != complete) {
             complete(res);
         }
     });
 }
コード例 #38
0
 public int SetTimeout(JsAction handler, int timeout)
 {
     return(default(int));
 }
コード例 #39
0
        private void requestGetUsers(JsAction complete)
        {
            JsService.Inst.UsersApi.GetUsers(delegate(JsArray<ngUserModel> res) {
                JsArray<ngUserModel> tmp = new JsArray<ngUserModel>();
                foreach (ngUserModel user in res) {
                    if (-1 != user.Email.As<JsString>().indexOf("darwins")) {
                        tmp.Add(user);
                    }
                }
                ngUsers = tmp;

                if (null != complete) {
                    complete();
                }
            });
        }
コード例 #40
0
 public int SetInterval(JsAction handler, int timeout)
 {
     return(default(int));
 }
コード例 #41
0
ファイル: Array.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Iterates an array or an iterable value and invoke the given callback function for each item. ...
 /// </summary>
 public static bool each( object iterable, JsAction fn, object scope, bool reverse ) { return false; }
コード例 #42
0
 /// <summary>
 /// Expand a record that is loaded in the view. ...
 /// </summary>
 public object expand(Ext.data.Model record, bool deep = false, JsAction callback = null, object scope = null)
 {
     return(null);
 }
コード例 #43
0
ファイル: Array.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Executes the specified function for each array element until the function returns a falsy value. ...
 /// </summary>
 public static bool every( JsArray array, JsAction fn, object scope ) { return false; }
コード例 #44
0
 /// <summary>
 /// Sets which view is active/visible for the application. This will set the
 /// app's `activeView` attribute to the specified `view`.
 /// When a string-name is provided for a view which has been registered on this
 /// app's `views` object, the referenced metadata will be used and the
 /// `activeView` will be set to either a preserved view instance, or a new
 /// instance of the registered view will be created using the specified `config`
 /// object passed-into this method.
 /// A callback function can be specified as either the third or fourth argument,
 /// and this function will be called after the new `view` becomes the
 /// `activeView`, is rendered to the `viewContainer`, and is ready to use.
 /// </summary>
 public void showView(object view, JsAction callback)
 {
 }
コード例 #45
0
ファイル: Array.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Creates a new array with the results of calling a provided function on every element in this array. ...
 /// </summary>
 public static JsArray map( JsArray array, JsAction fn, object scope ) { return null; }
コード例 #46
0
 /// <summary>
 /// Sets which view is active/visible for the application. This will set the
 /// app's `activeView` attribute to the specified `view`.
 /// When a string-name is provided for a view which has been registered on this
 /// app's `views` object, the referenced metadata will be used and the
 /// `activeView` will be set to either a preserved view instance, or a new
 /// instance of the registered view will be created using the specified `config`
 /// object passed-into this method.
 /// A callback function can be specified as either the third or fourth argument,
 /// and this function will be called after the new `view` becomes the
 /// `activeView`, is rendered to the `viewContainer`, and is ready to use.
 /// </summary>
 public void showView(object view, object config, object options, JsAction callback)
 {
 }
コード例 #47
0
	public void requestPermission(JsAction callback) {}
コード例 #48
0
 /// <summary>
 /// Cascades down the component/container heirarchy from this component (passed in the first call), calling the specified...
 /// </summary>
 public Ext.container.Container cascade(JsAction fn, object scope = null, JsArray args = null)
 {
     return(null);
 }
コード例 #49
0
 public void func1(JsAction callback)
 {
 }
コード例 #50
0
 /// <summary>
 /// Shorthand for addManagedListener. ...
 /// </summary>
 public object mon(object item, object ename, JsAction fn = null, object scope = null, object opt = null)
 {
     return(null);
 }
コード例 #51
0
 public void func2(JsAction<int> callback)
 {
 }
コード例 #52
0
 /// <summary>
 /// Shorthand for removeManagedListener. ...
 /// </summary>
 public object mun(object item, object ename, JsAction fn, object scope)
 {
     return(null);
 }
コード例 #53
0
ファイル: TheMProject.cs プロジェクト: hultqvist/SharpKit-SDK
 /// <summary>
 /// The method returns the connection status of the device by invoking a callback function with the status passed.
 /// The status is retrieved by trying to insert an image (tag) into the DOM whose reference URL is a remote stored image
 /// (by default the google logo of google.de is used - we assume that if google is down, you're not connected.
 /// If this is not reliable enough, simply pass your URL as second parameter to the method call).
 /// </summary>
 /// <param name="callback">The callback object defining target and action.
 /// It is also possible to just pass a function to action instead of a string naming the method in a controller.
 /// A constant string (M.ONLINE or M.OFFLINE) is passed to the callback as parameter defining whether the device is online or offline.</param>
 public void getConnectionStatus(JsAction callback) { }
コード例 #54
0
 /// <summary>
 /// Removes an event handler. ...
 /// </summary>
 public object removeListener(JsString eventName, JsAction handler, object scope = null)
 {
     return(null);
 }
コード例 #55
0
ファイル: Tree.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Shorthand for addManagedListener. ...
 /// </summary>
 public object mon(object item, object ename, JsAction fn=null, object scope=null, object opt=null){return null;}
コード例 #56
0
 /// <summary>
 /// Removes listeners that were added by the mon method. ...
 /// </summary>
 public object removeManagedListener(object item, object ename, JsAction fn, object scope)
 {
     return(null);
 }
コード例 #57
0
ファイル: Tree.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Shorthand for addListener. ...
 /// </summary>
 public object on(JsString eventName, JsAction handler, object scope=null, object options=null){return null;}
コード例 #58
0
 /// <summary>
 /// Shorthand for removeListener. ...
 /// </summary>
 public object un(JsString eventName, JsAction handler, object scope = null)
 {
     return(null);
 }
コード例 #59
0
ファイル: Tree.cs プロジェクト: fjgandrade/sharpkit
 /// <summary>
 /// Removes listeners that were added by the mon method. ...
 /// </summary>
 public object removeManagedListener(object item, object ename, JsAction fn, object scope){return null;}
コード例 #60
0
 /// <summary>
 /// Appends an event handler to this object. ...
 /// </summary>
 public object addListener(JsString eventName, JsAction handler, object scope = null, object options = null)
 {
     return(null);
 }