using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using IReaper.PathManager;
namespace IReaper.Configurations{
public partial class PathPolicyControl : UserControl
{
#region field
PathPolicyType policy;
#endregion
public PathPolicyControl()
{
InitializeComponent();
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void PolicyChanged(object sender, EventArgs e)
{
//
switch (this.policyListBox.SelectedIndex)
{
case 0:
this.policy = PathPolicyType.Plain;
this.demostrationPictureBox.Image = Properties.Resources.plain_demo;
break;
case 1:
this.policy = PathPolicyType.Technology;
this.demostrationPictureBox.Image = Properties.Resources.technology_demo;
break;
case 2:
this.policy = PathPolicyType.Speaker;
this.demostrationPictureBox.Image = Properties.Resources.speaker_demo;
break;
case 3:
this.policy = PathPolicyType.Series;
this.demostrationPictureBox.Image = Properties.Resources.series_demo;
break;
case 4:
this.policy = PathPolicyType.Month;
this.demostrationPictureBox.Image = Properties.Resources.month_demo;
break;
}
//
}
private void SetPolicy(PathPolicyType Policy)
{
switch (Policy)
{
case PathPolicyType.Month:
this.policyListBox.SelectedIndex = 4;
break;
case PathPolicyType.Plain:
this.policyListBox.SelectedIndex = 0;
break;
case PathPolicyType.Series:
this.policyListBox.SelectedIndex = 3;
break;
case PathPolicyType.Speaker:
this.policyListBox.SelectedIndex = 2;
break;
case PathPolicyType.Technology:
this.policyListBox.SelectedIndex = 1;
break;
}
}
#region Attributes
public PathPolicyType Policy
{
get { return policy; }
set
{
policy = value;
this.SetPolicy(policy);
}
}
#endregion
}
}
|