コード例 #1
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            MainTitleTbox.Text  = _loadedKey.MainTitle;
            SubTitleTbox.Text   = _loadedKey.SubTitle;
            PersistentSwitch.On = _loadedKey.PersistSelected;
            if (_loadedKey.DefaultIcon != null && _loadedKey.DefaultIcon != string.Empty)
            {
                if (System.IO.File.Exists(ConfigsEngine.GetImageForCurrentConfiguration(_loadedKey.DefaultIcon)))
                {
                    DefaultIconBtn.SetImage(UIImage.FromFile(ConfigsEngine.GetImageForCurrentConfiguration(_loadedKey.DefaultIcon)), UIControlState.Normal);
                    _loadedDefaultIconName = _loadedKey.DefaultIcon;
                }
            }
            else
            {
                DefaultIconBtn.SetImage(null, UIControlState.Normal);
                _loadedDefaultIconName = string.Empty;
            }
            if (!string.IsNullOrEmpty(_loadedKey.SelectedIcon))
            {
                SelectedIconBtn.SetImage(UIImage.FromFile(ConfigsEngine.GetImageForCurrentConfiguration(_loadedKey.SelectedIcon)), UIControlState.Normal);
                _loadedSelectedIconName = _loadedKey.SelectedIcon;
            }
            else
            {
                SelectedIconBtn.SetImage(null, UIControlState.Normal);
                _loadedKey.SelectedIcon = string.Empty;
            }

            TitleColorBtn.BackgroundColor        = Util.GetUicolorFromRGBString(_loadedKey.MainTitleColor);
            SubtitleColorBtn.BackgroundColor     = Util.GetUicolorFromRGBString(_loadedKey.SubTitleColor);
            TitleSelColorBtn.BackgroundColor     = Util.GetUicolorFromRGBString(_loadedKey.SelectedMainTitleColor);
            SubtitleSelColorBtn.BackgroundColor  = Util.GetUicolorFromRGBString(_loadedKey.SelectedSubTitleColor);
            BackgroundColorBtn.BackgroundColor   = Util.GetUicolorFromRGBString(_loadedKey.BackgroundColor);
            BackroundSelColorBtn.BackgroundColor = Util.GetUicolorFromRGBString(_loadedKey.SelectedBackgroundColor);
            ActionTbox.Text = "";
            _actionKeys.Clear();

            if (_loadedKey.Action != null)
            {
                try
                {
                    _actionKeys = JsonConvert.DeserializeObject <List <int> >(_loadedKey.Action);
                }
                catch (Exception e)
                {
                    FPLog.Instance.WriteLine("Error deserializing key");
                }
            }

            if (_actionKeys != null && _actionKeys.Count > 0)
            {
                PopulateActionTextBox();
            }


            SetupKeyboard();
        }
コード例 #2
0
        //this is called after the user Select the image from dropbox
        private void DownloadImageTask(NSUrl imageLink, string imageName)
        {
            try{
                UIImage img = Util.FromNSUrl(imageLink);
                if (img != null)
                {
                    ConfigsEngine.SaveImageForCurrentConfiguration(imageName, img);
                    InvokeOnMainThread(() => {
                        if (_iconSelection == IconSelection.DEFAULT)
                        {
                            DefaultIconBtn.SetImage(img, UIControlState.Normal);
                            DefaultIconBtn.BackgroundColor = UIColor.Clear;
                            _loadedDefaultIconName         = imageName;
                        }
                        else if (_iconSelection == IconSelection.SELECTED)
                        {
                            SelectedIconBtn.SetImage(img, UIControlState.Normal);
                            SelectedIconBtn.BackgroundColor = UIColor.Clear;
                            _loadedSelectedIconName         = imageName;
                        }

                        _activityIndicator.StopAnimating();
                        _activityIndicator.RemoveFromSuperview();
                    });
                }
            }
            catch (Exception) {
                InvokeOnMainThread(() => {
                    var alert = new UIAlertView("Error", "Error downloading image from dropbox", null, "Ok");
                    alert.Show();
                });
            }
        }
コード例 #3
0
 partial void RemoveDefaultIcon(NSObject sender)
 {
     _loadedDefaultIconName = null;
     DefaultIconBtn.SetImage(null, UIControlState.Normal);
 }
コード例 #4
0
        void ReleaseDesignerOutlets()
        {
            if (ActionTbox != null)
            {
                ActionTbox.Dispose();
                ActionTbox = null;
            }

            if (BackgroundColorBtn != null)
            {
                BackgroundColorBtn.Dispose();
                BackgroundColorBtn = null;
            }

            if (BackroundSelColorBtn != null)
            {
                BackroundSelColorBtn.Dispose();
                BackroundSelColorBtn = null;
            }

            if (BackspaceBtn != null)
            {
                BackspaceBtn.Dispose();
                BackspaceBtn = null;
            }

            if (CancelBarBtn != null)
            {
                CancelBarBtn.Dispose();
                CancelBarBtn = null;
            }

            if (CapsLockBtn != null)
            {
                CapsLockBtn.Dispose();
                CapsLockBtn = null;
            }

            if (CloseToolbarBtn != null)
            {
                CloseToolbarBtn.Dispose();
                CloseToolbarBtn = null;
            }

            if (DefaultIconBtn != null)
            {
                DefaultIconBtn.Dispose();
                DefaultIconBtn = null;
            }

            if (DelBtn != null)
            {
                DelBtn.Dispose();
                DelBtn = null;
            }

            if (DeleteEntryBtn != null)
            {
                DeleteEntryBtn.Dispose();
                DeleteEntryBtn = null;
            }

            if (DownBtn != null)
            {
                DownBtn.Dispose();
                DownBtn = null;
            }

            if (EndBtn != null)
            {
                EndBtn.Dispose();
                EndBtn = null;
            }

            if (EnterBtn != null)
            {
                EnterBtn.Dispose();
                EnterBtn = null;
            }

            if (F10Btn != null)
            {
                F10Btn.Dispose();
                F10Btn = null;
            }

            if (F11Btn != null)
            {
                F11Btn.Dispose();
                F11Btn = null;
            }

            if (F12Btn != null)
            {
                F12Btn.Dispose();
                F12Btn = null;
            }

            if (F1Btn != null)
            {
                F1Btn.Dispose();
                F1Btn = null;
            }

            if (F2Btn != null)
            {
                F2Btn.Dispose();
                F2Btn = null;
            }

            if (F3Btn != null)
            {
                F3Btn.Dispose();
                F3Btn = null;
            }

            if (F4Btn != null)
            {
                F4Btn.Dispose();
                F4Btn = null;
            }

            if (F5Btn != null)
            {
                F5Btn.Dispose();
                F5Btn = null;
            }

            if (F6Btn != null)
            {
                F6Btn.Dispose();
                F6Btn = null;
            }

            if (F7Btn != null)
            {
                F7Btn.Dispose();
                F7Btn = null;
            }

            if (F8Btn != null)
            {
                F8Btn.Dispose();
                F8Btn = null;
            }

            if (F9Btn != null)
            {
                F9Btn.Dispose();
                F9Btn = null;
            }

            if (HelpToolbarBtn != null)
            {
                HelpToolbarBtn.Dispose();
                HelpToolbarBtn = null;
            }

            if (HomeBtn != null)
            {
                HomeBtn.Dispose();
                HomeBtn = null;
            }

            if (InsBtn != null)
            {
                InsBtn.Dispose();
                InsBtn = null;
            }

            if (LaltBtn != null)
            {
                LaltBtn.Dispose();
                LaltBtn = null;
            }

            if (LctrlBtn != null)
            {
                LctrlBtn.Dispose();
                LctrlBtn = null;
            }

            if (LeftBtn != null)
            {
                LeftBtn.Dispose();
                LeftBtn = null;
            }

            if (LshiftBtn != null)
            {
                LshiftBtn.Dispose();
                LshiftBtn = null;
            }

            if (MainTitleTbox != null)
            {
                MainTitleTbox.Dispose();
                MainTitleTbox = null;
            }

            if (ModifierKeysView != null)
            {
                ModifierKeysView.Dispose();
                ModifierKeysView = null;
            }

            if (ModifierToolbar != null)
            {
                ModifierToolbar.Dispose();
                ModifierToolbar = null;
            }

            if (ModifierToolbarBtn != null)
            {
                ModifierToolbarBtn.Dispose();
                ModifierToolbarBtn = null;
            }

            if (NavBar != null)
            {
                NavBar.Dispose();
                NavBar = null;
            }

            if (PersistentSwitch != null)
            {
                PersistentSwitch.Dispose();
                PersistentSwitch = null;
            }

            if (PgDwnBtn != null)
            {
                PgDwnBtn.Dispose();
                PgDwnBtn = null;
            }

            if (PgUpBtn != null)
            {
                PgUpBtn.Dispose();
                PgUpBtn = null;
            }

            if (PreviewBackground != null)
            {
                PreviewBackground.Dispose();
                PreviewBackground = null;
            }

            if (PreviewIcon != null)
            {
                PreviewIcon.Dispose();
                PreviewIcon = null;
            }

            if (PreviewSubtitle != null)
            {
                PreviewSubtitle.Dispose();
                PreviewSubtitle = null;
            }

            if (PreviewTitle != null)
            {
                PreviewTitle.Dispose();
                PreviewTitle = null;
            }

            if (RaltBtn != null)
            {
                RaltBtn.Dispose();
                RaltBtn = null;
            }

            if (RctrlBtn != null)
            {
                RctrlBtn.Dispose();
                RctrlBtn = null;
            }

            if (RemoveDefaultIconBtn != null)
            {
                RemoveDefaultIconBtn.Dispose();
                RemoveDefaultIconBtn = null;
            }

            if (RemoveSelectedIconBtn != null)
            {
                RemoveSelectedIconBtn.Dispose();
                RemoveSelectedIconBtn = null;
            }

            if (RightBtn != null)
            {
                RightBtn.Dispose();
                RightBtn = null;
            }

            if (RshiftBtn != null)
            {
                RshiftBtn.Dispose();
                RshiftBtn = null;
            }

            if (SecondModView != null)
            {
                SecondModView.Dispose();
                SecondModView = null;
            }

            if (SelectedIconBtn != null)
            {
                SelectedIconBtn.Dispose();
                SelectedIconBtn = null;
            }

            if (SubtitleColorBtn != null)
            {
                SubtitleColorBtn.Dispose();
                SubtitleColorBtn = null;
            }

            if (SubtitleSelColorBtn != null)
            {
                SubtitleSelColorBtn.Dispose();
                SubtitleSelColorBtn = null;
            }

            if (SubTitleTbox != null)
            {
                SubTitleTbox.Dispose();
                SubTitleTbox = null;
            }

            if (SuperBtn != null)
            {
                SuperBtn.Dispose();
                SuperBtn = null;
            }

            if (TabBtn != null)
            {
                TabBtn.Dispose();
                TabBtn = null;
            }

            if (TitleColorBtn != null)
            {
                TitleColorBtn.Dispose();
                TitleColorBtn = null;
            }

            if (TitleSelColorBtn != null)
            {
                TitleSelColorBtn.Dispose();
                TitleSelColorBtn = null;
            }

            if (UpBtn != null)
            {
                UpBtn.Dispose();
                UpBtn = null;
            }
        }