public GridVector Measure(GridMeasure available, GridLayoutModel model) { var row = RowIndex.From(1); var column = ColumnIndex.From(1); return(GridVector.Create(row, column)); }
protected string Call(string functionName, params string[] parameters) { var parametersWithPath = new List <string>(); if (GridPath != null) { parametersWithPath.Add(GridPath); parametersWithPath.Add(RowIndex.ToString()); } parametersWithPath.Add(Path); parametersWithPath.AddRange(parameters); const int maxRetry = 10; const int sleepInterval = 500; for (var i = 0; i < maxRetry; i++) { try { return(Silvernium.Call(functionName, parametersWithPath.ToArray())); } catch (SeleniumException) { if (i < maxRetry) { Thread.Sleep(sleepInterval); } else { throw; } } } return(null); }
public static RowIndex CreateRowIndex(int ID) { RowIndex rowIndex = new RowIndex(); rowIndex.Id = ID; return(rowIndex); }
/// <summary> /// Returns a standard textual representation of the cell. /// </summary> public override string ToString() { return ("DataGridViewNumericUpDownCell { ColumnIndex=" + ColumnIndex.ToString(CultureInfo.CurrentCulture) + ", RowIndex=" + RowIndex.ToString(CultureInfo.CurrentCulture) + " }"); }
public static IServiceCollection AddIndex <TEntity>( this IServiceCollection serviceCollection, string name, Action <IRowIndex <TEntity> > configIndex) => serviceCollection.AddScoped <IRowIndex <TEntity> >(p => { var rowIndex = new RowIndex <TEntity>(name); configIndex(rowIndex); return(rowIndex); });
public IEnumerator <Row> GetEnumerator() { // Ensure the row list is up to date. EnsureRowIndexListCurrent(); var enumerator = RowIndex.GetEnumerator(); return(new RowEnumerator(this, enumerator)); }
public override int GetHashCode() { int hashCode = 1713590872; hashCode = hashCode * -1521134295 + SheetIndex.GetHashCode(); hashCode = hashCode * -1521134295 + RowIndex.GetHashCode(); hashCode = hashCode * -1521134295 + CellIndex.GetHashCode(); return(hashCode); }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode() { int hash = 17; hash = (hash * 23) + ColumnIndex.GetHashCode(); hash = (hash * 23) + RowIndex.GetHashCode(); hash = (hash * 23) + State.GetHashCode(); return(hash); }
protected override string FormatWithPropsInternal(ReferenceProperties props) { var realProps = (Properties)props; string rowString = RowIndex.ToString(CultureInfo.InvariantCulture); string colString = ColumnIndex2Label(ColumnIndex); string rowAbsolute = GetAbsoluteString(realProps.RowAbsolute); string colAbsolute = GetAbsoluteString(realProps.ColumnAbsolute); return(string.Concat(colAbsolute, colString, rowAbsolute, rowString)); }
public bool Equals(Token other) { //Check whether the compared object is null. if (ReferenceEquals(other, null)) return false; //Check whether the compared object references the same data. if (ReferenceEquals(this, other)) return true; //Check whether the products' properties are equal. return Value.Equals(other.Value) && ColIndex.Equals(other.ColIndex) && RowIndex.Equals(other.RowIndex) && Type.Equals(other.Type); }
public Лом(RowIndex index) { _index = index; _table = _paramsMdb.Reader.FetchTable(Lomdata); Mn = ReadValue("Mn"); Si = ReadValue("Si"); P = ReadValue("P"); S = ReadValue("S"); C = ReadValue("С"); Part = ReadValue("Доля лома"); }
void Initialize() { _inner.CellClick += (sender, ev) => { var row = RowIndex.From(ev.RowIndex); var column = ColumnIndex.From(ev.ColumnIndex); var index = GridVector.Create(row, column); foreach (var elementKey in _layoutModel.Locate(index)) { var vCell = _lastGrid.FindCell(elementKey); if (vCell == null) { continue; } var action = vCell.Attributes["A_ON_CLICK"] as Action; if (action == null) { continue; } _dispatch(vCell.ElementKey, action); } }; _inner.CellValueChanged += (sender, ev) => { var row = RowIndex.From(ev.RowIndex); var column = ColumnIndex.From(ev.ColumnIndex); var index = GridVector.Create(row, column); foreach (var elementKey in _layoutModel.Locate(index)) { var vCell = _lastGrid.FindCell(elementKey); if (vCell == null) { continue; } var action = vCell.Attributes["A_ON_CHANGED"] as Action <object>; if (action == null) { continue; } var value = _inner.Rows[row.Row].Cells[column.Column].Value; _dispatch(vCell.ElementKey, () => action(value)); } }; }
public static void WriteToBuffer(this IEnumerable <IStatistics> statistics, Stream outputStream) { var indexes = new RowIndex(); foreach (var stats in statistics) { var indexEntry = new RowIndexEntry(); stats.FillPositionList(indexEntry.Positions); stats.FillColumnStatistics(indexEntry.Statistics); indexes.Entry.Add(indexEntry); } StaticProtoBuf.Serializer.Serialize(outputStream, indexes); }
protected override void Execute(CodeActivityContext context) { DataRow dataRow = DataRow.Get(context); Int32 rowIndex = RowIndex.Get(context); if (dataRow == null) { DataTable.Get(context).Rows.RemoveAt(rowIndex); } else { DataTable.Get(context).Rows.Remove(dataRow); } }
void InitCommandButton(DataControlFieldCell cell, string cmd, string text) { LinkButton lnkbttn = new LinkButton(); lnkbttn.DataBinding += new EventHandler(lnkbttn_DataBinding); lnkbttn.Text = text; lnkbttn.CommandName = cmd; lnkbttn.CommandArgument = RowIndex.ToString(); cell.Controls.Add(lnkbttn); if (cmd.ToLower() == "delete") { lnkbttn.OnClientClick = "return window.confirm('您确定删除本记录吗?')"; } }
protected override void OnUpdateColumn(out FrameworkElement oldElement) { var outlineWrappers = (spreadsheet.ActiveSheet as WorksheetImpl).OutlineWrappers; foreach (var item in outlineWrappers) { if (RowIndex.Equals(item.FirstIndex - 1)) { this.CellItemTemplate = spreadsheet.Resources["CellTemplateKey"] as DataTemplate; //this.CellEditTemplate = Application.Current.Resources["CellTemplateKey"] as DataTemplate; } } base.OnUpdateColumn(out oldElement); }
public void SaveAs(XmlDocument xml, XmlElement parent, bool create, Property.DataOutputFlags flags) { XmlElement self = create ? null : Self; if (null == self) { self = xml.CreateElement("bean"); parent.AppendChild(self); if (false == create) { Self = self; } } if (flags == Property.DataOutputFlags.All) { self.SetAttribute("DefineFullName", DefineFullName); } if (RowIndex >= 0) { self.SetAttribute("row", RowIndex.ToString()); } // 使用 DefineFullName 找到 BeanDefine。慢的话,可以加cache优化速度。 BeanDefine beanDefine = Document.BeanDefine; if (false == string.IsNullOrEmpty(DefineFullName)) { beanDefine = FormMain.Instance.Documents.SearchReference(DefineFullName); } foreach (var varDefine in beanDefine.Variables) { if (0 == (varDefine.DataOutputFlags & flags)) { continue; } if (VariableMap.TryGetValue(varDefine.Name, out var varData)) { varDefine.DetectType(varData.Value); varData.SaveAs(xml, self, create, flags); } else { varDefine.DetectType(""); } } }
protected override async Task <Action <AsyncCodeActivityContext> > ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken) { // Inputs var gridid = GridID.Get(context); var rowindex = RowIndex.Get(context); var columnid = ColumnID.Get(context); /////////////////////////// // Add execution logic HERE SAPAuto objSAPAuto = new SAPAuto(); objSAPAuto.Grid_SelectCell_AndDoubleClick(gridid, rowindex, columnid); /////////////////////////// // Outputs return((ctx) => { }); }
protected override async Task <Action <AsyncCodeActivityContext> > ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken) { // Inputs var gridid = GridID.Get(context); var rowindex = RowIndex.Get(context); var columnid = ColumnID.Get(context); /////////////////////////// // Add execution logic HERE SAPAuto objSAPAuto = new SAPAuto(); context.SetValue(CellValue, objSAPAuto.Grid_GetCellValue(gridid, rowindex, columnid)); /////////////////////////// // Outputs return((ctx) => { CellValue.Set(ctx, null); }); }
private void EnsureRowIndexListCurrent() { int rebuildIndex = rowListRebuild; int journalCount = EventRegistry.EventCount; while (rebuildIndex < journalCount) { var command = EventRegistry.GetEvent(rebuildIndex); if (command is TableRowEvent) { var rowEvent = (TableRowEvent)command; var index = rowEvent.RowNumber; if (rowEvent.EventType == TableRowEventType.Add || rowEvent.EventType == TableRowEventType.UpdateAdd) { // Add to 'row_list'. if (!RowIndex.UniqueInsertSort(index)) { throw new InvalidOperationException(String.Format("Row index already used in this table ({0})", index)); } } else if (rowEvent.EventType == TableRowEventType.Remove || rowEvent.EventType == TableRowEventType.UpdateRemove) { // Remove from 'row_list' if (!RowIndex.RemoveSort(index)) { throw new InvalidOperationException("Row index removed that wasn't in this table!"); } } else { throw new InvalidOperationException(String.Format("Table row event type {0} is invalid.", rowEvent.EventType)); } } ++rebuildIndex; } // It's now current (row_list_rebuild == journal_count); rowListRebuild = rebuildIndex; }
protected override void OnUpdateColumn(out FrameworkElement oldElement) { var outlineWrappers = (spreadsheet.ActiveSheet as WorksheetImpl).OutlineWrappers; foreach (var item in outlineWrappers) { if (RowIndex.Equals(item.FirstIndex - 1)) { foreach (var window in System.Windows.Application.Current.Windows) { if (window != null && window is ChromelessWindow) { this.CellItemTemplate = (window as ChromelessWindow).Resources["CellTemplateKey"] as DataTemplate; } } } } base.OnUpdateColumn(out oldElement); }
public int CompareTo(ICellInformation other) { // todo testing if (RowIndex.CompareTo(other.RowIndex) == 0 && ColumnIndex.CompareTo(other.ColumnIndex) == 0 && Status.CompareTo(other.Status) == 0 && NeighboursAlive.CompareTo(other.NeighboursAlive) == 0) { return(0); } double distanceThis = DistanceFromOrigin(); double distanceOther = other.DistanceFromOrigin(); if (distanceThis < distanceOther) { return(-1); } return(1); }
public override void CustomTestInitialize() { var contextWrapper = this.CreateContext(); // Restore the type name resolver since we will be writing open complex properties. contextWrapper.ResolveName = this.typeNameResolver; contextWrapper.AddObject("Row", row1); contextWrapper.AddObject("Row", row2); var rowIndex = new RowIndex { Id = TestRowIndexId, Rows = new DataServiceCollection <IndexedRow>(contextWrapper.Context), IndexComments = "This is a test", }; rowIndex.Rows.Add(row3); contextWrapper.AddObject("RowIndex", rowIndex); contextWrapper.SaveChanges(SaveChangesOptions.BatchWithSingleChangeset); }
/// <summary> /// Returns a standard textual representation of the cell. /// </summary> public override string ToString() { return(string.Format("DataGridViewMultiColumnComboBoxCell {{ ColumnIndex={0}, RowIndex={1} }}", ColumnIndex.ToString(CultureInfo.CurrentCulture), RowIndex.ToString(CultureInfo.CurrentCulture))); }
/// <summary> /// Returns a standard textual representation of the cell. /// </summary> public override string ToString() { return("DataGridViewMaskedTextBoxCell { ColumnIndex=" + ColumnIndex.ToString(CultureInfo.CurrentCulture) + ", RowIndex=" + RowIndex.ToString(CultureInfo.CurrentCulture) + " }"); }
/// <summary> /// Returns a standard textual representation of the cell. /// </summary> public override string ToString() { return ($"KryptonDataGridViewDateTimePickerCell {{ ColumnIndex={ColumnIndex.ToString(CultureInfo.CurrentCulture)}, RowIndex={RowIndex.ToString(CultureInfo.CurrentCulture)} }}"); }
/// <summary> /// Returns a standard textual representation of the cell. /// </summary> public override string ToString() { return("KryptonDataGridViewBinaryCell { ColumnIndex=" + ColumnIndex.ToString(CultureInfo.CurrentCulture) + ", RowIndex=" + RowIndex.ToString(CultureInfo.CurrentCulture) + " }"); }
public override int GetHashCode() { return(Column.GetHashCode() + RowIndex.GetHashCode()); }
public override string ToString() { return("TNumEditDataGridViewCell { ColIndex=" + ColumnIndex.ToString(CultureInfo.CurrentCulture) + ", RowIndex=" + RowIndex.ToString(CultureInfo.CurrentCulture) + " }"); }
public override string ToString() { return("DataGridViewRowHeaderCell { RowIndex=" + RowIndex.ToString(CultureInfo.CurrentCulture) + " }"); }
public void AddToRowIndex(RowIndex rowIndex) { base.AddObject("RowIndex", rowIndex); }
public static RowIndex CreateRowIndex(int ID) { RowIndex rowIndex = new RowIndex(); rowIndex.Id = ID; return rowIndex; }