private void headerCheckBox_CheckedChanged(object sender, EventArgs e) { if (!noAutomaticalActionForControls) { if (undoHistory.Count > 0 && WindowManager.ShowQuestionBox(this, LanguageUtil.GetCurrentLanguageString("ResetChanges", Name)) == DialogResult.No) { noAutomaticalActionForControls = true; headerCheckBox.Checked = !headerCheckBox.Checked; noAutomaticalActionForControls = false; return; } CsvManager.ReadCsv(this, headerCheckBox.Checked, currentDelimiter, currentQuote); CsvManager.ClearUndo(this); } if (headerCheckBox.Checked) { addNewColumnToolStripTextBox.Enabled = true; addNewColumnToolStripButton.Enabled = CsvManager.IsNewColumnNameValorized(this); } else { addNewColumnToolStripTextBox.Enabled = false; addNewColumnToolStripButton.Enabled = true; } }
public DataTable GetTabelaDeFatoresAssociadosAjustada(string caminhoDaPlanilha) { var dtFatoresAssociados = CsvManager.GetCsvFile(caminhoDaPlanilha); dtFatoresAssociados = AdjustDataTable(dtFatoresAssociados); return(dtFatoresAssociados); }
private void csvGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (!addingNewColumn) { CsvManager.AddUndo(this); } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Q)) { config1 = CsvManager.GetLevel("1"); } }
private void quoteComboBox_TextChanged(object sender, EventArgs e) { if (noAutomaticalActionForControls || String.IsNullOrEmpty(quoteComboBox.Text)) { return; } if (undoHistory.Count > 0) { if (resetQuestionMade || (WindowManager.ShowQuestionBox(this, LanguageUtil.GetCurrentLanguageString("ResetChanges", Name)) != DialogResult.No)) { quoteComboBox.SelectedIndex = quoteComboBox.FindString(currentQuote.ToString()); resetQuestionMade = false; return; } noAutomaticalActionForControls = true; resetQuestionMade = true; quoteComboBox.SelectedIndex = quoteComboBox.FindString(currentQuote.ToString()); noAutomaticalActionForControls = false; return; } currentQuote = quoteComboBox.SelectedIndex != 0 ? quoteComboBox.Text[0] : '\0'; CsvManager.ReadCsv(this, headerCheckBox.Checked, currentDelimiter, currentQuote); //ClearUndo(); }
private void ImportButton_Click(object sender, EventArgs e) { string fileName; using (var op = new OpenFileDialog { Filter = FileFilters.CsvFilter }) { if (op.ShowDialog() != DialogResult.OK) { return; } fileName = op.FileName; } CsvFile file; try { file = CsvManager.Read(fileName); if (file == null || file.Headers.Length != 2 || file.Lines.Any(x => x.Length != 2)) { InfoBox.Show("Wrong file format. File should have header, and every line should have 2 values"); } } catch (Exception ex) { m_isInstallingPreset = false; InfoBox.Show("An error occurred during parsing file.\n" + ex); return; } ImportTFRCurve(file); }
private void ExportButton_Click(object sender, EventArgs e) { string fileName; using (var sf = new SaveFileDialog { FileName = string.Format("Arctic Fox-{0}-(TFR Curve)", NameTextBox.Text), Filter = FileFilters.CsvFilter }) { if (sf.ShowDialog() != DialogResult.OK) { return; } fileName = sf.FileName; } try { var file = ExportTFRCurve(); CsvManager.Write(file, fileName); } catch (Exception ex) { InfoBox.Show("An error occurred during TFR curve export.\n" + ex); } }
public GameData() { LocalizationMgr.Instance.Init(); CsvManager.Init(GameConfig.GetCurrentCsvTargetPath()); recordDataInfo = new RecordInfo(); IsLogin = false; }
private Tuple <List <CsvRow>, TaggableResult> readSavedProgress() { TaggableResult tagResult = TaggableResult.Load(saveDataPath); List <CsvRow> report = CsvManager.ReadAll(saveReportPath); return(new Tuple <List <CsvRow>, TaggableResult>(report, tagResult)); }
private async void btnImportar_Click(object sender, EventArgs e) { var dto = new ImportacaoDeQuestionariosDeFatoresAssociadosFamiliaDto { Edicao = txtAno.Text, CaminhoDaPlanilhaQuesitonarios = txtArquivoQuestionario.Text }; if (_dtRespostas is null || _dtRespostas.Rows.Count <= 0) { _dtRespostas = CsvManager.GetCsvFile(txtArquivo.Text); if (_dtRespostas.Rows.Count <= 0) { MessageBox.Show("Não existem regitros na planilha para exportação."); return; } } var service = _fatoresAssociadosQuestionarioRespostaFamiliaServicesFactory.Create(rdbDRE.Checked, rdbEscola.Checked, rdbSME.Checked, _dtRespostas); await service.ImportarAsync(dto, _questaoConstructoDtos); if (!dto.IsValid()) { MessageBox.Show(dto.Erros.FirstOrDefault(), "Erro na importação", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } MessageBox.Show("Importação realizada com sucesso.", "", MessageBoxButtons.OK, MessageBoxIcon.Information); }
public void CSVファイルが存在するとNullが返ってくる() { var csvManager = new CsvManager(); string expectedString = null; var returnMessage = csvManager.CheckCsvFileCreate(); Assert.AreEqual(expectedString, returnMessage); }
public void CSVファイルを新規作成すると作成完了メッセージが返ってくる() { var csvManager = new CsvManager(); string expectedString = csvManager.ReturnMessageIsCreateCsvFile(); var returnMessage = csvManager.CheckCsvFileCreate(); Assert.AreEqual(expectedString, returnMessage); }
private void csvGridView_ColumnDisplayIndexChanged(object sender, DataGridViewColumnEventArgs e) { if (e.Column.Index != e.Column.DisplayIndex && !columnMovementDone) { CsvManager.AddUndo(this); columnMovementDone = true; } }
private void addNewColumnToolStripTextBox_Enter(object sender, EventArgs e) { if (!CsvManager.IsNewColumnNameValorized(this)) { addNewColumnToolStripTextBox.Text = String.Empty; addNewColumnToolStripTextBox.ForeColor = SystemColors.WindowText; addNewColumnToolStripTextBox.Font = new Font("Tahoma", 8.25F); } }
// -------------------------------------------------------------------- // 楽曲情報・番組情報をインポート(1 ファイル分) // -------------------------------------------------------------------- private void ImportInfo <T>(Dictionary <String, List <List <String> > > oCsvs, String oCsvFileName, String oExtractedFolderPath, Int32 oKeyColumnIndex, ref Int32 oTotalAddedRecords) { // 解凍された CSV ファイルがあるか確認 String aExtractedCsvPath = oExtractedFolderPath + oCsvFileName; if (!File.Exists(aExtractedCsvPath)) { return; } Int32 aNumAddedRecords = 0; List <String> aTitle = NklCommon.CsvTitle <T>(); // CSV 読み込み ShowLogMessage(Common.TRACE_EVENT_TYPE_STATUS, oCsvFileName + " をインポートしています..."); List <List <String> > aCsv = NklCommon.LoadCsv(aExtractedCsvPath, mNicoKaraListerSettings, aTitle.Count + 1); // インポート String aUserCsvPath = NklCommon.UserCsvPath(oCsvFileName); foreach (List <String> aRecord in aCsv) { // ユーザー CSV に既にキー列が存在している場合はインポートしない String aFoundCsvPath; List <String> aFoundRecord = NklCommon.FindCsvRecord(oCsvs, oKeyColumnIndex, aRecord[oKeyColumnIndex], out aFoundCsvPath); if (aFoundRecord != null && !NklCommon.IsSystemCsvPath(aFoundCsvPath)) { continue; } // システム CSV に既に同じレコードが存在している場合はインポートしない if (NklCommon.RecordExists(oCsvs, aRecord, oKeyColumnIndex)) { continue; } // インポートする if (!oCsvs.ContainsKey(aUserCsvPath)) { oCsvs[aUserCsvPath] = new List <List <String> >(); } oCsvs[aUserCsvPath].Add(aRecord); aNumAddedRecords++; } // 保存 if (aNumAddedRecords > 0) { NklCommon.BackupCsv(aUserCsvPath); CsvManager.SaveCsv(aUserCsvPath, oCsvs[aUserCsvPath], "\r\n", Encoding.UTF8, aTitle, true); } // 報告 ShowLogMessage(Common.TRACE_EVENT_TYPE_STATUS, "重複を除く " + aNumAddedRecords + " レコードをインポートしました。"); oTotalAddedRecords += aNumAddedRecords; }
public void CSVファイルの有無を確認し存在するならtrueを返す(bool expectedValue) { //CSVの初期化 startProcess.TestStartingBeforeOperation_ElemetsCountIs_7(); var CM = new CsvManager(); var decision = CM.IsExistsCsv(); Assert.AreEqual(expectedValue, decision); }
void requestStop() { workTriggerBtn.Enabled = false; workTriggerBtn.Text = "Pending stop"; status = WorkStatus.PendingStop; currentProgressBar.Style = ProgressBarStyle.Marquee; CsvManager.CancelOperation(); mainBackgroundWorker.CancelAsync(); }
public CsvManagerTest() { _webHostEnvironment = new Mock <IWebHostEnvironment>(); _protectorHandler = new Mock <IProtectorHandler>(); _productHandler = new Mock <IProductHandler>(); _genericRepository = new Mock <IGenericRepository <Csv> >(); _csvHelper = new Mock <ICsvHelper>(); _csvHandler = new Mock <ICsvHandler>(); _csvManager = new CsvManager(_webHostEnvironment.Object, _csvHandler.Object, _genericRepository.Object, _productHandler.Object, _csvHelper.Object, _protectorHandler.Object); }
public void CSVファイルの読み込みに成功すると空ではないリストが返ってくる(bool expectedValue) { //CSVの初期化 startProcess.TestStartingBeforeOperation_ElemetsCountIs_7(); var csvManager = new CsvManager(); var testlist = new List <string>(); testlist = csvManager.LoadingProcessToCsv(); CollectionAssert.AllItemsAreNotNull(testlist); }
public void TODOを追加をすると追加完了メッセージが返ってくる(string addTodoString) { //CSVの初期化 startProcess.TestStartingBeforeOperation_ElemetsCountIs_7(); var operationManager = new OperationManager(); var csvManager = new CsvManager(); var expectedString = csvManager.ReturnMessageIsAdditionCompleted(); var requestString = operationManager.ReceivedNumber1WhenAddProcess(addTodoString); Assert.AreEqual(expectedString, requestString); }
private void undoAllToolStripMenuItem_Click(object sender, EventArgs e) { csvGridView.SuspendLayout(); while (undoHistory.Count > 0) { CsvManager.PerformUndo(this); } csvGridView.ResumeLayout(); }
public void TODOの追加処理を選択すると追加完了メッセージが返ってくる(string addTodoString) { //CSVの初期化 startProcess.TestStartingBeforeOperation_ElemetsCountIs_7(); var OM = new OperationManager(); var CM = new CsvManager(); var expectedString = CM.ReturnMessageIsAddingComplete(); var requestString = OM.WhenNumber1InputProcess(addTodoString); Assert.AreEqual(expectedString, requestString); }
private void ThreadEntry() { IList <Question> questions = Question.List().Where(q => !q.Category.InBuilt).ToList(); string csv = CsvManager.Export(questions); InvokeOnMainThread(delegate() { _textFieldExport.Text = csv; _busyView.Hide(); }); }
public void TODOの追加を行うとTODO追加の完了メッセージが返ってくる(string inpuTodo) { //CSVの初期化 startProcess.TestStartingBeforeOperation_ElemetsCountIs_7(); var csvManager = new CsvManager(); var operationSelect = new OperationSelect(); var expectedString = csvManager.ReturnMessageIsAdditionCompleted(); var returnString = operationSelect.OperationNumber1SelectedInAddProcess(inpuTodo); Assert.AreEqual(expectedString, returnString); }
public static void Main(string[] args) { var manager = new CsvManager(); var csvFileName = manager.GetCsvFileName(); var newFileName = manager.GetNewCsvFileName(); manager.SetPath(csvFileName); manager.GetColumnCount(); manager.RemoveLineBreaks2(); manager.SaveNewFileAsync(newFileName); }
// Use this for initialization protected void Setup(SessionType s) { main = this; if (PlayerPrefs.HasKey("-ambience")) { float val = PlayerPrefs.GetFloat("-ambience"); RenderSettings.ambientLight = new Color(val, val, val, 1); } gameOver = false; dragPoints = new List <Vector3>(); if (PlayerPrefs.HasKey("-language")) { language = PlayerPrefs.GetString("-language"); } sType = s; activeSlope = 0; csv = new CsvManager(); state = GameState.Title; text.renderer.enabled = false; screen = GameObject.Find("Screen").GetComponent <Renderer>(); currentEventNum = 0; currentPractice = 0; practicing = true; practiceSessionCount = 0; startTime = 0; audioSource = GetComponent <AudioSource>(); practice = new List <EventStats>(); events = new List <EventStats>(); border.renderer.material.mainTexture = simpleBorderImage; border.SetActive(true); }
public void CSVファイルに書き込んで成功したら成功メッセージが返ってくる() { //CSVの初期化 startProcess.TestStartingBeforeOperation_ElemetsCountIs_7(); var CM = new CsvManager(); var expectedString = CM.ReturnMessageIsAddingComplete(); var WriteTodoListTest = new List <string> { "xx", "yy", "zz" }; var ReturnMessage = CM.WriteProcessingToCsvFile(WriteTodoListTest); Assert.AreEqual(expectedString, ReturnMessage); }
public void CSVファイルの書き込みに成功すると成功メッセージが返ってくる() { //CSVの初期化 startProcess.TestStartingBeforeOperation_ElemetsCountIs_7(); var csvManager = new CsvManager(); var expectedString = csvManager.ReturnMessageIsAdditionCompleted(); var WriteTodoListTest = new List <string> { "xx", "yy", "zz" }; var ReturnMessage = csvManager.WritingProcessToCsvFile(WriteTodoListTest); Assert.AreEqual(expectedString, ReturnMessage); }
void ReadDataCsv(string content, TableContent d) { CsvManager.TextTrim = true; var td = CsvManager.ReadCsvString(content); d.Schema.AddRange(td.Header); foreach (var r in td.Content) { var tr = new TableRow(); tr.AddRange(r); d.Rows.Add(tr); } }
private void ExportCsv() { GUILayout.Label("Export CSV", EditorStyles.boldLabel); strData = EditorGUILayout.ObjectField(strData, typeof(StringData), true); if (strData != null) { if (GUILayout.Button("Create")) { Debug.Log("Create"); CsvManager.ExportCSV(strData as StringData); } } }
// Use this for initialization protected void Setup (SessionType s) { main = this; if(PlayerPrefs.HasKey("-ambience")){ float val = PlayerPrefs.GetFloat("-ambience"); RenderSettings.ambientLight = new Color(val,val,val,1); } gameOver = false; dragPoints = new List<Vector3>(); if(PlayerPrefs.HasKey("-language")){ language = PlayerPrefs.GetString("-language"); } sType = s; activeSlope =0; csv = new CsvManager(); state = GameState.Title; text.GetComponent<Renderer>().enabled = false; screen = GameObject.Find("Screen").GetComponent<Renderer>(); currentEventNum = 0; currentPractice = 0; practicing =true; practiceSessionCount = 0; startTime = 0; audioSource = GetComponent<AudioSource>(); practice = new List<EventStats>(); events = new List<EventStats>(); border.GetComponent<Renderer>().material.mainTexture = simpleBorderImage; border.SetActive(true); // pause pinch recognizer //var recognizer = new TKPinchRecognizer(); //recognizer.gestureRecognizedEvent += HandlePinch; //TouchKit.addGestureRecognizer( recognizer ); }