void save(object obj)
        {
            var has = this.Courses.Count(c => c.IsChecked) > 1;

            if (!has)
            {
                this.ShowDialog("提示信息", "至少选两门课程!", CustomControl.Enums.DialogSettingType.OnlyOkButton, CustomControl.Enums.DialogType.Warning);
                return;
            }

            CreateMutexGroup win = obj as CreateMutexGroup;

            win.Courses      = this.Courses.Where(c => c.IsChecked)?.ToList();
            win.Weight       = this.Weight;
            win.DialogResult = true;
        }
Exemplo n.º 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.win = ((OSKernel.Presentation.Arranging.Administrative.Dialog.CreateMutexGroup)(target));
                return;

            case 2:
                this.btn_save = ((System.Windows.Controls.Button)(target));
                return;

            case 3:
                this.btn_cancel = ((System.Windows.Controls.Button)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void cancel(object obj)
        {
            CreateMutexGroup win = obj as CreateMutexGroup;

            win.DialogResult = false;
        }