예제 #1
0
 private void CurrentPhaseChanged(object o, PropertyChangedEventArgs e)
 {
     if (o != null)
     {
         currentControl = (StatisticsControl)o;
         this.Controls.Add(currentControl);
         currentControl.BringToFront();
         currentControl.Show();
     }
 }
예제 #2
0
 private void SurveysControl_VisibleChanged(object sender, EventArgs e)
 {
     if (!this.Visible)
     {
         if (this.currentControl != null)
         {
             this.Controls.Remove(currentControl);
             currentControl.Dispose();
             currentControl = null;
         }
     }
     else
     {
         this.panelSurveysContainer.Controls.Clear();
         this.loadSurveys();
     }
 }
예제 #3
0
        private void NotifyOnPropertyChanged(string propertyName)
        {
            var tmp = PropertyChanged;

            if (tmp != null)
            {
                if (this.viewModel.survey.host != null)
                {
                    StatisticsControl statisticsControl = new StatisticsControl(this.viewModel.survey.host.id);
                    statisticsControl.Dock          = DockStyle.Fill;
                    statisticsControl.AutoScaleMode = AutoScaleMode.None;
                    tmp(statisticsControl, new PropertyChangedEventArgs(propertyName));
                }
                else
                {
                    MessageBox.Show("This survey is not yet hosted", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }