public void Clone_ShouldCloneKeyValuePair()
        {
            var original = new KeyValuePair<int, string>(1, "foo");
            var copy = original.Clone<KeyValuePair<int, string>>();

            Assert.That(copy.Key, Is.EqualTo(1));
            Assert.That(copy.Value, Is.EqualTo("foo"));
        }
        public void Clone_ShouldCloneKeyValuePair()
        {
            var original = new KeyValuePair <int, string>(1, "foo");
            var copy     = original.Clone <KeyValuePair <int, string> >();

            Assert.That(copy.Key, Is.EqualTo(1));
            Assert.That(copy.Value, Is.EqualTo("foo"));
        }
 protected virtual KeyValuePair <Guid, T> CopyCurrentValue()
 {
     return(_CurrentValue.Clone());
 }
Exemplo n.º 4
0
        public void ApplyLang()
        {
            IsInit = true;
            FontFamily fontFamily = this.Font.FontFamily;

            try
            {
                fontFamily = new FontFamily(Services.Lang.CurrentLang.Font);
            }
            catch (Exception) { }
            labReducerTempSens.Font    = new Font(fontFamily, labReducerTempSens.Font.Size);
            labGasTempSens.Font        = new Font(fontFamily, labGasTempSens.Font.Size);
            labLevelIndicatorSens.Font = new Font(fontFamily, labLevelIndicatorSens.Font.Size);

            //  labGasLevel.Font = new Font(fontFamily, labGasLevel.Font.Size);
            labLambdaType.Font         = new Font(fontFamily, labLambdaType.Font.Size);
            labLambda1Type.Font        = new Font(fontFamily, labLambda1Type.Font.Size);
            label4.Font                = new Font(fontFamily, label4.Font.Size);
            ddlReducerTempSens.Font    = new Font(fontFamily, ddlReducerTempSens.Font.Size);
            ddlGasTempSens.Font        = new Font(fontFamily, ddlGasTempSens.Font.Size);
            ddlLevelIndicatorSens.Font = new Font(fontFamily, ddlLevelIndicatorSens.Font.Size);
            ddlO2Number.Font           = new Font(fontFamily, ddlO2Number.Font.Size); //LDC
            ddlO2Type.Font             = new Font(fontFamily, ddlO2Number.Font.Size); //LDC
            ddlLambda1Type.Font        = new Font(fontFamily, ddlLambda1Type.Font.Size);
            ddlLambda2Type.Font        = new Font(fontFamily, ddlLambda2Type.Font.Size);
            labReducerTempSens.Text    = LangWords["304_1"];
            labGasTempSens.Text        = LangWords["304_2"];
            labLevelIndicatorSens.Text = LangWords["304_3"];
            //ddlO2Number.Text = LangWords["304_3"];//LDC
            //   labGasLevel.Text = LangWords["304_4"];
            //labLambdaType.Text = string.Format(LangWords["304_12"], "1");//304_12=氧传感器{0}类型
            labLambdaType.Text = LangWords["304_12"];
            //labLambda2Type.Text = string.Format(LangWords["304_12"], "2");
            labLambda1Type.Text = LangWords["304_50"];
            label4.Text         = LangWords["304_51"];
            LambdaNum.Text      = LangWords["304_60"];
            //lab1Hight.Font = new Font(fontFamily, lab1Hight.Font.Size);
            //lab1Low.Font = new Font(fontFamily, lab1Low.Font.Size);
            //lab2Hight.Font = new Font(fontFamily, lab2Hight.Font.Size);
            //lab2Low.Font = new Font(fontFamily, lab2Low.Font.Size);
            //labDealy.Font = new Font(fontFamily, labDealy.Font.Size);
            //labNumber.Font = new Font(fontFamily, labNumber.Font.Size);

            var word = Services.Lang.CurrentWords;

            //lab1Hight.Text = word["310_2"];
            //lab1Low.Text = word["310_3"];
            //lab2Hight.Text = word["310_2"];
            //lab2Low.Text = word["310_3"];
            //labDealy.Text = word["310_4"];
            //labNumber.Text = word["310_5"];
            ddlReducerTempSens.DisplayMember    = "Key";
            ddlReducerTempSens.ValueMember      = "Value";
            ddlGasTempSens.DisplayMember        = "Key";
            ddlGasTempSens.ValueMember          = "Value";
            ddlLevelIndicatorSens.DisplayMember = "Key";
            ddlLevelIndicatorSens.ValueMember   = "Value";
            ddlO2Number.DisplayMember           = "Key";
            ddlO2Number.ValueMember             = "Value";
            ddlO2Type.DisplayMember             = "Key";
            ddlO2Type.ValueMember = "Value";
            var ds1 = new KeyValuePair <String, String>[3] {
                new KeyValuePair <String, String>(LangWords["304_16"], Models.Enums.TempSensTypes.Ohm10K.ToString()),
                //new KeyValuePair<String, String>(LangWords["304_17"], Models.Enums.TempSensTypes.Ohm8K5.ToString()),//LDC删除
                //new KeyValuePair<String, String>(LangWords["304_18"], Models.Enums.TempSensTypes.Ohm5K.ToString()),
                new KeyValuePair <String, String>(LangWords["304_19"], Models.Enums.TempSensTypes.Ohm4K7.ToString()),
                //new KeyValuePair<String, String>(LangWords["304_20"], Models.Enums.TempSensTypes.Ohm2K2.ToString()),
                new KeyValuePair <String, String>(LangWords["304_21"], Models.Enums.TempSensTypes.Ohm2K.ToString())
            };

            ddlReducerTempSens.DataSource = ds1;
            var ds2 = new KeyValuePair <String, String>[3] {
                new KeyValuePair <String, String>(LangWords["304_16"], Models.Enums.TempSensTypes.Ohm10K.ToString()),
                //new KeyValuePair<String, String>(LangWords["304_17"], Models.Enums.TempSensTypes.Ohm8K5.ToString()),
                //new KeyValuePair<String, String>(LangWords["304_18"], Models.Enums.TempSensTypes.Ohm5K.ToString()),
                new KeyValuePair <String, String>(LangWords["304_19"], Models.Enums.TempSensTypes.Ohm4K7.ToString()),
                //new KeyValuePair<String, String>(LangWords["304_20"], Models.Enums.TempSensTypes.Ohm2K2.ToString()),
                new KeyValuePair <String, String>(LangWords["304_21"], Models.Enums.TempSensTypes.Ohm2K.ToString())
            };

            ddlGasTempSens.DataSource = ds2;
            var ds3 = new KeyValuePair <String, String>[4] {
                new KeyValuePair <String, String>(LangWords["304_22"], Models.Enums.LevelIndicatorSensTypes.IGT.ToString()),
                //new KeyValuePair<String, String>(LangWords["304_23"], Models.Enums.LevelIndicatorSensTypes.Lovato.ToString()),
                new KeyValuePair <String, String>(LangWords["304_24"], Models.Enums.LevelIndicatorSensTypes.ZeroTo90ohm.ToString()),
                new KeyValuePair <String, String>(LangWords["304_52"], Models.Enums.LevelIndicatorSensTypes.NotStandard.ToString()),
                new KeyValuePair <String, String>(LangWords["304_53"], Models.Enums.LevelIndicatorSensTypes.NotStandardInverted.ToString()),
                //     new KeyValuePair<String, String>("", Models.Enums.LevelIndicatorSensTypes.Unknow.ToString())
                //new KeyValuePair<String, String>(LangWords["304_25"], Models.Enums.LevelIndicatorSensTypes.ZeroTo110ohm.ToString()),
                //new KeyValuePair<String, String>(LangWords["304_26"], Models.Enums.LevelIndicatorSensTypes.HundredTo10Kohm.ToString()),
                //new KeyValuePair<String, String>(LangWords["304_27"], Models.Enums.LevelIndicatorSensTypes.ZeroTo90ohm_2.ToString()),
                //new KeyValuePair<String, String>(LangWords["304_28"], Models.Enums.LevelIndicatorSensTypes.NinetyTo0ohm.ToString()),
                //new KeyValuePair<String, String>(LangWords["304_29"], Models.Enums.LevelIndicatorSensTypes.HundredTenTo0ohm.ToString()),
                //new KeyValuePair<String, String>(LangWords["304_30"], Models.Enums.LevelIndicatorSensTypes.TenKTo100ohm.ToString())
            };

            ddlLevelIndicatorSens.DataSource = ds3;
            //var ds4 = new KeyValuePair<String, String>[2]{
            //    new KeyValuePair<String, String>(LangWords["304_22"], Models.O2Numbers.ToString()),
            //    new KeyValuePair<String, String>(LangWords["304_24"], Models.O2Numbers.ToString()),
            //};
            //ddlLevelIndicatorSens.DataSource = ds4;

            List <KeyValuePair <String, string> > ds4 = new List <KeyValuePair <string, string> >();

            ds4.Add(new KeyValuePair <String, string>("1", "1"));
            ds4.Add(new KeyValuePair <String, string>("2", "2"));
            //if (Device.DeviceInfo.HardInof.SumCylinders >= 6) ds1.Add(new KeyValuePair<string, string>("6" + Words["302_2"], "6"));//LDC
            //if (Device.DeviceInfo.HardInof.SumCylinders >= 8) ds1.Add(new KeyValuePair<string, string>("8" + Words["302_2"], "8"));
            ddlO2Number.DataSource = ds4.ToArray();



            ddlLambda1Type.DisplayMember = "Key";
            ddlLambda1Type.ValueMember   = "Value";
            ddlLambda2Type.DisplayMember = "Key";
            ddlLambda2Type.ValueMember   = "Value";
            var ds5 = new KeyValuePair <String, String>[] {
                //new KeyValuePair<String,String>(LangWords["304_9"], Models.Enums.LambdaTypes.Voltage.ToString()),
                //new KeyValuePair<String,String>(LangWords["304_10"], Models.Enums.LambdaTypes.Reverse.ToString()),
                //new KeyValuePair<String,String>(LangWords["304_11"], Models.Enums.LambdaTypes.UEGO.ToString()),
                new KeyValuePair <String, String>(LangWords["304_54"], Models.Enums.LambdaTypes.Befor.ToString()),
                new KeyValuePair <String, String>(LangWords["304_55"], Models.Enums.LambdaTypes.After.ToString()),
                new KeyValuePair <String, String>(LangWords["304_8"], Models.Enums.LambdaTypes.NoConnection.ToString())
            };

            ddlLambda1Type.DataSource = ds5;
            ddlLambda2Type.DataSource = ds5.Clone();

            var ds6 = new KeyValuePair <String, String>[] {
                new KeyValuePair <String, String>(LangWords["304_56"], Models.Enums.LambdaTypes.Volt0_1.ToString()),
                new KeyValuePair <String, String>(LangWords["304_57"], Models.Enums.LambdaTypes.Volt0_5.ToString()),
                new KeyValuePair <String, String>(LangWords["304_58"], Models.Enums.LambdaTypes.Volt5_0.ToString()),
                new KeyValuePair <String, String>(LangWords["304_59"], Models.Enums.LambdaTypes.Volt08_16.ToString())
            };

            ddlO2Type.DataSource = ds6;



            IsInit = false;
        }