示例#1
0
        private void Refresh()
        {
            RefreshOptions refreshOptions = new RefreshOptions();

            refreshOptions.Refresh = true;
            Chameleon.Refresh(refreshOptions);
        }
示例#2
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();
            }
        }
示例#3
0
        private void OAuth()
        {
            OAuthOptions oauthOption = new OAuthOptions();

            oauthOption.Version = "1.0";

            OAuthUrlOptions authoriseOptions = new OAuthUrlOptions();

            authoriseOptions.Url  = "https://api.twitter.com/oauth/authorize";
            authoriseOptions.Args = new Dictionary("force_login", "true");
            oauthOption.Authorize = authoriseOptions;

            OAuthUrlOptions requestOptions = new OAuthUrlOptions();

            requestOptions.Url  = "https://api.twitter.com/oauth/request_token";
            oauthOption.Request = requestOptions;

            OAuthUrlOptions accessOptions = new OAuthUrlOptions();

            accessOptions.Url  = "https://api.twitter.com/oauth/access_token";
            oauthOption.Access = accessOptions;

            oauthOption.CallbackUrl    = "http://yourcallbackurl";
            oauthOption.ConsumerKey    = "chameleon_encryped_consumer_key";
            oauthOption.ConsumerSecret = "chameleon_encrypted_consumer_secret";
            oauthOption.OnResult       = delegate(bool success, Dictionary data)
            {
                //do something
            };

            Chameleon.PromptOauth(oauthOption);
        }
示例#4
0
        private void SetData()
        {
            MyInstanceData data = Chameleon.GetData <MyInstanceData>();

            data.Message = "This is the data I am saving";
            Chameleon.SaveData(data);
        }
示例#5
0
 private void btnDene_Click_1(object sender, EventArgs e)
 {
     try
     {
         string gelenRenk = Chameleon.veriGetir(picWay);
         if (gelenRenk == "KIRMIZI")
         {
             pbUyg.ImageLocation = @"C:\Users\Yakup\source\repos\Make Me Happy\Make Me Happy\Resources\kirmizibukalemun.jpg";
         }
         else if (gelenRenk == "MAVİ")
         {
             pbUyg.ImageLocation = @"C:\Users\Yakup\source\repos\Make Me Happy\Make Me Happy\Resources\mavibukalemun.jpg";
         }
         else if (gelenRenk == "YEŞİL")
         {
             pbUyg.ImageLocation = @"C:\Users\Yakup\source\repos\Make Me Happy\Make Me Happy\Resources\yesilbukalemun.jpg";
         }
         else
         {
             MessageBox.Show("HATALI GİRİŞ");
         }
     }
     catch
     {
         MessageBox.Show("HATA");
     }
 }
示例#6
0
        private void Loading()
        {
            LoadingOptions loadingOptions = new LoadingOptions();

            loadingOptions.ShowLoader = true;

            Chameleon.ShowLoading(loadingOptions);
        }
示例#7
0
        private void Title()
        {
            TitleOptions titleOptions = new TitleOptions();

            titleOptions.Text = "Title";

            Chameleon.SetTitle(titleOptions);
        }
示例#8
0
    public void Crossover(Chameleon parent1, Chameleon parent2, Chameleon chameleon)
    {
        float red   = (parent1.m_Red + parent2.m_Red) / 2.0f;
        float green = (parent1.m_Green + parent2.m_Green) / 2.0f;
        float blue  = (parent1.m_Blue + parent2.m_Blue) / 2.0f;

        chameleon.Initialize(red, green, blue);
    }
示例#9
0
        private static void HandleGPSClick(jQueryEvent e)
        {
            e.PreventDefault();

            IntentOptions options = new IntentOptions();

            options.Action = "android.settings.LOCATION_SOURCE_SETTINGS";
            Chameleon.Intent(options);
        }
示例#10
0
        private static void SetSwitchState(Dictionary data)
        {
            IntentOptions options = new IntentOptions();

            options.Component = settings_service_component;
            options.Data      = data;

            Chameleon.Intent(options);
        }
示例#11
0
        public void CanProveIsAnimal()
        {
            Chameleon testChameleon = new Chameleon();

            Assert.Equal("ZzZzZz...", testChameleon.Sleep());
            Assert.Equal("...", testChameleon.Sound());
            Assert.Equal("nom nom nom", testChameleon.Eat());
            Assert.Equal("Code Fellows Zoo", testChameleon.ZooName);
        }
示例#12
0
        private static void HandleBrightnessClick(jQueryEvent e)
        {
            e.PreventDefault();

            //launch display settings
            IntentOptions options = new IntentOptions();

            options.Action = "android.settings.DISPLAY_SETTINGS";
            Chameleon.Intent(options);
        }
示例#13
0
        private void SharedData()
        {
            MySharedData sharedData = Chameleon.GetSharedData <MySharedData>();
            Account      account    = new Account();

            account.Name        = "@evadi";
            account.Description = "Some guy that makes stuff";
            sharedData.Account  = account;
            Chameleon.SaveSharedData(sharedData);
        }
示例#14
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // get the strong colors as the theme
            var image  = UIImage.FromBundle("africa-blue.jpg");
            var colors = ChameleonColorArray.GetColors(image, false);

            Chameleon.SetGlobalTheme(
                colors[2],
                colors[4],
                (ChameleonFramework.UIContentStyle)ContentStyle.Contrast);
            return(true);
        }
示例#15
0
        private static void UpdateSwitchStates()
        {
            IntentOptions options = new IntentOptions();

            options.Component = settings_service_component;
            options.Result    = delegate(Dictionary data)
            {
                HandleUpdateSwitchStatesData(data);
            };

            Chameleon.Intent(options);
        }
示例#16
0
        private static void LaunchGlobalSettings(jQueryEvent e)
        {
            if (e != null)
            {
                e.PreventDefault();
            }

            IntentOptions options = new IntentOptions();

            options.Action = "android.settings.SETTINGS";

            Chameleon.Intent(options);
        }
示例#17
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);
        }
示例#18
0
        private void PromptHtml()
        {
            PromptHtmlOptions promptOptions = new PromptHtmlOptions();

            promptOptions.Height = 300; //optional property
            promptOptions.Width  = 200; //optional property
            promptOptions.Url    = "settings.html";
            promptOptions.Result = delegate(bool success, Dictionary data)
            {
                //optional callback
            };
            Chameleon.PromptHTML(promptOptions);
        }
示例#19
0
        private void LocalData()
        {
            MyLocalData   localData = new MyLocalData();
            LocalDataItem dataItem  = new LocalDataItem();

            dataItem.Name        = "Data item 1";
            dataItem.Description = "This is data item number 1";

            localData.LocalDataItems = new List <LocalDataItem>();
            localData.LocalDataItems.Add(dataItem);

            Chameleon.SaveLocalData("dataitemlist", localData);
        }
示例#20
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();
        }
示例#21
0
        private void GetWindowType()
        {
            if (Chameleon.GetType() == "widget")
            {
                Chameleon.Close();
            }


            if (Chameleon.GetType() == "window")
            {
                Dictionary data = new Dictionary("message", "This is an example of data you can return");
                Chameleon.Close(true, data);
            }
        }
示例#22
0
 public void Mutation(Chameleon chameleon)
 {
     if (Random.Range(0.0f, 1.0f) < m_MutationRate)
     {
         chameleon.m_Red = Random.Range(0.0f, 1.0f);
     }
     if (Random.Range(0.0f, 1.0f) < m_MutationRate)
     {
         chameleon.m_Green = Random.Range(0.0f, 1.0f);
     }
     if (Random.Range(0.0f, 1.0f) < m_MutationRate)
     {
         chameleon.m_Blue = Random.Range(0.0f, 1.0f);
     }
 }
示例#23
0
        private void Intent()
        {
            ComponentOptions componentOptions = new ComponentOptions();

            componentOptions.Package = "com.twitter.android";
            componentOptions.Name    = "com.twitter.android.StartActivity";

            Chameleon.ComponentExists(componentOptions);

            IntentOptions intentOptions = new IntentOptions();

            intentOptions.Component = componentOptions;
            intentOptions.Action    = "android.intent.action.MAIN";
            Chameleon.Intent(intentOptions);
        }
示例#24
0
        static Main()
        {
            settings_service_component.Name    = "com.teknision.android.chameleon.settingsswitchservice.SettingsService";
            settings_service_component.Package = "com.chameleonlauncher.preorder";
            settings_service_component.Type    = "service";
            _root = jQuery.Select("#chameleon-widget");

            jQuery.OnDocumentReady(delegate()
            {
                WidgetOptions wop = new WidgetOptions();
                wop.OnLoad        = delegate()
                {
                    if (DependencyExists())
                    {
                        UpdateSwitchStates();
                    }
                    else
                    {
                        DisplayNoDependencyError();
                    }
                };

                wop.OnResume = delegate()
                {
                    if (DependencyExists())
                    {
                        UpdateSwitchStates();
                    }
                    else
                    {
                        DisplayNoDependencyError();
                    }
                };

                wop.OnTitleBar = delegate()
                {
                    jQuery.Select("#chameleon-widget").Append("we are live");
                    LaunchGlobalSettings(null);
                };

                wop.NotChameleon = delegate()
                {
                    DrawSwitches(null);
                };

                Chameleon.Widget(wop);
            });
        }
示例#25
0
        private void GetLocal()
        {
            MyLocalData localData = Chameleon.GetLocalData <MyLocalData>("dataitemlist");

            if (localData != null)
            {
                if (localData.LocalDataItems != null)
                {
                    string str = "";
                    foreach (LocalDataItem dataItem in localData.LocalDataItems)
                    {
                        str += string.Format("{0} : {1}\n", dataItem.Name, dataItem.Description);
                    }
                }
            }
        }
示例#26
0
        private void btnEgit_Click_1(object sender, EventArgs e)
        {
            string renk = "";

            if (rbKirmizi.Checked == true)
            {
                renk = "KIRMIZI";
            }
            if (rbMavi.Checked == true)
            {
                renk = "MAVİ";
            }
            if (rbYesil.Checked == true)
            {
                renk = "YEŞİL";
            }
            Chameleon.egitimEkle(resimYolu, renk);
        }
示例#27
0
        static void Main(string[] args)
        {
            Chameleon newPet = new Chameleon("Rudy");

            for (int i = 0; i < 10; i++)
            {
                if (newPet.Weight == 0.7)
                {
                    newPet.Exercise();
                }
                else
                {
                    newPet.Consume();
                }
            }

            newPet.ChameleonData();
            newPet.Death();
        }
        private void TheMainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            Cham = new Chameleon(MainGrid, ActualWidth, ActualHeight);

            FigureList.Add(Cham.Body);

            //FigureList.Add(Cham.Tail);
            //FigureList.Add(Cham.Tail02);
            //FigureList.Add(Cham.Tail03);
            //FigureList.Add(Cham.Tail04);
            //FigureList.Add(Cham.Tail05);
            //FigureList.Add(Cham.Tail06);
            //FigureList.Add(Cham.Tail07);
            //FigureList.Add(Cham.Tail08);
            //FigureList.Add(Cham.Tail09);
            //FigureList.Add(Cham.Tail10);
            //FigureList.Add(Cham.Tail11);


            FigureList.Add(Cham.Head);
            //FigureList.Add(ChamUpperChin);
            FigureList.Add(Cham.LowerChin);
            FigureList.Add(Cham.Tongue);

            FigureList.Add(Cham.LeftHand);
            FigureList.Add(Cham.RightHand);
            FigureList.Add(Cham.LeftLeg);
            FigureList.Add(Cham.RightLeg);
            FigureList.Add(Cham.Scate);
            FigureList.Add(Cham.FrontWheel);
            FigureList.Add(Cham.RearWheel);

            AnimatedFigureList.Add(Cham.Body);
            AnimatedFigureList.Add(Cham.Head);
            AnimatedFigureList.Add(Cham.Tongue);

            AnimationTimer = new Timer(20);
            //AnimationTimer.SynchronizingObject = this;
            AnimationTimer.Elapsed += new ElapsedEventHandler(Animate);
            AnimationTimer.Start();
        }
示例#29
0
        private void VisualizeChameleons(Chameleon ch)
        {
            Panel pnl = new Panel();

            pnl.Size     = ch.Size;
            pnl.Location = ch.Location;
            if (ch.Color == Components.Enums.ChameleonTypes.Colors.Red)
            {
                pnl.BackColor = Color.Red;
            }
            else if (ch.Color == Components.Enums.ChameleonTypes.Colors.Blue)
            {
                pnl.BackColor = Color.Blue;
            }
            else
            {
                pnl.BackColor = Color.Green;
            }

            pnlVisualisation.Controls.Add(pnl);
        }
示例#30
0
 public VariableExpression(string name, Chameleon chameleon)
 {
     this.name = name;
     this.chameleon = chameleon;
 }
示例#31
0
 public Parser(List<Token> tokens, Chameleon chameleon)
 {
     this.tokens = tokens;
     this.chameleon = chameleon;
     position = 0;
 }
示例#32
0
 private static bool DependencyExists()
 {
     return(Chameleon.ComponentExists(settings_service_component));
 }
示例#33
0
 public IfThenStatement(Expression condition, string label, Chameleon chameleon)
 {
     this.condition = condition;
     this.label = label;
     this.chameleon = chameleon;
 }
示例#34
0
 public InputStatement(string name, Chameleon chameleon)
 {
     this.name = name;
     this.chameleon = chameleon;
 }