예제 #1
0
 public static IObservable <TResult> ifThen <TResult>(
     JsFunc <bool> condition,
     IObservable <TResult> thenSource,
     IScheduler scheduler = null)
 {
     return(null);
 }
예제 #2
0
        //TODO: Error: "title is not defind
        static void OnReady()
        {
            template = Kendo.template(new jQuery("#template").html()).As < JsFunc<JsArray, JsString>>();
            preview();
            new jQuery("#preview").click(preview);

        }
예제 #3
0
 public static IObservable <TResult> ifThen <TResult>(
     JsFunc <bool> condition,
     IObservable <TResult> thenSource,
     IObservable <TResult> elseSource)
 {
     return(null);
 }
예제 #4
0
        static void OnReady()
        {
            var grid = new jQuery("#grid").kendoGrid(new GridConfiguration
            {
                dataSourceObject = new DataSourceConfiguration
                {
                    pageSize = 10,
                    data = People.createRandomData(50)
                },
                pageableBoolean = true,
                height = 260,
                columns = new JsArray<GridColumnConfiguration> {
                    new GridColumnConfiguration { field = "FirstName", title = "First Name" },
                    new GridColumnConfiguration { field = "LastName", title = "Last Name" },
                    new GridColumnConfiguration { field = "Title" },
                    new GridColumnConfiguration { command = new {text="Details", click= new JsAction<Event>(showDetails)}.As<GridColumnsCommandOptions>(), title = " ", widthString = "110px"}
                }

            }).data("kendoGrid");

            wnd = new jQuery("#details").kendoWindow(new WindowConfiguration
            {
                title = "Customer Details",
                modal = true,
                visible = false,
                resizable = false,
                width = "300"
            }).data("kendoWindow").As<Window>();
           detailsTemplate = Kendo.template(new jQuery("#template").html());
           
        }
        /// <summary>
        ///   The default function definition for the action
        /// </summary>
        /// <returns>A function with an empty body but the function parameters filled in</returns>
        public static JsFunc GetDefaultActionFunc()
        {
            JsFunc fn = new JsFunc
            {
                ParameterNames = new[] { "e", "dt", "node", "config" }
            };

            return(fn);
        }
예제 #6
0
        /// <summary>
        ///   Sets up the created row callback.
        /// </summary>
        /// <remarks>
        ///   Invoked when status column is enabled for the datatable via the
        ///   <see cref="WebExtras.JQDataTables.Datatable" /> constructor
        /// </remarks>
        public virtual void SetupfnCreatedRow()
        {
            string[]     fnParamNames = { "nRow", "aData", "iDataIndex" };
            const string fnBody       = "$(nRow).addClass(aData[aData.length - 1]);";

            fnCreatedRow = new JsFunc {
                Body = fnBody, ParameterNames = fnParamNames
            };
        }
예제 #7
0
        public static JsArray <R> JsSelect <T, R>(this JsArray <T> list, JsFunc <T, R> selector)
        {
            var list2 = new JsArray <R>();

            foreach (var item in list)
            {
                list2.push(selector(item));
            }
            return(list2);
        }
예제 #8
0
 public static Element FindParent(this Element el, JsFunc <Element, bool> selector)
 {
     while (el != null)
     {
         if (selector(el))
         {
             return(el);
         }
         el = el.parentNode.As <HtmlElement>();
     }
     return(null);
 }
예제 #9
0
        public static JsArray <T> OrderBy <T>(this JsArray <T> array, JsFunc <T, object> selector, bool desc)
        {
            var array2 = array.slice(0);

            if (!desc)
            {
                array2.sort((x, y) => Compare(selector(x), selector(y)));
            }
            else
            {
                array2.sort((x, y) => CompareDesc(selector(x), selector(y)));
            }
            return(array2);
        }
예제 #10
0
        public void Anonymous_JsFunc_Serializes_Properly()
        {
            // Arrange
            JsFunc js = new JsFunc();

            js.Body = "alert(test_param1 + test_param2);";

            string expected = "function () { alert(test_param1 + test_param2); }";

            // Act
            string result = JsonConvert.SerializeObject(js);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(expected, result);
        }
예제 #11
0
        public void Named_JsFunc_With_Parameters_Serializes_Properly()
        {
            // Arrange
            JsFunc js = new JsFunc();

            js.Name           = "foo";
            js.ParameterNames = new[] { "test_param1", "test_param2" };
            js.Body           = "alert(test_param1 + test_param2);";

            string expected = "function foo(test_param1, test_param2) { alert(test_param1 + test_param2); }";

            // Act
            string result = JsonConvert.SerializeObject(js);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(expected, result);
        }
예제 #12
0
        static void OnReady()
        {
            var grid = new jQuery("#grid").kendoGrid(new GridConfiguration
            {
                dataSourceObject = new DataSourceConfiguration
                {
                    pageSize = 10,
                    data     = People.createRandomData(50)
                },
                pageableBoolean = true,
                height          = 260,
                columns         = new JsArray <GridColumnConfiguration> {
                    new GridColumnConfiguration {
                        field = "FirstName", title = "First Name"
                    },
                    new GridColumnConfiguration {
                        field = "LastName", title = "Last Name"
                    },
                    new GridColumnConfiguration {
                        field = "Title"
                    },
                    new GridColumnConfiguration {
                        command = new { text = "Details", click = new JsAction <Event>(showDetails) }.As <GridColumnsCommandOptions>(), title = " ", widthString = "110px"
                    }
                }
            }).data("kendoGrid");

            wnd = new jQuery("#details").kendoWindow(new WindowConfiguration
            {
                title     = "Customer Details",
                modal     = true,
                visible   = false,
                resizable = false,
                width     = "300"
            }).data("kendoWindow").As <Window>();
            detailsTemplate = Kendo.template(new jQuery("#template").html());
        }
예제 #13
0
        /// <summary>
        ///   Sets up postbacks for the server data callback
        /// </summary>
        /// <param name="postbacks">Postbacks to be setup</param>
        /// <remarks>Invoked when there are postbacks via the <see cref="WebExtras.JQDataTables.Datatable" /> constructor </remarks>
        public virtual void SetupfnServerData(IEnumerable <PostbackItem> postbacks)
        {
            IEnumerable <PostbackItem> postbackItems = postbacks as IList <PostbackItem> ?? postbacks.ToList();

            if (postbacks == null || !postbackItems.Any())
            {
                return;
            }

            string[] aoDataPushes = postbackItems.Select(f => string.Format("aoData.push({0});", f.ToJson())).ToArray();

            string[] fnParamNames = { "sSource", "aoData", "fnCallback" };

            StringBuilder fnBody = new StringBuilder();

            fnBody.Append("\n\t\t");
            fnBody.Append(string.Join("\n\t\t", aoDataPushes));
            fnBody.Append("\n\t\t");
            fnBody.Append("$.getJSON(sSource, aoData, function(json) { fnCallback(json); });");

            fnServerData = new JsFunc {
                ParameterNames = fnParamNames, Body = fnBody.ToString()
            };
        }
예제 #14
0
 public static IObservable <TSource[]> buffer <TSource, TBufferOpening, TBufferClosing>(this IObservable <TSource> source,
                                                                                        IObservable <TBufferOpening> bufferOpenings, JsFunc <TBufferOpening, IObservable <TBufferClosing> > bufferClosingSelector)
 {
     return(null);
 }
예제 #15
0
 public static IObservable <TResult> groupJoin <TLeft, TRight, TLeftDuration, TRightDuration, TResult>(this IObservable <TLeft> left,
                                                                                                       IObservable <TRight> right, JsFunc <TLeft, IObservable <TLeftDuration> > leftDurationSelector,
                                                                                                       JsFunc <TRight, IObservable <TRightDuration> > rightDurationSelector,
                                                                                                       JsFunc <TLeft, IObservable <TRight>, TResult> resultSelector)
 {
     return(null);
 }
예제 #16
0
 public static DependentObservable <T> dependentObservable <T>(JsFunc <T> func)
 {
     return(null);
 }
예제 #17
0
 /// <summary>
 /// Retrieves events that FullCalendar has in memory.
 /// This method will return an array of Event Objects that FullCalendar has stored in client-side memory.
 /// If idOrFilter is omitted, all events will be returned.
 /// If idOrFilter is an ID, all events with the same ID will be returned.
 /// idOrFilter may also be a filter function that accepts one Event Object argument and returns true if it should be included in the result set.
 /// In versions 1.2 and 1.2.1, this option was known as getEventsByID
 /// </summary>
 /// <param name="filter"></param>
 /// <returns></returns>
 public JsArray<Event> clientEvents(JsFunc<Event, bool> filter) { return null; }
예제 #18
0
 public static IObservable <TResult> forkJoin <TFirst, TSecond, TResult>(this IObservable <TFirst> first, IObservable <TSecond> second,
                                                                         JsFunc <TFirst, TSecond, TResult> resultSelector)
 {
     return(null);
 }
예제 #19
0
 public static IObservable <TSource> whileDo <TSource>(JsFunc <bool> condition, IObservable <TSource> source)
 {
     return(null);
 }
예제 #20
0
 public ParametricGeometry(JsFunc<JsNumber, JsNumber, JsNumber> func, JsNumber slices, JsNumber stacks, JsBoolean useTris) { }
예제 #21
0
 //TODO: Error: "title is not defind
 static void OnReady()
 {
     template = Kendo.template(new jQuery("#template").html()).As <JsFunc <JsArray, JsString> >();
     preview();
     new jQuery("#preview").click(preview);
 }
예제 #22
0
 public static IObservable <TResult> switchCase <TValue, TResult>(JsFunc <TValue> selector, JsObject <TValue, IObservable <TResult> > sources, IObservable <TResult> defaultSource)
 {
     return(null);
 }
예제 #23
0
 /// <summary>
 /// Performs a sort using the comparator function.
 /// </summary>
 /// <param name="comparator">The comparing function.</param>
 public void sort(JsFunc <T, T, int> comparator)
 {
 }
예제 #24
0
 /// <summary>
 /// Removes all values that satisfy the predicate and returns them.
 /// </summary>
 /// <param name="predicate">The removal predicate.</param>
 /// <returns>The removed values.</returns>
 public T[] remove(JsFunc <T, bool> predicate)
 {
     return(null);
 }
예제 #25
0
 /// <summary>
 /// Marks all values that satisfy the predicate as deleted.
 /// </summary>
 /// <param name="predicate">The predicate.</param>
 public void destroy(JsFunc <T, bool> predicate)
 {
 }
예제 #26
0
 /// <summary>
 /// Invoked whenever an observable associated with this binding changes.
 /// </summary>
 /// <param name="element">The element involved in this binding.</param>
 /// <param name="valueAccessor">A function which returns the model property that is involved in this binding.</param>
 /// <param name="allBindingsAccessor">A function which returns all the model properties bound to this element.</param>
 /// <param name="viewModel">The view model instance involved in this binding.</param>
 public virtual void update(HtmlElement element, JsFunc <object> valueAccessor, JsFunc <JsObject> allBindingsAccessor, object viewModel)
 {
 }
예제 #27
0
 public static IObservable <IObservable <TSource> > window <TSource, TBufferClosing>(this IObservable <TSource> source,
                                                                                     JsFunc <IObservable <TBufferClosing> > windowClosingSelector)
 {
     return(null);
 }
예제 #28
0
 public ParametricGeometry(JsFunc<JsNumber, JsNumber, JsNumber> func, JsNumber slices, JsNumber stacks) { }
예제 #29
0
 public static JsString Stringify(object obj, JsFunc <object, object, object> replacer, int space)
 {
     return(null);
 }
예제 #30
0
 public static IObservable <TSource> doWhile <TSource>(this IObservable <TSource> source, JsFunc <bool> condition)
 {
     return(null);
 }
예제 #31
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="replacer">If replacer is a function, JSON.stringify calls the function, passing in the key and value of each member. The return value is serialized instead of the original value. If the function returns undefined, the member will be excluded from the serialization. The key for the root object is an empty string: "".
 /// If replacer is an array, only members with key values in the array will be serialized. The order of serialization is the same as the order of the keys in the array. The replacer array is ignored when the value argument is also an array.</param>
 /// <param name="space"></param>
 /// <returns></returns>
 public static string stringify(object obj, JsFunc <object, object, object> replacer, string space)
 {
     return(null);
 }
예제 #32
0
 public static IObservable <TResult> letBind <TSource, TResult>(this IObservable <TSource> source,
                                                                JsFunc <IObservable <TSource>, IObservable <TResult> > function)
 {
     return(null);
 }
예제 #33
0
 public ParametricGeometry(JsFunc <JsNumber, JsNumber, JsNumber> func, JsNumber slices, JsNumber stacks, JsBoolean useTris)
 {
 }
예제 #34
0
파일: JSON.cs 프로젝트: fjgandrade/sharpkit
 public static JsString Stringify(object obj, JsFunc<object, object, object> replacer, JsString space) { return null; }
예제 #35
0
 public ParametricGeometry(JsFunc <JsNumber, JsNumber, JsNumber> func, JsNumber slices, JsNumber stacks)
 {
 }
예제 #36
0
 public static void registerFactory(JsFunc<Validator> fn, string name) { }
예제 #37
0
 public static IObservable <TResult> switchCase <TValue, TResult>(JsFunc <TValue> selector, JsObject <TValue, IObservable <TResult> > sources, IScheduler scheduler = null)
 {
     return(null);
 }