void IConfigReader.CreateDefaultConfig() { if (System.IO.File.Exists(TnSystemFileName.PARAMS)) { return; } Xml xml; xml = new Xml(TnSystemFileName.PARAMS); string year = DateTime.Today.Year.ToString(); using (xml.Buffer(true)) { xml.RootName = "params"; xml.SetValue(year, TnConfig.Param.ChoPhepApGia, 1); //--pnndt-- xml.SetValue(year, TnConfig.Param.K2MatTien, 1.2); xml.SetValue(year, TnConfig.Param.K3MatTien, 1.3); xml.SetValue(year, TnConfig.Param.K4MatTien, 1.4); xml.SetValue(year, TnConfig.Param.GToiThieuDoThiLoai4, 100000); xml.SetValue(year, TnConfig.Param.GToiThieuDoThiLoai5, 80000); xml.SetValue(year, TnConfig.Param.PDatSau50mMatTien, 0.3); xml.SetValue(year, TnConfig.Param.PHemChinhRongDuoi3_5m, 0.2); xml.SetValue(year, TnConfig.Param.PHemChinhRongTren3_5m, 0.3); xml.SetValue(year, TnConfig.Param.PHemChinhRongTren6m, 0.4); xml.SetValue(year, TnConfig.Param.PHemPhuRongDuoi3_5m, 0.4); xml.SetValue(year, TnConfig.Param.PHemPhuRongTren3_5m, 0.6); xml.SetValue(year, TnConfig.Param.PHemPhuRongTren6m, 0.7); xml.SetValue(year, TnConfig.Param.PHemSauDuoi100m, 1); xml.SetValue(year, TnConfig.Param.PHemSauDuoi200m, 0.8); xml.SetValue(year, TnConfig.Param.PHemSauTren200m, 0.6); xml.SetValue(year, TnConfig.Param.DKhoangCach50mMatTien, 50); xml.SetValue(year, TnConfig.Param.DBufferMathem, 1); xml.SetValue(year, TnConfig.Param.DBufferMattien, 1); //--pnnnt-- xml.SetValue(year, TnConfig.Param.PPnnNtDuoi100m, 1); xml.SetValue(year, TnConfig.Param.PPnnNtTren100m, 0.5); xml.SetValue(year, TnConfig.Param.DVt2Kv1, 1000); xml.SetValue(year, TnConfig.Param.DCachRgTmdv_dl_cn_cx_ktck, 500); xml.SetValue(year, TnConfig.Param.DCachDmgt_chodm, 500); xml.SetValue(year, TnConfig.Param.DBKUbnd_truong_cho_tramyt, 500); xml.SetValue(year, TnConfig.Param.BTinhThuaDoiDien, 1); xml.SetValue(year, TnConfig.Param.DBufferMepDuongPnntVt1,1); xml.SetValue(year, TnConfig.Param.DBufferMepDuongPnntVt2, 1); xml.SetValue(year, TnConfig.Param.DBkTimKdcttKv2, 100); xml.SetValue(year, TnConfig.Param.DBkTimKdcttKv3, 100); //--nong nghiep xml.SetValue(year, TnConfig.Param.DRongDuongVitri1Nn, 9); xml.SetValue(year, TnConfig.Param.DRongDuongVitri2Nn, 9); xml.SetValue(year, TnConfig.Param.DSauDuongVitri1Nn, 100); xml.SetValue(year, TnConfig.Param.DSauDuongVitri2Nn, 100); xml.SetValue(year, TnConfig.Param.DSauDuongVitri2Nn2, 200); xml.SetValue(year, TnConfig.Param.DBufferMepDuongNnVt1, 1); xml.SetValue(year, TnConfig.Param.DBufferMepDuongNnVt2, 1); //--giapranh-- xml.SetValue(year, TnConfig.Param.DGrDatNn, 300); xml.SetValue(year, TnConfig.Param.DGrDatPnnDt, 100); xml.SetValue(year, TnConfig.Param.DGrDatPnnNt, 200); } }
void IUserInfo.SetInfo(string fileName) { string pass4File = ""; using (IEncrypt encrypt = new TnEncrypt()) { string _key = "tn"; pass4File = encrypt.Encrypt(this._pass, _key, true); } Xml sdeUserInfo = new Xml(TnSystemFileName.UserInfoFile); using (sdeUserInfo.Buffer(true)) { sdeUserInfo.SetValue(TnConfig.Sde.Name, TnConfig.Sde.Server, this._server); sdeUserInfo.SetValue(TnConfig.Sde.Name, TnConfig.Sde.User, this._user); sdeUserInfo.SetValue(TnConfig.Sde.Name, TnConfig.Sde.Pass, pass4File); sdeUserInfo.SetValue(TnConfig.Sde.Name, TnConfig.Sde.Instance, this._instance); sdeUserInfo.SetValue(TnConfig.Sde.Name, TnConfig.Sde.Database, this._db); sdeUserInfo.SetValue(TnConfig.Sde.Name, TnConfig.Sde.Version, this._version); sdeUserInfo.SetValue(TnConfig.Sde.Name, TnConfig.Sde.ServiceName, this._sde_service); sdeUserInfo.SetValue(TnConfig.Sde.Name, TnConfig.Sde.SavePass, this._savePass); } }
void IConfigReader.WriteOut(string fileName,string nam) { Xml xml; xml = new Xml(TnSystemFileName.PARAMS); string year = nam;//DateTime.Today.Year.ToString(); using (xml.Buffer(true)) { xml.RootName = "params"; xml.SetValue(year, TnConfig.Param.ChoPhepApGia, _config.ChoPhepApGia); //--pnndt-- xml.SetValue(year, TnConfig.Param.K2MatTien, _config.K2MatTien); xml.SetValue(year, TnConfig.Param.K3MatTien, _config.K3MatTien); xml.SetValue(year, TnConfig.Param.K4MatTien, _config.K4MatTien); xml.SetValue(year, TnConfig.Param.GToiThieuDoThiLoai4, _config.GToiThieuDoThiLoai4); xml.SetValue(year, TnConfig.Param.GToiThieuDoThiLoai5, _config.GToiThieuDoThiLoai5); xml.SetValue(year, TnConfig.Param.PDatSau50mMatTien, _config.PDatSau50mMatTien); xml.SetValue(year, TnConfig.Param.PHemChinhRongDuoi3_5m, _config.PHemChinhRongDuoi3_5m); xml.SetValue(year, TnConfig.Param.PHemChinhRongTren3_5m, _config.PHemChinhRongTren3_5m); xml.SetValue(year, TnConfig.Param.PHemChinhRongTren6m, _config.PHemChinhRongTren6m); xml.SetValue(year, TnConfig.Param.PHemPhuRongDuoi3_5m, _config.PHemPhuRongDuoi3_5m); xml.SetValue(year, TnConfig.Param.PHemPhuRongTren3_5m, _config.PHemPhuRongTren3_5m); xml.SetValue(year, TnConfig.Param.PHemPhuRongTren6m, _config.PHemPhuRongTren6m); xml.SetValue(year, TnConfig.Param.PHemSauDuoi100m, _config.PHemSauDuoi100m); xml.SetValue(year, TnConfig.Param.PHemSauDuoi200m, _config.PHemSauDuoi200m); xml.SetValue(year, TnConfig.Param.PHemSauTren200m, _config.PHemSauTren200m); xml.SetValue(year, TnConfig.Param.DKhoangCach50mMatTien, _config.DKhoangCach50mMatTien); xml.SetValue(year, TnConfig.Param.DBufferMathem, _config.DBufferMathem); xml.SetValue(year, TnConfig.Param.DBufferMattien, _config.DBufferMattien); //--pnnnt-- xml.SetValue(year, TnConfig.Param.PPnnNtDuoi100m, _config.PPnnNtDuoi100m); xml.SetValue(year, TnConfig.Param.PPnnNtTren100m, _config.PPnnNtTren100m); xml.SetValue(year, TnConfig.Param.DVt2Kv1, _config.DVt2Kv1); xml.SetValue(year, TnConfig.Param.DCachRgTmdv_dl_cn_cx_ktck, _config.DCachRgTmdv_dl_cn_cx_ktck); xml.SetValue(year, TnConfig.Param.DCachDmgt_chodm, _config.DCachDmgt_chodm); xml.SetValue(year, TnConfig.Param.DBKUbnd_truong_cho_tramyt, _config.DBKUbnd_truong_cho_tramyt); xml.SetValue(year, TnConfig.Param.BTinhThuaDoiDien, _config.BTinhThuaDoiDien); xml.SetValue(year, TnConfig.Param.DBufferMepDuongPnntVt1, _config.DBufferMepDuongPnntVt1); xml.SetValue(year, TnConfig.Param.DBufferMepDuongPnntVt2, _config.DBufferMepDuongPnntVt2); xml.SetValue(year, TnConfig.Param.DBkTimKdcttKv2, _config.DBkTimKdcttKv2); xml.SetValue(year, TnConfig.Param.DBkTimKdcttKv3, _config.DBkTimKdcttKv3); //--nong nghiep xml.SetValue(year, TnConfig.Param.DRongDuongVitri1Nn, _config.DRongDuongVitri1Nn); xml.SetValue(year, TnConfig.Param.DRongDuongVitri2Nn, _config.DRongDuongVitri2NnMax); xml.SetValue(year, TnConfig.Param.DSauDuongVitri1Nn, _config.DSauDuongVitri1Nn); xml.SetValue(year, TnConfig.Param.DSauDuongVitri2Nn, _config.DSauDuongVitri2Nn); xml.SetValue(year, TnConfig.Param.DSauDuongVitri2Nn2, _config.DSauDuongVitri2Nn2); xml.SetValue(year, TnConfig.Param.DBufferMepDuongNnVt1, _config.DBufferMepDuongNnVt1); xml.SetValue(year, TnConfig.Param.DBufferMepDuongNnVt2, _config.DBufferMepDuongNnVt2); //--giapranh-- xml.SetValue(year, TnConfig.Param.DGrDatNn, _config.DGrDatNn); xml.SetValue(year, TnConfig.Param.DGrDatPnnDt, _config.DGrDatPnnDt); xml.SetValue(year, TnConfig.Param.DGrDatPnnNt, _config.DGrDatPnnNt); } //MessageBox.Show() }
private void NoteSheets_FormClosing(object sender, FormClosingEventArgs e) { char delim = Path.DirectorySeparatorChar; String filename = "notes" + delim + gId + ".xml"; if (File.Exists(filename)) File.Delete(filename); Xml ExportFile = new Xml(filename); try { ExportFile.RootName = "notesheet"; String secname; int pagecount = SheetSelection.TabPages.Count; for (int i = 0; i < pagecount; i++) { Sheet sheet = (Sheet)SheetSelection.TabPages[i].Tag; secname = "sheet" + (i + 1).ToString(); ExportFile.SetValue(secname, "name", sheet.title); ExportFile.SetValue(secname, "content", sheet.content); } } finally { e.Cancel = true; Hide(); } }
public void Save() { Xml profile = new Xml(GetSettingsPath()); profile.SetValue(SECTION, "Style", style.ToString()); profile.SetValue(SECTION, "IdentUseTab", identUseTab); profile.SetValue(SECTION, "IdentNumber", identNumber); profile.SetValue(SECTION, "AddSpaceAfterCtrlWord", addSpaceAfterCtrlWord); profile.SetValue(SECTION, "AutoCompleteBracket", autoCompleteBracket); profile.SetValue(BLACKLINE, "RemoveBlankLine", (int)removeBlankLine); profile.SetValue(BLACKLINE, "KeepBlankLineCount", (int)KeepBlankLineCount); profile.SetValue(BLACKLINE, "MaxBlankLine", (int)MaxBlankLine); }
public void SaveToFile(String fileName) { if (File.Exists(fileName)) File.Delete(fileName); Xml watchList = new Xml(fileName); watchList.RootName = "watchlist"; WatchEntry current; String section; for (int i = 0; i < addressWatchList.Count; i++) { current = addressWatchList[i]; section = "watch" + String.Format("{0:000}", i); watchList.SetValue(section, "name", current.name); watchList.SetValue(section, "address", addressToString(current.address)); switch (current.dataSize) { case WatchDataSize.Bit8: watchList.SetValue(section, "size", 0); break; case WatchDataSize.Bit16: watchList.SetValue(section, "size", 1); break; case WatchDataSize.SingleFp: watchList.SetValue(section, "size", 3); break; default: watchList.SetValue(section, "size", 2); break; } } }
private void SetLastAgent(string characterName) { Xml config = new Xml(); config.SetValue("CharacterParams", "LastCharacter", characterName); }
private void SaveProfile() { // Save user profile information such as window position, selected units, etc Xml profile = new Xml(); profile.Name = "scaleview-settings.xml"; profile.SetValue("Program", "Version", Application.ProductVersion); profile.SetValue("MainWindow", "Left", this.Left); profile.SetValue("MainWindow", "Top", this.Top); profile.SetValue("Unit", "lb\\oz", radioLboz.Checked); profile.SetValue("Unit", "ounces", radioOunces.Checked); profile.SetValue("Unit", "grams", radioGrams.Checked); profile.SetValue("Settings", "AutoCopy", chkAutoCopy.Checked); profile.SetValue("Settings", "RoundOz", chkRoundOz.Checked); profile.SetValue("Settings", "CopyUnit", chkCopyUnit.Checked); }
private void btnSECRET_Click(object sender, EventArgs e) { /* SAVE SETTINGS PROCEDURE */ Xml Memorizza = new Xml(); Memorizza.SetValue("Option Group", "Purge Check", this.checkPURGE.CheckState); Memorizza.SetValue("Option Group", "Multiple Check", this.checkMULTIPLE.CheckState); Memorizza.SetValue("Option Group", "Voice Check", this.checkNOVOICE.CheckState); Memorizza.SetValue("Option Group", "Main Grid", this.radioMAIN.Checked); Memorizza.SetValue("Option Group", "Beta Grid", this.radioBETA.Checked); Memorizza.SetValue("Option Group", "SL Viewer", this.radioSLVIEWER.Checked); Memorizza.SetValue("Option Group", "PHOENIX Viewer", this.radioFIRESTORM.Checked); Memorizza.SetValue("Option Group", "CPU 32bit", this.radio32bit.Checked); Memorizza.SetValue("Option Group", "CPU 64bit", this.radio64bit.Checked); /* */ Memorizza.SetValue("Client Path", "Phoenix Viewer 32bit", @"C:\Program Files\Firestorm-Releasex64\Firestorm-bin.exe"); Memorizza.SetValue("Client Path", "Phoenix Viewer 64bit", @"C:\Program Files\Firestorm-Releasex64\Firestorm-bin.exe"); Memorizza.SetValue("Client Path", "SL Viewer 32bit", @"C:\Program Files (x86)\SecondLifeViewer\SecondLifeViewer.exe"); Memorizza.SetValue("Client Path", "SL Viewer 64bit", @"C:\Program Files (x86)\SecondLifeViewer\SecondLifeViewer.exe"); /* */ Memorizza.SetValue("Odin", "Thor", "Procedura Creata con Secret Button"); /* */ /* /. SAVE SETTINGS PROCEDURE */ Timer t = new Timer(); t.Interval = 5000; timer1.Enabled = true; timer1.Tick += new System.EventHandler(OnTimerEvent); }
private void btnSAVE_Click(object sender, EventArgs e) { /* SAVE SETTINGS PROCEDURE */ Xml Memorizza = new Xml(); Memorizza.SetValue("Option Group", "Purge Check", this.checkPURGE.CheckState); Memorizza.SetValue("Option Group", "Multiple Check", this.checkMULTIPLE.CheckState); Memorizza.SetValue("Option Group", "Voice Check", this.checkNOVOICE.CheckState); Memorizza.SetValue("Option Group", "Main Grid", this.radioMAIN.Checked); Memorizza.SetValue("Option Group", "Beta Grid", this.radioBETA.Checked); Memorizza.SetValue("Option Group", "SL Viewer", this.radioSLVIEWER.Checked); Memorizza.SetValue("Option Group", "PHOENIX Viewer", this.radioFIRESTORM.Checked); Memorizza.SetValue("Option Group", "CPU 32bit", this.radio32bit.Checked); Memorizza.SetValue("Option Group", "CPU 64bit", this.radio64bit.Checked); /* */ Memorizza.SetValue("Client Path", "Phoenix Viewer 32bit", @"C:\Program Files\Firestorm-Releasex64\Firestorm-bin.exe"); Memorizza.SetValue("Client Path", "Phoenix Viewer 64bit", @"C:\Program Files\Firestorm-Releasex64\Firestorm-bin.exe"); Memorizza.SetValue("Client Path", "SL Viewer 32bit", @"C:\Program Files\Firestorm-Releasex64\Firestorm-bin.exe"); Memorizza.SetValue("Client Path", "SL Viewer 64bit", @"C:\Program Files\Firestorm-Releasex64\Firestorm-bin.exe"); /* /. SAVE SETTINGS PROCEDURE */ }