本文整理汇总了C#中ISelectable.Select方法的典型用法代码示例。如果您正苦于以下问题:C# ISelectable.Select方法的具体用法?C# ISelectable.Select怎么用?C# ISelectable.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISelectable
的用法示例。
在下文中一共展示了ISelectable.Select方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeSelection
public void ChangeSelection(ISelectable newOne)
{
if (selected != null) selected.DeSelect();
selected = newOne;
selected.Select();
//Debug.Log("Is Selected null? " + ((selected == null).ToString()));
if (selected is ExtractiveHouse)
{
RedrawExtractivePanel();
((House)selected).someChanges += RedrawExtractivePanel;
}
if (selected is ProcessHouse)
{
RedrawProcessPanel();
((House)selected).someChanges += RedrawProcessPanel;
}
else if (selected is Store) {
RedrawStorePanel();
((Store)selected).someChanges += RedrawStorePanel;
}
}
示例2: Select
private void Select(ISelectable selectable)
{
if (lastSelected != null)
lastSelected.Unselect();
if (selectable != null)
{
if (lastSelected != selectable)
{
selectable.Select();
lastSelected = selectable;
}
else
{
selectable.Unselect();
lastSelected = null;
}
}
}
示例3: selectItem
private void selectItem(ISelectable item)
{
if (item == null) throw new ArgumentNullException("item");
if (!item.IsSelected)
{
item.Select();
}
}
示例4: flipSelectionState
private void flipSelectionState(ISelectable item)
{
if (item.IsSelected)
{
item.DeSelect();
}
else
{
item.Select();
}
}
示例5: SetSelected
/// <summary>
/// Implements the setter for SelectedItemVisual.
/// </summary>
/// <param name="selected"></param>
void SetSelected(ISelectable selected)
{
// deselect existing item
if (Selected != null &&
selected == null)
Selected.Deselect(UIBinding);
// select new item
if (selected != null &&
selected != Selected)
selected.Select(UIBinding);
}
示例6: ExtractField
private dynamic ExtractField(ISelectable item, Page page, DataToken field, int index)
{
ISelector selector = SelectorUtil.Parse(field.Selector);
if (selector == null)
{
return null;
}
var f = field as Field;
List<Formatter.Formatter> formatters = GenerateFormatter(f?.Formatters);
bool isEntity = field is Entity;
if (!isEntity)
{
string tmpValue;
if (selector is EnviromentSelector)
{
var enviromentSelector = selector as EnviromentSelector;
tmpValue = GetEnviromentValue(enviromentSelector.Field, page, index);
foreach (var formatter in formatters)
{
tmpValue = formatter.Formate(tmpValue);
}
return tmpValue;
}
else
{
bool needPlainText = (((Field)field).Option == PropertyExtractBy.ValueOption.PlainText);
if (field.Multi)
{
var propertyValues = item.SelectList(selector).Nodes();
List<string> results = new List<string>();
foreach (var propertyValue in propertyValues)
{
string tmp = propertyValue.GetValue(needPlainText);
foreach (var formatter in formatters)
{
tmp = formatter.Formate(tmp);
}
results.Add(tmp);
}
return new JArray(results);
}
else
{
bool needCount = (((Field)field).Option == PropertyExtractBy.ValueOption.Count);
if (needCount)
{
var propertyValues = item.SelectList(selector).Nodes();
return propertyValues != null ? propertyValues.Count.ToString() : "-1";
}
else
{
tmpValue = item.Select(selector)?.GetValue(needPlainText);
tmpValue = formatters.Aggregate(tmpValue, (current, formatter) => formatter.Formate(current));
return tmpValue;
}
}
}
}
else
{
if (field.Multi)
{
var propertyValues = item.SelectList(selector).Nodes();
JArray objs = new JArray();
var selectables = item.SelectList(selector).Nodes();
foreach (var selectable in selectables)
{
JObject obj = new JObject();
foreach (var child in ((Entity)field).Fields)
{
obj.Add(child.Name, ExtractField(selectable, page, child, 0));
}
objs.Add(obj);
}
return objs;
}
else
{
JObject obj = new JObject();
var selectable = item.Select(selector);
foreach (var child in ((Entity)field).Fields)
{
obj.Add(child.Name, ExtractField(selectable, page, field, 0));
}
return obj;
}
}
}