public static void ForwardToServer(DataSetTuple dataSetTuple) { try { File.AppendAllText(ApplicationSettings.Instance.ServerInputLinkFile, dataSetTuple.ToString() + "\r\n"); } catch (Exception exception) { WindowsHelperMethods.ShowExceptionMessage(exception, "بروز خطا هنگام ثبت در فایل سرور"); } }
private void buttonLoad_Click(object sender, EventArgs e) { try { ApplicationSettings.Instance.LoadFilePath = textBoxLoadPath.Text; int tuplesCount = StoneHandler.LoadDataSet(textBoxLoadPath.Text); WindowsHelperMethods.ShowInformationMessage("فایل DataSet با {0} Tuple موفقیت آمیز خوانده شد.", tuplesCount); } catch (Exception exception) { HandleUIException(exception, "Error when loading dataset file."); } }
private void buttonGenerate_Click(object sender, EventArgs e) { try { ApplicationSettings.Instance.GenerateFilePath = textBoxGeneratePath.Text; int tuplesCount = StoneHandler.GenerateDataSet(textBoxGeneratePath.Text); WindowsHelperMethods.ShowInformationMessage("فایل DataSet با {0} Tuple موفقیت آمیز ایجاد گردید.", tuplesCount); } catch (Exception exception) { HandleUIException(exception, "بروز خطا هنگام ایجاد فایل DataSet."); } }
private void buttonRun_Click(object sender, EventArgs e) { try { HelperClasses.TimeTools timer = new HelperClasses.TimeTools(); timer.Start(); StoneHandler.Run(); timer.Stop(); WindowsHelperMethods.ShowInformationMessage("عملیات با موفقیت خاتمه یافت. زمان اجرا : {0} ثانیه.", timer.StringEllapsedTime); } catch (Exception exception) { HandleUIException(exception, "بروز خطا هنگام اجرای Stone."); } }
void LibraryDataGrid_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } var text = this.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); int maxSize = 5000; if (text.Length > maxSize) { text = text.Remove(maxSize); text += "..."; } WindowsHelperMethods.ShowInformationMessage(text); }
private void buttonConvert_Click(object sender, EventArgs e) { try { ApplicationSettings.Instance.ConvertFromPath = textBoxConvertFromPath.Text; ApplicationSettings.Instance.ConvertToPath = textBoxConvertToPath.Text; ApplicationSettings.Instance.ConvertReportPath = textBoxConvertReportPath.Text; HelperClasses.TimeTools timer = new HelperClasses.TimeTools(); timer.Start(); var inputPath = textBoxConvertFromPath.Text; var outputPath = textBoxConvertToPath.Text; var reportPath = textBoxConvertReportPath.Text; DataSetConverter.Convert(inputPath, outputPath, reportPath); timer.Stop(); WindowsHelperMethods.ShowInformationMessage("عملیات با موفقیت خاتمه یافت. زمان اجرا : {0} ثانیه.", timer.StringEllapsedTime); } catch (Exception exception) { HandleUIException(exception, "بروز خطا هنگام تبدیل فایل ورودی."); } }
private void buttonRun_Click(object sender, EventArgs e) { //BinaryMemory bm = new BinaryMemory(); //var s = DateTime.Now; //bm.Add(1); //bm.Add(22); //bm.Add(333); //bm.Store(4444); //bm.Store(55555); //bm.Store(666666); //bm.Store(7777777); //bm.Store(88888888); //var st = (DateTime.Now - s).TotalMilliseconds; //MessageBox.Show("Stored in " + st); //s = DateTime.Now; //var r = bm.RetrieveItems(); //st = (DateTime.Now - s).TotalMilliseconds; //MessageBox.Show("Retrieved in " + st); //MessageBox.Show(bm.Contains(3333).ToString()); //r.ForEach(x => MessageBox.Show(x.ToString())); //return; try { HelperClasses.TimeTools timer = new HelperClasses.TimeTools(); timer.Start(); StoneHandler.Run(); timer.Stop(); WindowsHelperMethods.ShowInformationMessage("عملیات با موفقیت خاتمه یافت. زمان اجرا : {0} ثانیه.", timer.StringEllapsedTime); } catch (Exception exception) { HandleUIException(exception, "بروز خطا هنگام اجرای Stone."); } }
private static void HandleUIException(Exception exception, string message) { WindowsHelperMethods.ShowExceptionMessage(exception, message); }
private static void HandleUIException(Exception exception, string message) { WindowsHelperMethods.ShowExceptionMessage(exception, "بروز خطا هنگام ایجاد فایل DataSet."); }