Beispiel #1
0
        private static void ApplySwitchState(SwitchType switch_type, string new_state, Action callback)
        {
            if (switch_type.State != new_state)
            {
                Chameleon.Invalidate();

                InvalidateOptions options = new InvalidateOptions();
                options.Time     = 100;
                options.Callback = callback;

                string class_state_suffix = "";
                if (switch_type.State != null)
                {
                    class_state_suffix = "-" + switch_type.State;
                }

                string current_class = switch_type.ClassName + class_state_suffix;
                string new_class     = switch_type.ClassName + "-" + new_state;

                jQuery.Select("." + current_class).RemoveClass("switch-" + switch_type.State).AddClass("switch-" + new_state);
                jQuery.Select("." + current_class).RemoveClass(current_class).AddClass(new_class)
                .Plugin <ChameleonUiObject>().ChameleonInvalidate(options);

                switch_type.State = new_state;

                Chameleon.InvalidateTwo();
            }
        }
Beispiel #2
0
        private void Invalidate()
        {
            InvalidateOptions invalidateOptions = new InvalidateOptions();

            invalidateOptions.Time     = 100;
            invalidateOptions.Callback = delegate()
            {
                //do something
            };

            Chameleon.Invalidate();
            jQuery.Select(".someDiv").Html("new contents").Plugin <ChameleonUiObject>().ChameleonInvalidate(invalidateOptions);
        }
Beispiel #3
0
        private static void DisplayNoDependencyError()
        {
            if (Chameleon.Exists())
            {
                Chameleon.Invalidate();
            }

            ClickableHtmlOptions options = new ClickableHtmlOptions();

            options.Title   = "No Local Service";
            options.Caption = "This widget requires an external APK. Touch here to get it.";
            jQuery.Select("#chameleon-widget").Plugin <ChameleonUiObject>().ChameleonWidgetMessageHTML(options)
            .Plugin <ChameleonUiObject>().ChameleonInvalidate();
        }