private SelectItemsResponse SelectItems(SelectTypes type, bool multiple) { SelectItemsRequestArgs args = new SelectItemsRequestArgs(type); args.Multiple = multiple; if (type == SelectTypes.Area) { if (ctlItemZFilter.UseMaxZ) { args.UseMaxZ = true; args.MaxZ = ctlItemZFilter.MaxZ; } if (ctlItemZFilter.UseMinZ) { args.UseMinZ = true; args.MinZ = ctlItemZFilter.MinZ; } } _lastResponse = null; ItemSelector selector = new ItemSelector(); selector.OnSelection += new ItemSelector.ItemsSelectedtEvent(OnSelection); // wait for the extract to complete selector.SelectItems(args, true); WaitForSelection(); selector.OnSelection -= new ItemSelector.ItemsSelectedtEvent(OnSelection); return(_lastResponse); }
private static void GetPickInput(out SelectTypes type, out int row, out int column) { type = SelectTypes.BadInput; while (type == SelectTypes.BadInput) { Console.Write("Please Enter (P)ick, (M)ark, or (C)lear: "); var ch = Console.ReadKey().KeyChar.ToString(); Console.WriteLine(); type = ch.ToLower() switch { "p" => SelectTypes.PickSquare, "m" => SelectTypes.MarkSquare, "c" => SelectTypes.ClearMark, _ => type }; if (type == SelectTypes.BadInput) { Console.WriteLine("Please Enter P, M, or C."); } } row = GetRowColumnInput(true); column = GetRowColumnInput(false); }
public static GremlinQuery Select(this GremlinQuery queryBase, SelectTypes selectType, params string[] items) { if (items.ContainsElements()) { return(new ComposedGremlinQuery(queryBase, $".select({selectType.ToString().ToLower()},{string.Join(",", items.Select(s => $"{queryBase.ComposeParameter(s)}"))})")); } return(new ComposedGremlinQuery(queryBase, $".select({selectType.ToString().ToLower()})")); }
public static IWebElement SelectElementByType(SelectTypes type, string val) { InvisibilityOfElement(By.XPath(val), val); switch (type) { case SelectTypes.Id: return(Driver.FindElement(By.Id(val))); case SelectTypes.Name: return(Driver.FindElement(By.Name(val))); case SelectTypes.XPath: return(Driver.FindElement(By.XPath(val))); default: return(Driver.FindElement(By.XPath(val))); } }
// Процедура отметки списка private void HandleList(SelectTypes selectType) { foreach (ListViewItem item in QueuelistView.Items) { if (selectType == SelectTypes.SelectAll) { item.Checked = true; } if (selectType == SelectTypes.UnselectAll) { item.Checked = false; } if (selectType == SelectTypes.InvertSelection) { item.Checked = !item.Checked; } } }
private void SelectCommon(string option, SelectTypes selectType) { var element = FindSingle(); switch (selectType) { case SelectTypes.ByValue: new SelectElement(element).SelectByValue(option); return; case SelectTypes.ByText: new SelectElement(element).SelectByText(option); return; default: throw new Exception(string.Format("Unknown select type: {0}.", selectType)); } }
private void SelectCommon(string option, SelectTypes selectType) { Element = CheckElementConditions(); Log.WriteInfo($"Выбор элемента {Description} с XPath {XPath}"); switch (selectType) { case SelectTypes.ByValue: new SelectElement(Element).SelectByValue(option); return; case SelectTypes.ByText: new SelectElement(Element).SelectByText(option); return; default: throw new Exception($"Unknown select type: {selectType}."); } }
private void SelectCommon(string option, SelectTypes selectType) { Contract.Requires(!string.IsNullOrEmpty(option)); var element = FindSingle(); Contract.Assert(element.Enabled); switch (selectType) { case SelectTypes.ByValue: new SelectElement(element).SelectByValue(option); return; case SelectTypes.ByText: new SelectElement(element).SelectByText(option); return; default: throw new Exception(string.Format("Unknown select type: {0}.", selectType)); } }
public SelectBuilder Aggregate(string path, SelectTypes type, string propertyName = null, SelectCollectionHandling selectCollectionHandling = SelectCollectionHandling.LeaveAsIs) { if (propertyName == null && path == null) { throw new Exception("if property name is not specified, a path must be supplied."); } if (propertyName == null) { propertyName = path.Split('.').LastOrDefault(); } ThrowIfUsedOrEmpty(propertyName); Parts.Add(new SelectPart { Path = path, PropertyName = propertyName, SelectType = type, SelectCollectionHandling = selectCollectionHandling }); return(this); }
internal void ChangeSelection(SelectTypes type, int rowStart, int rowEnd) { ChangeSelection(type, rowStart, rowEnd, 0, ExcelParams.Columns.Count, null); }
/// <summary> /// Select a function /// </summary> public Select(string functionIdentifier, IEnumerable <Select> functionArguments) { _type = SelectTypes.Function; _functionArguments = functionArguments; _functionIdentifier = functionIdentifier; }
/// <summary> /// Convert a select to a cql type /// </summary> public Select(Select select, CqlType cqlType) { _type = SelectTypes.Cast; _castSelect = select; _castType = cqlType; }
/// <summary> /// Select a single term /// </summary> public Select(Term term) { _type = SelectTypes.Term; _term = term; }
public Select(string columnName) { _type = SelectTypes.Column; _columnName = columnName; }
public Select() { _type = SelectTypes.Count; }
internal void ChangeSelection(SelectTypes type, int rowStart, int rowEnd, int cellStart, int cellEnd, Cell cell) { Debug.WriteLine(string.Format("select:({0},{1}) ({2} {3})", cellStart, rowStart, cellEnd, rowEnd )); if (ExcelParams.GlobalRowSelect) { if (type == SelectTypes.Multi) { rowEnd -= 1; } type = SelectTypes.Row; rowStart = rowEnd; } SelectType = type; if (CurrentEditCell != cell || (cell == null && CurrentEditCell == null)) { if (CurrentEditCell != null) CurrentEditCell.IsSelected = false; if (type == SelectTypes.Single) { CurrentEditCell = cell; if (CurrentEditCell != null) { CurrentEditCell.IsSelected = true; CellAnchor = new Point(CurrentEditCell.Col, CurrentEditCell.Row); Debug.WriteLine(string.Format("{0}, {1}", CellAnchor.X, CellAnchor.Y)); } } // Unselect Rows HighlightRows(false); startRow = null; endRow = null; if(selectControl != null) selectControl.DisableConfig(); switch (SelectType) { case SelectTypes.Single: DisplaySelectControl(cellStart, rowStart, 1, 1); break; case SelectTypes.Multi: double oldBottom = multiArea.Bottom; if (selectControl.filling) cellEnd = (int)multiArea.Right; DisplaySelectControl(cellStart, rowStart,cellEnd - cellStart, rowEnd - rowStart); if (multiArea.Height > 1 && !selectControl.filling) selectControl.DisableFill(); if ((int)multiArea.Width == 1) if (GetCell(cellStart, 0).Column.ProcessMultiCellConfig != null) selectControl.EnableConfig(); if (oldBottom != rowEnd && selectControl.filling) { fillHandler.ProcessFill(); } break; case SelectTypes.Row: if (rowStart >= ExcelParams.Rows.Count) { rowStart = ExcelParams.Rows.Count - 1; rowEnd = rowStart; } if (rowEnd <= rowStart) rowEnd = rowStart; startRow = ExcelParams.Rows[rowStart]; endRow = ExcelParams.Rows[rowEnd]; HighlightRows(true); if(CurrentEditCell != null) CurrentEditCell.rowHandler.Update(); DisplaySelectControl(0, rowStart, ExcelParams.Columns.Count, rowEnd - rowStart + 1); selectControl.DisableFill(); if (startRow == endRow) ExcelParams.RowSelected(startRow); break; case SelectTypes.None: break; default: break; } } }
public SelectItemsRequestArgs(SelectTypes type) { _SelectType = type; }
public void Select(SelectTypes type) { var cmd = new SelectCommand(); cmd.Execute(canvas, type); }
// Процедура отметки списка private void HandleList(SelectTypes selectType) { foreach (ListViewItem item in QueuelistView.Items) { if (selectType == SelectTypes.SelectAll) { item.Checked = true; } if (selectType == SelectTypes.UnselectAll) { item.Checked = false; } if (selectType == SelectTypes.InvertSelection) { item.Checked = !item.Checked; } } }