Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
        public DataTable GetTabelaDeFatoresAssociadosAjustada(string caminhoDaPlanilha)
        {
            var dtFatoresAssociados = CsvManager.GetCsvFile(caminhoDaPlanilha);

            dtFatoresAssociados = AdjustDataTable(dtFatoresAssociados);
            return(dtFatoresAssociados);
        }
Esempio n. 3
0
 private void csvGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e)
 {
     if (!addingNewColumn)
     {
         CsvManager.AddUndo(this);
     }
 }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Q))
     {
         config1 = CsvManager.GetLevel("1");
     }
 }
Esempio n. 5
0
        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);
            }
        }
Esempio n. 8
0
 public GameData()
 {
     LocalizationMgr.Instance.Init();
     CsvManager.Init(GameConfig.GetCurrentCsvTargetPath());
     recordDataInfo = new RecordInfo();
     IsLogin        = false;
 }
Esempio n. 9
0
        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));
        }
Esempio n. 10
0
        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);
        }
Esempio n. 11
0
        public void CSVファイルが存在するとNullが返ってくる()
        {
            var    csvManager     = new CsvManager();
            string expectedString = null;
            var    returnMessage  = csvManager.CheckCsvFileCreate();

            Assert.AreEqual(expectedString, returnMessage);
        }
Esempio n. 12
0
        public void CSVファイルを新規作成すると作成完了メッセージが返ってくる()
        {
            var    csvManager     = new CsvManager();
            string expectedString = csvManager.ReturnMessageIsCreateCsvFile();
            var    returnMessage  = csvManager.CheckCsvFileCreate();

            Assert.AreEqual(expectedString, returnMessage);
        }
Esempio n. 13
0
 private void csvGridView_ColumnDisplayIndexChanged(object sender, DataGridViewColumnEventArgs e)
 {
     if (e.Column.Index != e.Column.DisplayIndex && !columnMovementDone)
     {
         CsvManager.AddUndo(this);
         columnMovementDone = true;
     }
 }
Esempio n. 14
0
 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);
     }
 }
Esempio n. 15
0
        // --------------------------------------------------------------------
        // 楽曲情報・番組情報をインポート(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;
        }
Esempio n. 16
0
        public void CSVファイルの有無を確認し存在するならtrueを返す(bool expectedValue)
        {
            //CSVの初期化
            startProcess.TestStartingBeforeOperation_ElemetsCountIs_7();
            var CM       = new CsvManager();
            var decision = CM.IsExistsCsv();

            Assert.AreEqual(expectedValue, decision);
        }
Esempio n. 17
0
 void requestStop()
 {
     workTriggerBtn.Enabled = false;
     workTriggerBtn.Text    = "Pending stop";
     status = WorkStatus.PendingStop;
     currentProgressBar.Style = ProgressBarStyle.Marquee;
     CsvManager.CancelOperation();
     mainBackgroundWorker.CancelAsync();
 }
Esempio n. 18
0
 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);
 }
Esempio n. 19
0
        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);
        }
Esempio n. 20
0
        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);
        }
Esempio n. 21
0
        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);
        }
Esempio n. 23
0
        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();
            });
        }
Esempio n. 24
0
        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);
        }
Esempio n. 25
0
        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);
        }
Esempio n. 26
0
    // 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);
    }
Esempio n. 27
0
        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);
        }
Esempio n. 28
0
        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);
        }
Esempio n. 29
0
        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);
            }
        }
Esempio n. 30
0
    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);
            }
        }
    }
Esempio n. 31
0
	// 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 );
	}