Beispiel #1
0
		/// <summary>
		///   Initializes a new instance of the Config class based on another Config object. </summary>
		/// <param name="config">
		///   The Config object whose properties and events are used to initialize the object being constructed. </param>
		public Config(Config config) :
			base(config)
		{
			m_groupName = config.m_groupName;
		}
        private void frmSpreadMktWatch_Load(object sender, EventArgs e)
        {
            var AbbA = LoadFormLocationAndSize(this);
            this.Location = new Point(AbbA[0], AbbA[1]);
            this.Size = new Size(AbbA[2], AbbA[3]);
            dvMktWatch = new DataView(CommonData.dtSpreadMktWatch);
            dgvMktWatch.BindSourceView = dvMktWatch;
            dgvMktWatch.LoadSaveSettings();

            cmbInstType.Items.Clear();
            var distinctInstNames = (from row in CommonData.dtSpreadContract.AsEnumerable() select row.Field<string>("InstrumentName1")).Distinct().ToArray();
            cmbInstType.Items.AddRange(distinctInstNames);
            if (cmbInstType.Items.Count > 0)
                cmbInstType.SelectedIndex = 0;

            LzoNanoData.Instance.OnSpreadDataChange += spradTableMethods.UpdateRecord;
            this.FormClosing += new FormClosingEventHandler(SaveFormLocationAndSize);

            //this.dgvMktWatch.DefaultCellStyle.Font = new Font("Tahoma", 15);
            //this.dgvMktWatch.DefaultCellStyle.ForeColor = Color.White;
            //this.dgvMktWatch.DefaultCellStyle.BackColor = Color.Black;
            //this.dgvMktWatch.DefaultCellStyle.SelectionForeColor = Color.White;
            //this.dgvMktWatch.DefaultCellStyle.SelectionBackColor = Color.Black;

            var config = new Config { GroupName = null };
            string iforms =(string) config.GetValue("Spread_mkt", Convert.ToString(0));
            iforms = iforms + ".xml";
            if (File.Exists(iforms))
            {
                // CommonData.dtSpreadMktWatch.ReadXml(iforms);
                CommonData.dtSpreadMktWatch.ReadXml(iforms);
            }
                foreach (DataRow dr in CommonData.dtSpreadMktWatch.Rows)
                {
                    // Global.Instance.pData.SubscribeSpread = dr[SpreadContract.Token1] + "-" + dr[SpreadContract.Token2];

                    Global.Instance.BoardLotDict.TryAdd(Convert.ToInt32(dr[SpreadContract.Token2]), new int());
                    Global.Instance.BoardLotDict[Convert.ToInt32(dr[SpreadContract.Token2])] = Convert.ToInt32(dr[SpreadContract.BoardLotQuantity2]);

                    LZO_NanoData.LzoNanoData.Instance.Subscribe = Convert.ToInt64(dr[SpreadContract.Token1].ToString() + dr[SpreadContract.Token2].ToString());
                    Global.Instance.Data_With_Nano.AddOrUpdate(Convert.ToInt64(dr[SpreadContract.Token1].ToString() + dr[SpreadContract.Token2].ToString()), ClassType.SPREAD, (k, v) => ClassType.SPREAD);

                }
        }
Beispiel #3
0
 /// <summary>
 ///   Initializes a new instance of the Config class based on another Config object. </summary>
 /// <param name="config">
 ///   The Config object whose properties and events are used to initialize the object being constructed. </param>
 public Config(Config config) :
     base(config)
 {
     m_groupName = config.m_groupName;
 }
 private void btnsaveMktwatch_Click(object sender, EventArgs e)
 {
     if (saveFileDialog1.ShowDialog() == DialogResult.OK)
     {
         var config = new Config { GroupName = null };
         CommonData.dtSpreadMktWatch.WriteXml(saveFileDialog1.FileName+".xml", true);
         config.SetValue("Spread_mkt", Convert.ToString(0), saveFileDialog1.FileName);
     }
 }
Beispiel #5
0
        private void iniConfigFile()
        {
            Config p = new Config();

            if (fileUtil.FileExist(TnSystemFileName.Config))
            {
                return;
            }
            p = new Config(TnSystemFileName.Config);

            using (p.Buffer(true))
            {
                //ghi thong tin phan mem

                p.SetValue(TnConfig.Product.Name, TnConfig.Product.Developer, "tn");
                TnSecParamForCalc a = TnSecParamForCalc.CallMe();
                //thong tin sde
                p.SetValue(TnConfig.Sde.Name, TnConfig.Sde.ServiceName, "esri_sde");

                //ghi list cac lop du lieu su dung
                //"thua", "thixa_thua" }, { "duong", "thixa_duong" }, { "hem", "thixa_hem" }, { "duong_buffer_1m", "thixa_duong_buffer_1m" }, { "duong_buffer_50m", "thixa_duong_buffer_50m" }, { "duong_buffer_100m", "thixa_duong_buffer_100m" }, { "duong_buffer_200m", "thixa_duong_buffer_200m" }, { "hem_buffer_1m", "thixa_hem_buffer_1m" }, { "hem_layer_buffer_1m", "thixa_hem_layer_buffer_1m" }, { "hem_buffer_1m_crt_frm_layer", "thixa_hem_buffer_1m_selected" } };
                p.SetValue(TnConfig.Layers.Name, TnConfig.Layers.Thua, "thixa_thua");
                p.SetValue(TnConfig.Layers.Name, TnConfig.Layers.Duong, "thixa_duong");
                p.SetValue(TnConfig.Layers.Name, TnConfig.Layers.Hem, "thixa_hem");
                p.SetValue(TnConfig.Layers.Name, TnConfig.Layers.Duong_buffer_1m, "thixa_duong_buffer_1m");
                p.SetValue(TnConfig.Layers.Name, TnConfig.Layers.Duong_buffer_50m, "thixa_duong_buffer_50m");
                p.SetValue(TnConfig.Layers.Name, TnConfig.Layers.Duong_buffer_100m, "thixa_duong_buffer_100m");
                p.SetValue(TnConfig.Layers.Name, TnConfig.Layers.Duong_buffer_200m, "thixa_duong_buffer_200m");
                p.SetValue(TnConfig.Layers.Name, TnConfig.Layers.Hem_buffer_1m, "thixa_hem_buffer_1m");
                p.SetValue(TnConfig.Layers.Name, TnConfig.Layers.Hem_layer_buffer_1m, "thixa_hem_layer_buffer_1m");
                p.SetValue(TnConfig.Layers.Name, TnConfig.Layers.Hem_buffer_1m_crt_frm_layer, "thixa_hem_buffer_1m_selected");

                /*
                //ghi các tham số quy định tính giá đất

                //Nam ap dung
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.NamApDung, 2011);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.ChoPhepApGia, 1);
                //--pnndt--
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.K2MatTien, 1.2);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.K3MatTien, 1.3);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.K4MatTien, 1.4);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.GToiThieuDoThiLoai4, 100000);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.GToiThieuDoThiLoai5, 80000);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PDatSau50mMatTien, 0.3);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PHemChinhRongDuoi3_5m, 0.2);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PHemChinhRongTren3_5m, 0.3);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PHemChinhRongTren6m, 0.4);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PHemPhuRongDuoi3_5m, 0.4);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PHemPhuRongTren3_5m, 0.6);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PHemPhuRongTren6m, 0.7);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PHemSauDuoi100m, 1);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PHemSauDuoi200m, 0.8);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PHemSauTren200m, 0.6);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DKhoangCach50mMatTien, 50);
                //--pnnnt--
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PPnnNtDuoi100m, 1);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.PPnnNtTren100m, 0.5);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DVt2Kv1, 1000);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DCachRgTmdv_dl_cn_cx_ktck, 500);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DCachDmgt_chodm, 500);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DBKUbnd_truong_cho_tramyt, 500);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.BTinhThuaDoiDien, 1);
                //--nong nghiep
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DRongDuongVitri1Nn, 9);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DRongDuongVitri2Nn, 9);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DSauDuongVitri1Nn, 100);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DSauDuongVitri2Nn, 100);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DSauDuongVitri2Nn2, 200);

                //--giapranh--
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DGrDatNn, 300);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DGrDatPnnDt, 100);
                p.SetValue(TnConfig.Param.Name, TnConfig.Param.DGrDatPnnNt, 200);
                 * */
            }
        }