示例#1
0
        public TrailerForm(MainForm.UpdateMethod method, object obj, int index)
        {
            InitializeComponent();

            txtPersonsNum.Enabled        = false;
            txtMaxWeightCapacity.Enabled = true;
            if (obj != null)
            {
                txtName.Text               = (obj as Trailer).Name;
                txtWheelsNum.Text          = (obj as Trailer).WheelsNum.ToString();
                txtPrice.Text              = (obj as Trailer).Price.ToString();
                txtMaxWeightCapacity.Text  = (obj as Trailer).MaxWeightCapacity.ToString();
                chkbxIsResidential.Checked = (obj as Trailer).IsResidential;

                txtPersonsNum.Text = (obj as Trailer).PersonsNum.ToString();
                if (chkbxIsResidential.Checked)
                {
                    txtPersonsNum.Enabled = true;
                }
                else
                {
                    txtMaxWeightCapacity.Enabled = true;
                }
            }

            ReqUpdateMethod = method;
            IndexInListView = index;
        }
示例#2
0
        public MotorcycleForm(MainForm.UpdateMethod method, object obj, int index)
        {
            InitializeComponent();

            foreach (string typeStr in Enum.GetNames(typeof(Motorcycle.TMark)))
            {
                cmbMark.Items.Add(typeStr);
            }

            foreach (string typeStr in Enum.GetNames(typeof(Motorcycle.TShellType)))
            {
                cmbShellType.Items.Add(typeStr);
            }

            if (obj != null)
            {
                txtName.Text              = (obj as Motorcycle).Name;
                txtWheelsNum.Text         = (obj as Motorcycle).WheelsNum.ToString();
                txtPrice.Text             = (obj as Motorcycle).Price.ToString();
                txtEnginePower.Text       = (obj as Motorcycle).EnginePower.ToString();
                txtMaxSpeed.Text          = (obj as Motorcycle).MaxSpeed.ToString();
                txtReleaseDate.Text       = (obj as Motorcycle).ReleaseYear.ToString();
                cmbMark.SelectedItem      = (obj as Motorcycle).mark.ToString();
                cmbShellType.SelectedItem = (obj as Motorcycle).shellType.ToString();
                chkbxCanHavePram.Checked  = (obj as Motorcycle).CanHavePram;
            }

            ReqUpdateMethod = method;
            IndexInListView = index;
        }
示例#3
0
        public ChoosePluginForm(MainForm.UpdateMethod method, List <IPlugin> pluginsList)
        {
            InitializeComponent();

            cmbChoosePlugin.Items.Add("None");
            foreach (IPlugin curPlugin in pluginsList)
            {
                if (curPlugin != null)
                {
                    cmbChoosePlugin.Items.Add(curPlugin.GetType().Name);
                }
            }

            reqMethod               = method;
            reqPluginsList          = pluginsList;
            MainForm.window.Enabled = false;
            this.Show();
        }
示例#4
0
        public TrackForm(MainForm.UpdateMethod method, object obj, int index)
        {
            InitializeComponent();

            foreach (string typeStr in Enum.GetNames(typeof(Track.TMark)))
            {
                cmbMark.Items.Add(typeStr);
            }

            foreach (CatalogItem curCatalogItem in MainForm.Catalog)
            {
                if (curCatalogItem.Category == CatalogItem.TCategories.Trailer)
                {
                    cmbTrailer.Items.Add(curCatalogItem.Name);
                }
            }

            cmbTrailer.Enabled           = false;
            txtMaxWeightCarrying.Enabled = false;

            if (obj != null)
            {
                txtName.Text            = (obj as Track).Name;
                txtWheelsNum.Text       = (obj as Track).WheelsNum.ToString();
                txtPrice.Text           = (obj as Track).Price.ToString();
                txtEnginePower.Text     = (obj as Track).EnginePower.ToString();
                txtMaxSpeed.Text        = (obj as Track).MaxSpeed.ToString();
                txtReleaseDate.Text     = (obj as Track).ReleaseYear.ToString();
                cmbMark.SelectedItem    = (obj as Track).mark.ToString();
                chkbxHasTrailer.Checked = (obj as Track).HasTrailer;
                if (chkbxHasTrailer.Checked)
                {
                    cmbTrailer.Enabled           = true;
                    txtMaxWeightCarrying.Enabled = true;
                    cmbTrailer.SelectedItem      = (obj as Track).trailer.Name;
                    txtMaxWeightCarrying.Text    = (obj as Track).MaxWeightCarrying.ToString();
                }
            }

            ReqUpdateMethod = method;
            IndexInListView = index;
        }
示例#5
0
        public BicycleForm(MainForm.UpdateMethod method, object obj, int index)
        {
            InitializeComponent();
            foreach (string typeStr in Enum.GetNames(typeof(Bicycle.BrakeType)))
            {
                cmbBrakeType.Items.Add(typeStr);
            }

            if (obj != null)
            {
                txtName.Text              = (obj as Bicycle).Name;
                txtWheelsNum.Text         = (obj as Bicycle).WheelsNum.ToString();
                txtPrice.Text             = (obj as Bicycle).Price.ToString();
                txtGearsNum.Text          = (obj as Bicycle).GearsNum.ToString();
                txtWheelDiam.Text         = (obj as Bicycle).WheelsDiameter.ToString();
                cmbBrakeType.SelectedItem = (obj as Bicycle).brakeType.ToString();
            }

            ReqUpdateMethod = method;
            IndexInListView = index;
        }
示例#6
0
        public LightCarForm(MainForm.UpdateMethod method, object obj, int index)
        {
            InitializeComponent();

            foreach (string typeStr in Enum.GetNames(typeof(LightCar.TMark)))
            {
                cmbMark.Items.Add(typeStr);
            }

            if (obj != null)
            {
                txtName.Text          = (obj as LightCar).Name;
                txtWheelsNum.Text     = (obj as LightCar).WheelsNum.ToString();
                txtPrice.Text         = (obj as LightCar).Price.ToString();
                txtEnginePower.Text   = (obj as LightCar).EnginePower.ToString();
                txtMaxSpeed.Text      = (obj as LightCar).MaxSpeed.ToString();
                txtReleaseYear.Text   = (obj as LightCar).ReleaseYear.ToString();
                cmbMark.SelectedItem  = (obj as LightCar).mark;
                txtPassengersNum.Text = (obj as LightCar).PassengersNum.ToString();
            }

            ReqUpdateMethod = method;
            IndexInListView = index;
        }
示例#7
0
 public override Form Create(MainForm.UpdateMethod method, object obj, int index)
 {
     return(new MotorcycleForm(method, obj, index));
 }
示例#8
0
 public override Form Create(MainForm.UpdateMethod method, object obj, int index)
 {
     return(new LightCarForm(method, obj, index));
 }
示例#9
0
 { public abstract Form Create(MainForm.UpdateMethod method, object obj, int index); }