public virtual void ReportChildDeselected(Stack <ITreeSelector <VM, T> > path) { Debug.Print("Child deselected: " + Value); path.Push(this); ParentSelector?.ReportChildDeselected(path); if (EntryHelper.IsLoaded) { //Clear child node selection. SetSelectedChild(default(T)); //And just in case if the new selected value is child of this node. /*if (RootSelector.SelectedValue != null) * LookupAsync(RootSelector.SelectedValue, * new SearchNextUsingReverseLookup<VM, T>(RootSelector.SelectedSelector), * new TreeLookupProcessor<VM, T>(HierarchicalResult.All, (hr, p, c) => * { * SetSelectedChild(c == null ? default(T) : c.Value); * return true; * }) * ).Forget();*/ //SetSelectedChild(lookupResult == null ? default(T) : lookupResult.Value); //OnPropertyChanged(nameof(IsChildSelected)); //OnPropertyChanged(nameof(SelectedChild)); } }
public virtual void ReportChildDeselected(Stack <ITreeSelector <VM, T> > path) { if (EntryHelper.IsLoaded) { //Clear child node selection. SetSelectedChild(default(T)); //And just in case if the new selected value is child of this node. if (RootSelector.SelectedValue != null) { this.LookupAsync(RootSelector.SelectedValue, new SearchNextUsingReverseLookup <VM, T>(RootSelector.SelectedSelector), new TreeLookupProcessor <VM, T>(HierarchicalResult.All, (hr, p, c) => { SetSelectedChild(c == null ? default(T) : c.Value); return(true); }) ); } //SetSelectedChild(lookupResult == null ? default(T) : lookupResult.Value); NotifyOfPropertyChanged(() => IsChildSelected); NotifyOfPropertyChanged(() => SelectedChild); } path.Push(this); if (ParentSelector != null) { ParentSelector.ReportChildDeselected(path); } }
public override string BuildGremlinQuery() { if (_value is string) { return(ParentSelector.BuildGremlinQuery() + $".has('{_hasField}', '{_value}')"); } return(ParentSelector.BuildGremlinQuery() + $".has('{_hasField}', {_value})"); }
public override bool Matches(HtmlElement element) { if (element.Parent is HtmlElement parentElement) { return(ParentSelector.Matches(parentElement) && TargetSelector.Matches(element)); } return(false); }
public void DifferentParentsAreSelected() { var pop = new Genotype[] { new Genotype(10), new Genotype(5), new Genotype(12), new Genotype(23) }; var selector = new ParentSelector(); selector.SelectParents(pop, out var parent1, out var parent2); Assert.AreNotSame(parent1, parent2); }
public override string BuildGremlinQuery() { var vertexLabel = typeof(T).GetLabel(); if (!string.IsNullOrEmpty(_edgeLabel)) { return(ParentSelector.BuildGremlinQuery() + $".in('{_edgeLabel}').has('label','{vertexLabel}')"); } return(ParentSelector.BuildGremlinQuery() + $".in().has('label','{vertexLabel}')"); }
public override string BuildGremlinQuery() { var result = ParentSelector.BuildGremlinQuery() + $".inV().has('label','{typeof(TEntity).Name}')"; if (!string.IsNullOrEmpty(_alias)) { result = result + $".as('{_alias}')"; } return(result); }
public override string BuildGremlinQuery() { var exp = _expression; if (exp == null) { throw new ArgumentException($"Expression is not valid - {_expression}"); } var prop = ((MemberExpression)exp.Body).Member.Name; return(ParentSelector.BuildGremlinQuery() + $".has('{prop}',within({_values.Aggregate(string.Empty, (acc, a) => acc + "'" + a + "',", a => a.Substring(0, a.Length - 1))}))"); }
/// <summary> /// Bubble up to TreeSelectionHelper for selection. /// </summary> /// <param name="path"></param> public virtual void ReportChildSelected(Stack <ITreeSelector <VM, T> > path) { Debug.Print("Child selected: " + Value); if (path.Any()) { _selectedValue = path.Peek().Value; OnPropertyChanged(nameof(SelectedChild)); OnPropertyChanged(nameof(IsChildSelected)); } path.Push(this); ParentSelector?.ReportChildSelected(path); }
public override string BuildGremlinQuery() { if (InsertCommand != null) { return(ParentSelector.BuildGremlinQuery() + $".addE('{Relation}').to({InsertCommand.BuildGremlinQuery()}).inV()"); } if (Selector != null) { return(ParentSelector.BuildGremlinQuery() + $".addE('{Relation}').to({Selector.BuildGremlinQuery()}).inV()"); } return(ParentSelector.BuildGremlinQuery()); }
/// <summary> /// Bubble up to TreeSelectionHelper for selection. /// </summary> /// <param name="path"></param> public virtual void ReportChildSelected(Stack <ITreeSelector <VM, T> > path) { if (path.Count() > 0) { _selectedValue = path.Peek().Value; NotifyOfPropertyChanged(() => SelectedChild); } path.Push(this); if (ParentSelector != null) { ParentSelector.ReportChildSelected(path); } }
private IHtmlContent SettingOverrideCheckboxInternal(StoreDependingSettingData data) { var fieldPrefix = HtmlHelper.ViewData.TemplateInfo.HtmlFieldPrefix; var settingKey = For.Name; if (fieldPrefix.HasValue()) { settingKey = fieldPrefix + "." + settingKey; } else if (data.RootSettingClass.HasValue() && !settingKey.StartsWith(data.RootSettingClass + '.', StringComparison.OrdinalIgnoreCase)) { settingKey = data.RootSettingClass + '.' + settingKey; } var overrideForStore = data.OverrideSettingKeys.Contains(settingKey); var fieldId = settingKey.EnsureEndsWith("_OverrideForStore"); var switchLabel = new TagBuilder("label"); switchLabel.AppendCssClass("switch switch-blue multi-store-override-switch"); var overrideInput = new TagBuilder("input"); overrideInput.Attributes["class"] = "multi-store-override-option"; overrideInput.Attributes["type"] = "checkbox"; overrideInput.Attributes["id"] = fieldId; overrideInput.Attributes["name"] = fieldId; overrideInput.Attributes["onclick"] = "Smartstore.Admin.checkOverriddenStoreValue(this)"; overrideInput.Attributes["data-parent-selector"] = ParentSelector.EmptyNull(); if (overrideForStore) { overrideInput.Attributes["checked"] = "checked"; } var toggleSpan = new TagBuilder("span"); toggleSpan.AppendCssClass("switch-toggle"); toggleSpan.Attributes.Add("data-on", T("Common.On").Value.Truncate(3)); toggleSpan.Attributes.Add("data-off", T("Common.Off").Value.Truncate(3)); switchLabel.InnerHtml.AppendHtml(overrideInput); switchLabel.InnerHtml.AppendHtml(toggleSpan); return(switchLabel); }
public override string BuildGremlinQuery() { string result; var vertexLabel = typeof(TEntity).GetLabel(); if (!string.IsNullOrEmpty(_edgeLabel)) { result = ParentSelector.BuildGremlinQuery() + $".out('{_edgeLabel}').has('label','{vertexLabel}')"; } else { result = ParentSelector.BuildGremlinQuery() + $".out().has('label','{vertexLabel}')"; } if (!string.IsNullOrEmpty(_alias)) { result += $".as('{_alias}')"; } return(result); }
public override string BuildGremlinQuery() { var vertexLabel = typeof(T).GetLabel(); return(ParentSelector.BuildGremlinQuery() + $".out('{_relation}').hasLabel('{vertexLabel}')"); }
public override string BuildGremlinQuery() { var value = ExpressionEvaluator.Evaluate(_expression.Body); return(ParentSelector.BuildGremlinQuery() + value); }
public override string BuildGremlinQuery() { return(ParentSelector.BuildGremlinQuery() + $".out('{_relation}')"); }
public override string BuildGremlinQuery() { return(ParentSelector.BuildGremlinQuery() + $".in().has('label','{typeof(T).Name}')"); }
public override string BuildGremlinQuery() { var select = $".select(" + GetSelectors() + ")"; return(ParentSelector.BuildGremlinQuery() + select); }
public override string BuildGremlinQuery() { return(ParentSelector.BuildGremlinQuery() + $".out('{_relation}').hasLabel('{typeof(T).Name}')"); }