public void SetIndexingPath(IndexingPath indexingPath) { this.indexingPath = indexingPath; // init the path tbIndexingPathPath.Text = indexingPath.Path; if (indexingPath.IndexType == IndexType.Hash) { rbHash.Checked = true; } else { rbRange.Checked = true; } if (indexingPath.NumericPrecision != null) { tbNumericPrecision.Text = indexingPath.NumericPrecision.ToString(); } if (indexingPath.StringPrecision != null) { tbNumericPrecision.Text = indexingPath.StringPrecision.ToString(); } }
private void toolStripBtnExecute_Click(object sender, EventArgs e) { this.SetLoadingState(); if (string.Compare(this.currentCrudName, "Add documentCollection", true) == 0) { this.collectionToCreate.IndexingPolicy.IncludedPaths.Clear(); foreach (object item in lbIncludedPath.Items) { IndexingPath path = item as IndexingPath; this.collectionToCreate.IndexingPolicy.IncludedPaths.Add(path); } this.collectionToCreate.IndexingPolicy.ExcludedPaths.Clear(); foreach (object item in lbExcludedPath.Items) { String path = item as String; this.collectionToCreate.IndexingPolicy.ExcludedPaths.Add(path); } collectionToCreate.Id = tbCollectionId.Text; this.currentOperation(null, collectionToCreate); } else { if (!string.IsNullOrEmpty(this.tbCrudContext.SelectedText)) { this.currentOperation(this.tbCrudContext.SelectedText, this.textBoxforId.Text); } else { this.currentOperation(this.tbCrudContext.Text, this.textBoxforId.Text); } } }
private void btnEdit_Click(object sender, EventArgs e) { IndexingPath path = this.lbIncludedPath.SelectedItem as IndexingPath; IndexingPathForm dlg = new IndexingPathForm(); dlg.SetIndexingPath(path); DialogResult dr = dlg.ShowDialog(this); if (dr == DialogResult.OK) { this.lbIncludedPath.Items[this.lbIncludedPath.SelectedIndex] = path; } }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbIndexingPathPath.Text)) { MessageBox.Show("Please input the valid path"); this.DialogResult = DialogResult.None; return; } int?StringPrecision = null; if (!string.IsNullOrEmpty(tbStringPrecision.Text)) { int x; if (Int32.TryParse(tbStringPrecision.Text, out x)) { StringPrecision = x; } else { MessageBox.Show("Please input the valid precision"); this.DialogResult = DialogResult.None; return; } } int?NumericPrecision = null; if (!string.IsNullOrEmpty(tbNumericPrecision.Text)) { int x; if (Int32.TryParse(tbNumericPrecision.Text, out x)) { NumericPrecision = x; } else { MessageBox.Show("Please input the valid precision"); this.DialogResult = DialogResult.None; return; } } if (this.indexingPath == null) { this.indexingPath = new IndexingPath(); } this.indexingPath.Path = tbIndexingPathPath.Text; if (rbHash.Checked) { this.indexingPath.IndexType = IndexType.Hash; } else { this.indexingPath.IndexType = IndexType.Range; } this.indexingPath.NumericPrecision = NumericPrecision; this.indexingPath.StringPrecision = StringPrecision; }
private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbIndexingPathPath.Text)) { MessageBox.Show("Please input the valid path"); this.DialogResult = DialogResult.None; return; } int? StringPrecision = null; if (!string.IsNullOrEmpty(tbStringPrecision.Text)) { int x; if ( Int32.TryParse(tbStringPrecision.Text, out x)) { StringPrecision = x; } else { MessageBox.Show("Please input the valid precision"); this.DialogResult = DialogResult.None; return; } } int? NumericPrecision = null; if (!string.IsNullOrEmpty(tbNumericPrecision.Text)) { int x; if (Int32.TryParse(tbNumericPrecision.Text, out x)) { NumericPrecision = x; } else { MessageBox.Show("Please input the valid precision"); this.DialogResult = DialogResult.None; return; } } if (this.indexingPath == null) { this.indexingPath = new IndexingPath(); } this.indexingPath.Path = tbIndexingPathPath.Text; if (rbHash.Checked) { this.indexingPath.IndexType = IndexType.Hash; } else { this.indexingPath.IndexType = IndexType.Range; } this.indexingPath.NumericPrecision = NumericPrecision; this.indexingPath.StringPrecision = StringPrecision; }