Exemplo n.º 1
0
		internal void CreatePanels(string strSurveyFile)
		{
			if (m_SurveyLoader != null)
				return;

			//strSurveyFile = HttpContext.Current.Server.MapPath(strSurveyFile);
			m_SurveyLoader = new SurveyLoader(strSurveyFile);
			m_GroupPanelList = new List<StackPanel>();
			List<GroupBase> groups = m_SurveyLoader.Survey.GroupList;
			foreach (GroupBase group in groups)
			{
				StackPanel panel = new StackPanel();
				panel.Visibility = Visibility.Collapsed;
				panel.Orientation = Orientation.Vertical;
				panel.Tag = group.Name;
				m_ParentPanel.Children.Add(panel);
				m_GroupPanelList.Add(panel);

				List<QuestionBase> questions = group.QuestionList;
				foreach (QuestionBase question in questions)
				{
					StackPanel panelQuestion = new StackPanel();
					panelQuestion.Orientation = question.StatementLayoutDirection;
					panel.Children.Add(panelQuestion);
					CreateControl(question, panelQuestion);
				}
			}

			m_iCurrentPanel = 0;
		}
Exemplo n.º 2
0
		private bool LoadSurvey(SurveyLoader surveyLoader)
		{
			const string nodeName = "Survey";
			if (!MatchingElementStart(nodeName))
				return false;

			// Process any attributes
			SurveyBase survey = new SurveyBase(m_xmlReader);
			surveyLoader.Survey = survey;

			// Process any children
			if (m_xmlReader.IsEmptyElement)
				return true;

			while (ReadNode())
			{
				if (MatchingElementEnd(nodeName))
					break;

				if (LoadGroup(survey))
					continue;
			}

			return true;
		}