All pastes #784397 Raw Edit

Someone

public text v1 · immutable
·published 2007-11-19 17:57 UTC
rendered paste body
private: System::Void chatrooms_ItemCheck(System::Object^  sender, System::Windows::Forms::ItemCheckEventArgs^  e) {		 
			 
			 if(e->NewValue == CheckState::Checked)
			 {

				 if(chatrooms->GetItemText(chatrooms->Items[e->Index]) == "*")
				 {
					 for (int i = 0; i < chatrooms->CheckedIndices->Count; i++)
					 {
						 String^ temp = chatrooms->GetItemText(chatrooms->Items[chatrooms->CheckedIndices[i]]);
						 if(temp != "*")
							 m->unsubscribe(util::ManagedToSTL(temp));
					 }

					 String^ temp = chatrooms->GetItemText(chatrooms->Items[e->Index]);
					 m->subscribe(util::ManagedToSTL(temp));
				 }
				 else if(chatrooms->GetItemChecked(0) == 0)
				 {
					 String^ temp = chatrooms->GetItemText(chatrooms->Items[e->Index]);
					 m->subscribe(util::ManagedToSTL(temp));
				 }
			 }
			 else
			 {

				 if(chatrooms->GetItemText(chatrooms->Items[e->Index]) == "*")
				 {
					 for (int i = 0; i < chatrooms->CheckedIndices->Count; i++)
					 {
						 String^ temp = chatrooms->GetItemText(chatrooms->Items[chatrooms->CheckedIndices[i]]);
						 if(temp != "*")
							 m->subscribe(util::ManagedToSTL(temp));					 
					 }

					 String^ temp = chatrooms->GetItemText(chatrooms->Items[e->Index]);
					 m->unsubscribe(util::ManagedToSTL(temp));
				 }
				 else if(chatrooms->GetItemChecked(0) == 0)
				 {
					 String^ temp = chatrooms->GetItemText(chatrooms->Items[e->Index]);
					 m->unsubscribe(util::ManagedToSTL(temp));
				 }
			 }

			 


		 }