private void btnDeleteBtn_Click(object sender, RoutedEventArgs e) { int index = listViewGroup.SelectedIndex; String str; if (GroupListItem.getInstance().Count == 1) { MessageBox.Show("모든 그룹을 삭제할 수는 없습니다", "오류"); } else if (index != -1) { str = "정말로 선택한 그룹(" + wordGroup.GroupInformation.GroupName[index] + ")을 삭제하겠습니까? 해당 그룹의 모든 단어가 삭제됩니다."; if (MessageBox.Show(str, "알림", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { wordGroup.GroupInformation.deleteGroup(wordGroup.CurrentSetting, index); GroupListItem.getInstance().RemoveAt(index); listViewGroup.Items.Refresh(); } } else { MessageBox.Show("선택된 그룹이 존재하지 않습니다.", "오류"); } }
public GroupWindow(WordGroup wordGroup) { InitializeComponent(); this.wordGroup = wordGroup; listViewGroup.ItemsSource = GroupListItem.getInstance(); listViewApplyingRule.ItemsSource = ApplyingRuleListItem.getInstance(); int i = 0; while ((i < wordGroup.MAX_GROUP_NUM) && (wordGroup.GroupInformation.GroupName[i] != null) && isListNotLoaded) { GroupListItem.getInstance().Add(new GroupListItem(wordGroup.GroupInformation.GroupName[i], wordGroup.getBoxRuleName(wordGroup.GroupInformation.GroupRule[i]))); i++; } i = 0; while ((i < wordGroup.MAX_BOXRULE_NUM) && (wordGroup.getBoxRuleName(i) != null) && isListNotLoaded) { ApplyingRuleListItem.getInstance().Add(new ApplyingRuleListItem(wordGroup.getBoxRuleName(i))); i++; } isListNotLoaded = false; listViewGroup.Items.Refresh(); listViewGroup.SelectedIndex = wordGroup.CurrentGroupNum; listViewApplyingRule.Items.Refresh(); RefreshWindow(wordGroup.CurrentGroupNum); }
/// <summary> /// 获取群成员信息 /// </summary> /// <param name="GroupList"></param> public static void GetGroupContactsMethod(List <MemberListItemEntity> GroupList) { GroupContacts GC = new GroupContacts(); GC.BaseRequest = new BaseRequestEntity() { DeviceID = MethodsHelper.GetDeviceId(), Sid = CommonDefine.LoginResult.wxsid, Skey = CommonDefine.LoginResult.skey, Uin = CommonDefine.LoginResult.wxuin }; List <GroupListItem> GroupNumberList = new List <GroupListItem>(); for (int index = 0; index < GroupList.Count; index++) { if (GroupList[index].UserName.Contains("@@")) { GroupListItem Groupitem = new GroupListItem(); Groupitem.UserName = GroupList[index].UserName; GroupNumberList.Add(Groupitem); } } GC.List = GroupNumberList; GC.Count = GroupNumberList.Count; string PostData = JsonConvert.SerializeObject(GC); string Result = HttpMethods.PostData(string.Format(UrlDefine.GetQunContactUrl, CommonDefine.LoginResult.pass_ticket), PostData, CommonDefine.Cookies, Encoding.UTF8).ContentData.ToString(); if (!string.IsNullOrWhiteSpace(Result)) { GroupMemberListEntity GroupMumberInfo = JsonConvert.DeserializeObject <GroupMemberListEntity>(Result); CommonDefine.GroupMemberList = GroupMumberInfo; } else { LogWriter.Write("获取群成员失败,返回结果为空!", LogPathDefine.WeChatGrouplogPath); } //GGC.List=new List<Entity.ListItem>( }
private void BtnEditApply_Click(object sender, RoutedEventArgs e) { int[] temp = new int[3]; try { temp[0] = Int32.Parse(txtBoxDay.Text); temp[1] = Int32.Parse(txtBoxHour.Text); temp[2] = Int32.Parse(txtboxMinute.Text); wordGroup.GroupInformation.SetGroupFirstDelayByInt(listViewGroup.SelectedIndex, temp); wordGroup.GroupInformation.GroupName[listViewGroup.SelectedIndex] = txtBoxGroupName.Text; wordGroup.GroupInformation.GroupRule[listViewGroup.SelectedIndex] = listViewApplyingRule.SelectedIndex; switch (comboExamMode.SelectedIndex) { case 0: wordGroup.GroupInformation.ExamTypes[listViewGroup.SelectedIndex] = GroupInfo.ExamType.LetterOnly; break; case 1: wordGroup.GroupInformation.ExamTypes[listViewGroup.SelectedIndex] = GroupInfo.ExamType.MeanOnly; break; default: wordGroup.GroupInformation.ExamTypes[listViewGroup.SelectedIndex] = GroupInfo.ExamType.Both; break; } GroupListItem.getInstance()[listViewGroup.SelectedIndex].GroupName = txtBoxGroupName.Text; GroupListItem.getInstance()[listViewGroup.SelectedIndex].ApplyingRule = wordGroup.getBoxRuleName(listViewApplyingRule.SelectedIndex); listViewGroup.Items.Refresh(); isEditMode = false; listViewApplyingRule.IsEnabled = false; txtBoxDay.IsReadOnly = true; txtBoxHour.IsReadOnly = true; txtboxMinute.IsReadOnly = true; txtBoxGroupName.IsReadOnly = true; listViewGroup.IsEnabled = true; btnCreateGroup.IsEnabled = true; btnDeleteBtn.IsEnabled = true; btnEditGroup.IsEnabled = true; btnEditApply.IsEnabled = false; btnEnter.IsEnabled = true; comboExamMode.IsEnabled = false; MessageBox.Show("편집이 완료되었습니다.", "알림"); } catch (FormatException) { MessageBox.Show("시간은 숫자로 표현되어야 합니다.", "오류"); } }
private void BtnCreateGroup_Click(object sender, RoutedEventArgs e) { int lastIndex = wordGroup.GroupInformation.LastIndex; if (lastIndex != -1) { wordGroup.GroupInformation.createDefaultGroup(lastIndex); GroupListItem.getInstance().Add(new GroupListItem(wordGroup.GroupInformation.GroupName[lastIndex], wordGroup.getBoxRuleName(wordGroup.GroupInformation.GroupRule[lastIndex]))); listViewGroup.Items.Refresh(); } else { MessageBox.Show("그룹의 최대 생성 갯수를 초과하였습니다.", "오류"); } }
public override View GetView(int position, View convertView, ViewGroup parent) { GroupListItem messageItem = convertView as GroupListItem; if ( messageItem == null ) { messageItem = new GroupListItem( ParentFragment.Activity.BaseContext ); } // the list is sorted, so we can safely assume the first entry is the closest group. if ( SelectedIndex == position ) { messageItem.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_Color ) ); } else { messageItem.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); } messageItem.ParentAdapter = this; messageItem.Position = position; messageItem.Title.Text = ParentFragment.GroupEntries[ position ].Title; // if there's a meeting time set, display it. Otherwise we won't display that row messageItem.MeetingTime.Visibility = ViewStates.Visible; if ( string.IsNullOrEmpty( ParentFragment.GroupEntries[ position ].MeetingTime ) == false ) { messageItem.MeetingTime.Text = ParentFragment.GroupEntries[ position ].MeetingTime; } else { messageItem.MeetingTime.Text = ConnectStrings.GroupFinder_ContactForTime; } // if this is the nearest group, add a label saying so messageItem.Distance.Text = string.Format( "{0:##.0} {1}", ParentFragment.GroupEntries[ position ].Distance, ConnectStrings.GroupFinder_MilesSuffix ); if ( position == 0 ) { messageItem.Distance.Text += " " + ConnectStrings.GroupFinder_ClosestTag; } return messageItem; }
public override View GetView(int position, View convertView, ViewGroup parent) { GroupListItem messageItem = convertView as GroupListItem; if (messageItem == null) { messageItem = new GroupListItem(ParentFragment.Activity.BaseContext); } // the list is sorted, so we can safely assume the first entry is the closest group. if (SelectedIndex == position) { messageItem.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color)); } else { messageItem.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor)); } messageItem.ParentAdapter = this; messageItem.Position = position; // if the row should display a group if (position < ParentFragment.GroupEntries.Count) { // ensure the join button is visible, in case this is a reused row // that had it hidden for "tap for 10 more" messageItem.JoinButton.Visibility = ViewStates.Visible; messageItem.Title.Text = ParentFragment.GroupEntries[position].Name; // if there's a meeting time set, display it. Otherwise we won't display that row messageItem.MeetingTime.Visibility = ViewStates.Visible; if (string.IsNullOrEmpty(ParentFragment.GroupEntries[position].MeetingTime) == false) { messageItem.MeetingTime.Text = ParentFragment.GroupEntries[position].MeetingTime; } else { messageItem.MeetingTime.Text = ConnectStrings.GroupFinder_ContactForTime; } // if this is the nearest group, add a label saying so messageItem.Distance.Text = string.Format("{0:##.0} {1}", ParentFragment.GroupEntries[position].DistanceFromSource, ConnectStrings.GroupFinder_MilesSuffix); if (position == 0) { messageItem.Distance.Text += " " + ConnectStrings.GroupFinder_ClosestTag; } messageItem.Childcare.Text = string.Empty; if (string.IsNullOrWhiteSpace(ParentFragment.GroupEntries[position].Filters) == false) { if (ParentFragment.GroupEntries[position].Filters.Contains(PrivateConnectConfig.GroupFinder_Childcare_Filter)) { messageItem.Childcare.Text = ConnectStrings.GroupFinder_OffersChildcare; } if (ParentFragment.GroupEntries[position].Filters.Contains(PrivateConnectConfig.GroupFinder_YoungAdults_Filter)) { if (messageItem.Childcare.Text.Length > 0) { messageItem.Childcare.Text += ", "; } messageItem.Childcare.Text += ConnectStrings.GroupFinder_YoungAdults; } } } // otherwise it's the "10 more" row else { messageItem.Title.Text = ConnectStrings.GroupFinder_10More; messageItem.Distance.Text = string.Empty; messageItem.Childcare.Text = string.Empty; messageItem.JoinButton.Visibility = ViewStates.Gone; messageItem.MeetingTime.Text = string.Empty; } return(messageItem); }