private M_QuestionnaireResultDetail CheckBoxToDetail() { if (CheckBoxs == null || !CheckBoxs.Any()) { return(null); } var score = 0; var result = new List <char>(); for (var i = 0; i < CheckBoxs.Length; i++) { if (!CheckBoxs[i].Checked) { continue; } result.Add((char)('A' + i)); score += Convert.ToInt32(CheckBoxs[i].Tag ?? 0); } return(new M_QuestionnaireResultDetail { //QuestionResult = string.Join(",", result) + ",", QuestionResult = !result.Any() ? string.Join(",", result) : string.Join(",", result) + ",", QuestionScore = score, QuestionType = Type, QuestionCode = Code, PQuestionWeightScore = score * Weight }); }
public Settings() { InitializeComponent(); AnchorLables = new DSkinLabel[] { dSkinLabel_General, dSkinLabel_Play, dSkinLabel_Volumn, dSkinLabel_Video, dSkinLabel_Subtitle, dSkinLabel_Association, dSkinLabel_BackGround, dSkinLabel_ScreenShot, dSkinLabel_Donate, dSkinLabel_Update, dSkinLabel_Other }; TrackBars = new DSkinTrackBar[] { dSkinTrackBar_BackColorOpacity, dSkinTrackBar_BackImageOpacity, dSkinTrackBar_MainFrmOpacity, dSkinTrackBar_Brightness, dSkinTrackBar_Contrast, dSkinTrackBar_Hue, dSkinTrackBar_HumanVolumn, dSkinTrackBar_Saturation, dSkinTrackBar_SoundBalance }; DSkinCheckBox[] dcb = new DSkinCheckBox[] { dSkinCheckBox_CreateShortcutToDesktop, dSkinCheckBox_EnableDWM, dSkinCheckBox_EnhanceImageQuality, dSkinCheckBox_ImageFuzzy, dSkinCheckBox_LockToTaskbar, dSkinCheckBox_PauseWhileMinimize, dSkinCheckBox_ShowScreenShotWindow, dSkinCheckBox_UnifyDiffVolumn, dSkinCheckBox_IncludeSubDir, dSkinCheckBox_ControlFrmTransparent, dSkinCheckBox_AutoMatchNetSubtitle, dSkinCheckBox_AutoMatchLocalSubtitle, dSkinCheckBox_AutoHideTitleAndControlPanel, dSkinCheckBox_ShowAdOnceMore }; for (int i = 1; i <= 114; i++) { string str_ControlName = "dSkinCheckBox" + i.ToString(); DSkinCheckBox cb = (DSkinCheckBox)this.dSkinPanel_LinkFile.Controls.Find(str_ControlName, false)[0]; CheckBoxs.Add(cb); } CheckBoxs.AddRange(dcb); duiScrollBar_LinkFile.ValueChanged += new System.EventHandler(this.duiScrollBar_LinkFile_ValueChanged); }
public bool IsUncheckedOrEmpty() { switch (Type) { case 1: return(Radios.Any(p => p.Checked == true)); case 2: return(CheckBoxs.Any(p => p.Checked)); case 3: return(string.IsNullOrEmpty(Text.Text)); //---by hp--- case 4: return(Texts.All(p => !string.IsNullOrEmpty(p.Text)) && Radios.Any(p => p.Checked)); //---by hp end--- default: return(false); } }
public int CheckedServices() { int totalCheckedServices = CheckBoxs.Count(); return(totalCheckedServices); }