Ejemplo n.º 1
0
        private void menuItem_imxport_Click(object sender, EventArgs e)
        {
            var importForm = new ImportForm();

            importForm.Import += (o, args) =>
            {
                var importConfig   = args.ConfigImportOption != ImportForm.ImportOption.None;
                var importGestures = args.GesturesImportOption != ImportForm.ImportOption.None;
                var mergeGestures  = args.GesturesImportOption == ImportForm.ImportOption.Merge;

                //冻结绘图,以提升批量修改的性能
                SuspendDrawingControl.SuspendDrawing(this);
                try
                {
                    Controller.Import(args.ConfigAndGestures, importConfig, importGestures, mergeGestures);
                    //如果还没有切换到“手势”tab,则listApps没有app加载。
                    if (listApps.Items.Count > 0)
                    {
                        LoadApps();
                    }
                    LoadHotCornerCommands();
                }
                finally
                {
                    SuspendDrawingControl.ResumeDrawing(this);
                }

                //settingsFormControllerBindingSource.ResetBindings(true);
            };

            importForm.ShowDialog();
        }
Ejemplo n.º 2
0
        private void AdjustListGestureIntentsColumnSize()
        {
            SuspendDrawingControl.SuspendDrawing(listGestureIntents);
            listGestureIntents.SuspendLayout();

            listGestureIntents.Columns[0].Width = -2;
            listGestureIntents.Columns[1].Width = -2;
            listGestureIntents.Columns[2].Width = -2;

            listGestureIntents.ResumeLayout();
            SuspendDrawingControl.ResumeDrawing(listGestureIntents);
        }
Ejemplo n.º 3
0
        public SettingsForm(SettingsFormController controller)
        {
            Controller = controller;

            InitializeComponent();
            Icon = Resources.icon;

            SuspendDrawingControl.SuspendDrawing(this);

            settingsFormControllerBindingSource.Add(Controller);

            DpiFix();
            ControlFixes();

            InitControlValues();
            SuspendDrawingControl.SuspendDrawing(this);
        }