コード例 #1
0
        internal void ImportSchemes(
            List <IMControlScheme> toCopyFromSchemes,
            Dictionary <string, Dictionary <string, string> > stringsToImport)
        {
            bool flag1 = false;
            bool flag2 = false;

            KMManager.MergeConflictingGuidanceStrings(this.ParentWindow.SelectedConfig, toCopyFromSchemes, stringsToImport);
            if (this.ParentWindow.SelectedConfig.ControlSchemes.Count > 0)
            {
                flag1 = true;
            }
            foreach (IMControlScheme toCopyFromScheme in toCopyFromSchemes)
            {
                IMControlScheme imControlScheme = toCopyFromScheme.DeepCopy();
                if (flag1)
                {
                    imControlScheme.Selected = false;
                }
                imControlScheme.BuiltIn      = false;
                imControlScheme.IsBookMarked = false;
                this.CanvasWindow.SidebarWindow.mSchemeComboBox.mName.Text = imControlScheme.Name;
                this.ParentWindow.SelectedConfig.ControlSchemes.Add(imControlScheme);
                this.ParentWindow.SelectedConfig.ControlSchemesDict.Add(imControlScheme.Name, imControlScheme);
                ComboBoxSchemeControl boxSchemeControl = new ComboBoxSchemeControl(this.CanvasWindow, this.ParentWindow);
                boxSchemeControl.mSchemeName.Text = LocaleStrings.GetLocalizedString(imControlScheme.Name, "");
                boxSchemeControl.IsEnabled        = true;
                BlueStacksUIBinding.BindColor((DependencyObject)boxSchemeControl, Control.BackgroundProperty, "ComboBoxBackgroundColor");
                this.CanvasWindow.SidebarWindow.mSchemeComboBox.Items.Children.Add((UIElement)boxSchemeControl);
            }
            if (flag1)
            {
                return;
            }
            foreach (IMControlScheme controlScheme in this.ParentWindow.SelectedConfig.ControlSchemes)
            {
                if (controlScheme.Selected)
                {
                    flag2 = true;
                    break;
                }
            }
            if (flag2)
            {
                return;
            }
            this.ParentWindow.SelectedConfig.ControlSchemes[0].Selected = true;
        }