/// <summary> /// recupere la reference du premier placement selectionné dans les placements a copuper /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AfterSend_Click_1(object sender, EventArgs e) { AF_JOHN_DEERE.JohnDeere_DoOnAction_AfterSendToWorkshop doonaction = new JohnDeere_DoOnAction_AfterSendToWorkshop(); string stage = "_TO_CUT_NESTING"; JohnDeere_Param.GetlistParam(_Context); IEntitySelector nestingselector = null; nestingselector = new EntitySelector(); //entity type pointe sur la list d'objet du model nestingselector.Init(_Context, _Context.Kernel.GetEntityType(stage)); nestingselector.MultiSelect = true; if (nestingselector.ShowDialog() == System.Windows.Forms.DialogResult.OK) { foreach (IEntity selection in nestingselector.SelectedEntity) { string filename = selection.GetFieldValueAsString("_REFERENCE"); string material = selection.GetFieldValueAsEntity("_MATERIAL").GetFieldValueAsString("_NAME"); IEntityList nestinglist = _Context.EntityManager.GetEntityList(stage, "_REFERENCE", ConditionOperator.Equal, filename); nestinglist.Fill(false); doonaction.execute(nestinglist); } } }
private void AfterSendToWorkshop_Click(object sender, EventArgs e) { //IEntity TO_CUT_nesting; AF_Clipper_Dll.Clipper_DoOnAction_AfterSendToWorkshop doonaction = new Clipper_DoOnAction_AfterSendToWorkshop(); string stage = "_TO_CUT_NESTING"; //creation du fichier de sortie //recupere les path Clipper_Param.GetlistParam(_Context); IEntitySelector nestingselector = null; nestingselector = new EntitySelector(); //entity type pointe sur la list d'objet du model nestingselector.Init(_Context, _Context.Kernel.GetEntityType(stage)); nestingselector.MultiSelect = true; if (nestingselector.ShowDialog() == System.Windows.Forms.DialogResult.OK) { foreach (IEntity nesting in nestingselector.SelectedEntity) { doonaction.execute(nesting); } } // doonaction.execute(_Context, TO_CUT_nesting); }
public async Task <CustomEntityTags> GetTagsAsync(EntitySelector entitySelector, Timeframe from = null, Timeframe to = null, CancellationToken cancellationToken = default) { var queryParamValues = new Dictionary <string, object>(); if (entitySelector is not null) { queryParamValues.Add(nameof(entitySelector), entitySelector.ToString()); } if (from is not null) { queryParamValues.Add(nameof(from), from.ToString()); } if (to is not null) { queryParamValues.Add(nameof(to), to.ToString()); } var response = await GetCustomTagsUrl() .SetQueryParams(queryParamValues) .GetJsonIfNotEmptyAsync(new CustomEntityTags(), cancellationToken) .ConfigureAwait(false); return(response); }
public void DamageEntity() { EntitySelector.GetSelectedEntity().GetComponent <BattleEntity>().Damage(hitpts); BattleManager.battleState = BattleManager.BattleState.EntityTurn; // Need to call StartBattle(); BattleManager.GetScript().StartBattle(); Destroy(transform.parent.gameObject); }
string Tp() { if (c1.IsChecked == true) { return("/tp " + EntitySelector.GetEntity() + " " + tp_tar.Text); } else { string destination = ""; string rotation = ""; if (tp_tilde.IsChecked == true) { destination = "~" + LocX_tp.Text + " ~" + LocY_tp.Text + " ~" + LocZ_tp.Text; } else { destination = LocX_tp.Text + " " + LocY_tp.Text + " " + LocZ_tp.Text; } if (tiled_angle.IsChecked == true) { rotation = "~" + xrot.Value + " ~" + yrot.Value; } else { rotation = xrot.Value + " " + yrot.Value; } return("/tp " + EntitySelector.GetEntity() + " " + destination + " " + rotation); } }
private void Awake() { Instance = this; cam = Camera.main; clickReceiver.onLeftClick.AddListener(TrySelectSingleEntity); dragReceiver.onBeginDrag.AddListener(StartSelectionBoxRoutine); }
private void MeAdd_Click(object sender, RoutedEventArgs e) { int i = me.SelectionStart; string txt = " " + EntitySelector.GetEntity() + " "; me.SelectionLength = 0; me.SelectedText = txt; }
public EntityDefine() { Type = typeof(T); var typeName = Type.GetTypeCrossPlatform().FullName; Name = typeName; TableInfo = Type.GetCustomAttribute <EntityTable>(); if (TableInfo != null) { if (TableInfo.Indexs != null) { TableInfo.Indexs = new HashSet <string>(TableInfo.Indexs.Select(i => i.Replace(" ", ""))).ToArray(); } if (TableInfo.Uniques != null) { TableInfo.Uniques = new HashSet <string>(TableInfo.Uniques.Select(i => i.Replace(" ", ""))).ToArray(); } } EntitySelector entitySelector = Type.GetCustomAttribute <EntitySelector>(); if (entitySelector != null) { Multi = true; Take = entitySelector.Take; Selector = new BaseSelector { Expression = entitySelector.Expression, Type = entitySelector.Type }; } else { Multi = false; } var targetUrlsSelectors = Type.GetCustomAttributes <TargetUrlsSelector>(); TargetUrlsSelectors = targetUrlsSelectors.ToList(); var sharedValueSelectorAttributes = Type.GetCustomAttributes <SharedValueSelector>(); if (sharedValueSelectorAttributes != null) { SharedValues = sharedValueSelectorAttributes.Select(e => new SharedValueSelector { Name = e.Name, Expression = e.Expression, Type = e.Type }).ToList(); } else { SharedValues = new List <SharedValueSelector>(); } GenerateEntityColumns(); ValidateEntityDefine(); }
public void ConvertToString() { var entitySelector = new EntitySelector { HealthState = HealthStates.Unhealthy }; string s = entitySelector.ToString(); Assert.NotNull(s); Assert.Equal("healthState(\"UNHEALTHY\")", s); }
public async Task <AddedEntityTags> AssignTagsAsync(EntitySelector entitySelector, AddEntityTags body, CancellationToken cancellationToken = default) { var response = await GetCustomTagsUrl() .SetQueryParam(nameof(entitySelector), entitySelector.ToString()) .PostJsonAsync(body, cancellationToken) .ReceiveJsonWithErrorChecking <AddedEntityTags>() .ConfigureAwait(false); return(response); }
private async void SelectEntity(IEntity entity) { dynamic controller = EntityRouter.Routers.GetController(Metadata.ClrType); EntitySelector selector = await controller.GetSelector(); if (selector.ShowDialog() == true) { CurrentValue = selector.SelectedEntity; } }
public override void UnloadContent() { EntitySelector.Deselect(); EntitySelector.PlaceEntity(); this.active = false; this.updateThread.Abort(); this.SendUpdate(); UsersManager.LogoutCurrentUser(); UsersManager.CurrentPlayer = null; ModelsManager.Instance.DisposeAll(); }
private IEntity SelectEntity_If_Not_Exported(string entitystage) { IEntity selectedentity = null; IEntitySelector xselector = null; xselector = new EntitySelector(); //GPAO_Exported //_Context.EntityManager.GetEntityList("_CLOSED_NESTING"entitystage, "GPAO_Exported", ConditionOperator.Equal, null); IEntityList GPAO_Exported_filter = _Context.EntityManager.GetEntityList(entitystage, "GPAO_Exported", ConditionOperator.Equal, null); GPAO_Exported_filter.Fill(false); _Context.EntityManager.GetExtendedEntityList(entitystage, GPAO_Exported_filter); IExtendedEntityList exported_nestings = _Context.EntityManager.GetExtendedEntityList(entitystage, GPAO_Exported_filter); exported_nestings.Fill(false); if (exported_nestings.Count == 0) { //_Context.EntityManager.GetEntityList("_CLOSED_NESTING"entitystage, "GPAO_Exported", ConditionOperator.Equal, false); GPAO_Exported_filter = _Context.EntityManager.GetEntityList(entitystage, "GPAO_Exported", ConditionOperator.Equal, false); GPAO_Exported_filter.Fill(false); // _Context.EntityManager.GetExtendedEntityList("_CLOSED_NESTING"entitystage, GPAO_Exported_filter); exported_nestings = _Context.EntityManager.GetExtendedEntityList(entitystage, GPAO_Exported_filter); exported_nestings.Fill(false); } xselector.Init(_Context, exported_nestings);//"_TO_CUT_NESTING" xselector.MultiSelect = true; if (xselector.ShowDialog() == System.Windows.Forms.DialogResult.OK) { foreach (IEntity xentity in xselector.SelectedEntity) { selectedentity = xentity; } } return(selectedentity); /* * else * { * xselector.Init(_Context, _Context.Kernel.GetEntityType(entitytype));//"_TO_CUT_NESTING" * xselector.MultiSelect = true; * * }*/ }
public static void ColneToMultiText() { DBText sourText = null; DBText[] targetTexts = null; var doc = Application.DocumentManager.MdiActiveDocument; var peo = new PromptEntityOptions("\n" + CommandStringResources.ResourceManager.GetString("SelectSourceText", GLOBAL.CurrentCulture)); peo.SetRejectMessage("\n" + CommandStringResources.ResourceManager.GetString("ObjectTypeIsNotSupported", GLOBAL.CurrentCulture)); peo.AddAllowedClass(typeof(DBText), false); var per = doc.Editor.GetEntity(peo); if (per.Status != PromptStatus.OK) { return; } var sId = per.ObjectId; using (var tr = doc.TransactionManager.StartTransaction()) { var t = tr.GetObject(sId, OpenMode.ForRead) as DBText; if (t != null) { sourText = t; } } //doc.Editor.WriteMessage("\nSource Text Content: " + sourText.TextString); targetTexts = EntitySelector.SelectMultiDbText("\nSelect Target Text(s)"); if (targetTexts == null) { return; } using (Transaction tr = doc.TransactionManager.StartTransaction()) { int index = 0; foreach (DBText t in targetTexts) { var text = tr.GetObject(t.ObjectId, OpenMode.ForWrite) as DBText; if (text != null) { text.TextString = sourText.TextString; index++; } } tr.Commit(); //doc.Editor.WriteMessage("\nCloned " + index + (index > 1 ? " Texts" : " Text")); } }
protected override void ProcessRequest() { using (OperationTracker.Create(this.logger, "Rebalancing {0} from {1} to {2}.", new object[] { this.rebalanceData.RebalanceInformation, this.rebalanceData.SourceDatabase, this.rebalanceData.TargetDatabase })) { this.logger.Log(MigrationEventType.Information, "MOVE: Moving {0} from {1} to {2}.", new object[] { this.rebalanceData.RebalanceInformation, this.rebalanceData.SourceDatabase, this.rebalanceData.TargetDatabase }); Band[] bands = this.rebalanceData.RebalanceInformation.Metrics.OfType <Band>().ToArray <Band>(); TopologyExtractorFactory entitySelectorFactory = this.serviceContext.TopologyExtractorFactoryContextPool.GetContext(this.clientFactory, bands, this.nonMovableOrgs, this.logger).GetEntitySelectorFactory(); DirectoryDatabase database = this.directoryProvider.GetDatabase(this.rebalanceData.SourceDatabase.Guid); LoadContainer container = entitySelectorFactory.GetExtractor(database).ExtractTopology(); IOperationRetryManager operationRetryManager = LoadBalanceOperationRetryManager.Create(this.logger); foreach (LoadMetric loadMetric in this.rebalanceData.RebalanceInformation.Metrics) { EntitySelector selector = loadMetric.GetSelector(container, this.rebalanceData.ConstraintSetIdentity, this.rebalanceData.RebalanceInformation[loadMetric]); if (selector.IsEmpty) { this.logger.Log(MigrationEventType.Information, "Could not find any mailbox for metric {0} in database {1}.", new object[] { loadMetric, this.rebalanceData.SourceDatabase }); } else { this.logger.Log(MigrationEventType.Information, "Found mailboxes matching the metric {0} in database {1}. Requesting the injections.", new object[] { loadMetric, this.rebalanceData.SourceDatabase }); operationRetryManager.TryRun(delegate { DirectoryDatabase database2 = (DirectoryDatabase)this.directoryProvider.GetDirectoryObject(this.rebalanceData.TargetDatabase.DirectoryObjectIdentity); using (IInjectorService injectorClientForDatabase = this.clientFactory.GetInjectorClientForDatabase(database2)) { injectorClientForDatabase.InjectMoves(this.rebalanceData.TargetDatabase.Guid, this.rebalanceData.RebalanceBatchName, selector.GetEntities(this.rebalanceData.TargetDatabase)); } }); } } } }
public static void Setup() { SetWeather(Weather.Clear); EntitySelector selector = new EntitySelector("@a") { Level = "1..5", Gamemode = 0 }; selector.Tags.Has("cool"); execute.As(selector).Run().Title(TextComponent.Of(Segment.Text("yoooo"))); RunFunction(BrettyEfes); SetBlock("~ ~ ~5", "stone"); Clone(Position.Here, "~1 ~1 ~-1", "0 1 0", MaskMode.Filtered.With("diamond_block")); Time += 500; }
public void DamageEntity() { var chancesToHit = 4; // this is the amount of chances spawned by AttackBox.cs var realHitPts = ((float)hitpts / (float)chancesToHit) * Player.GetAttackDmg(); // multiply so we can change the amount of dmg var selectedBattleEntity = EntitySelector.GetSelectedEntity().GetComponent <BattleEntity>(); selectedBattleEntity.StartCoroutine(DamageEntityPeriod(1f, selectedBattleEntity, realHitPts)); var attBox = transform.parent.GetComponent <AttackBox>(); attBox.DestroyAreas(); DestroyFeedbackItems(); Destroy(attBox.gameObject); Destroy(gameObject); }
private void ReadDetailsCommand() { if (this.details.Command == DetailCommand.PickEntity) { EntitySelector.PickEntity(this.details.Entity); this.details = null; } else if (this.details.Command == DetailCommand.GatherResource) { ((IResourceProvider)this.details.Entity).Gather(5); } else if (this.details.Command == DetailCommand.Close) { this.details = null; } }
public string GenerateCommand() { switch (menu.SelectedIndex) { case 0: return("/kill " + EntitySelector.GetEntity()); case 1: return(Spreadplayers()); case 2: return(Tp()); case 3: return(GetEffect()); case 4: return(Me()); } return(""); }
public async Task <DeletedEntityTags> DeleteTagAsync(EntitySelector entitySelector, string key, string value = null, bool?deleteAllWithKey = null, CancellationToken cancellationToken = default) { var queryParamValues = new Dictionary <string, object> { [nameof(entitySelector)] = entitySelector.ToString(), [nameof(key)] = key, [nameof(value)] = value, [nameof(deleteAllWithKey)] = deleteAllWithKey }; var response = await GetCustomTagsUrl() .SetQueryParams(queryParamValues) .DeleteAsync(cancellationToken) .ReceiveJsonWithErrorChecking <DeletedEntityTags>() .ConfigureAwait(false); return(response); }
private IEntity SelectEntity(string SelectionType) { IEntity selectedentity = null; IEntitySelector xselector = null; xselector = new EntitySelector(); xselector.Init(_Context, _Context.Kernel.GetEntityType(SelectionType));//"_TO_CUT_NESTING" xselector.MultiSelect = true; if (xselector.ShowDialog() == System.Windows.Forms.DialogResult.OK) { foreach (IEntity xentity in xselector.SelectedEntity) { selectedentity = xentity; } } return(selectedentity); }
private void Clear_Click(object sender, RoutedEventArgs e1) { string show = ""; if (showParticle.IsChecked == true) { show = " true"; } else { show = " false"; } TreeViewItem e = (TreeViewItem)effect.SelectedItem; if (e == eff1 || e == eff2 || e == eff3 || e == eff4 || e == eff5 || e == null) { CmdGenerator.AddCommand("请选择效果"); return; } CmdGenerator.AddCommand("/effect " + EntitySelector.GetEntity() + " minecraft:" + e.Name + " 0 " + level.Value + show); }
private string GetEffect() { string show = ""; if (showParticle.IsChecked == true) { show = " true"; } else { show = " false"; } TreeViewItem e = (TreeViewItem)effect.SelectedItem; if (e == eff1 || e == eff2 || e == eff3 || e == eff4 || e == eff5 || e == null) { return("请选择效果"); } return("/effect " + EntitySelector.GetEntity() + " minecraft:" + e.Name + " " + time.Value + " " + level.Value + show); }
private void CleanDead() { var markedForDestruction = UsersManager.CurrentPlayer.Units.Where(u => u.IsAlive == false).ToArray(); foreach (var unit in markedForDestruction) { this.deadUnits.Enqueue(unit); UsersManager.CurrentPlayer.Units.Remove(unit); UsersManager.CurrentPlayer.AllEntities.Remove(unit); if (EntitySelector.EntityPicked == unit || EntitySelector.EntitySelected == unit) { EntitySelector.Deselect(); EntitySelector.PlaceEntity(); } if (this.details?.Entity == unit) { this.details = null; } } }
public ReadResults Parse(out EntitySelector result) { result = default; ReadResults readResults; if (Reader.CanRead() && Reader.Peek() == '@') { Reader.Skip(); readResults = ParseSelector(); } else { readResults = ParseNameOrUuid(); } if (readResults.Successful) { result = GetSelector(); } return(readResults); }
/// <summary> /// boite de dialogue quote de selection des devis /// </summary> /// <param name="quoteNumberReference"></param> /// <returns></returns> public bool SelectQuoteUI(out long quoteNumberReference) { quoteNumberReference = -1; if (_Context != null) { IEntity quoteEntity = null; IEntitySelector entitySelector = new EntitySelector(); entitySelector.Init(_Context, _Context.Kernel.GetEntityType("_QUOTE_SENT")); entitySelector.MultiSelect = false; entitySelector.ShowPropertyBox = false; if (entitySelector.ShowDialog() == DialogResult.OK) { quoteEntity = entitySelector.SelectedEntity.FirstOrDefault(); } if (_UserOk) { _Context.SaveUserModel(); } if (quoteEntity != null) { //string quoteReference = quoteEntity.GetFieldValueAsString("_REFERENCE"); quoteNumberReference = Convert.ToInt64(quoteEntity.GetFieldValueAsString("_REFERENCE")); //quoteNumberReference = quoteEntity.Id; //long.TryParse(quoteReference, out quoteNumberReference); return(true); } else { return(false); } } else { return(false); } }
private void AfterClose_Click(object sender, EventArgs e) { AF_Clipper_Dll.Clipper_DoOnAction_After_Cutting_end doonaction = new Clipper_DoOnAction_After_Cutting_end(); //string stage = "_CLOSED_NESTING"; string stage = "_CUT_SHEET"; //creation du fichier de sortie //recupere les path Clipper_Param.GetlistParam(_Context); IEntitySelector Entityselector = null; Entityselector = new EntitySelector(); //entity type pointe sur la list d'objet du model Entityselector.Init(_Context, _Context.Kernel.GetEntityType(stage)); Entityselector.MultiSelect = true; if (Entityselector.ShowDialog() == System.Windows.Forms.DialogResult.OK) { doonaction.execute(Entityselector.SelectedEntity); } }
public static void CreateTree(StackPanel t, StackPanel realtionPanel) { var list = DataService.getTableRelationShips(); ALL_RELATIONSHIP = list; foreach (var item in list.Select(x => x.Parent_Table).Distinct()) { ToggleButton root = new ToggleButton { Content = item }; root.Height = 40; root.Margin = new System.Windows.Thickness(4, 0, 0, 4); root.Click += (s, e) => { root.Foreground = Brushes.Red; foreach (ToggleButton children in t.Children) { if (children != root) { children.Foreground = Brushes.Black; children.IsChecked = false; } } EntitySelector selector = new EntitySelector(new Entity(item)); selector.ShowDialog(); }; t.Children.Add(root); } }
private static EntityListController BuildEntitySelector(INode rootNode, Func<IParentNode, IAccessor<string>> fnGetText, RootNode actualRootNode, IParentNode dynamicData) { var entityList = rootNode.Get<IEntityList<IUIEntityRow>>(); var selector = new EntitySelector {Rows = entityList.Rows, SelectedRow = entityList.Rows.First()}; var rowSelector = dynamicData.Nodes("rowSelector").First(); rowSelector.Register(selector); var textOutput = dynamicData.Nodes("textOutput").First().Get<IAccessor<string>>(); var nodeMessage = new NodeMessage { Target = textOutput, MessagePredicate = (message => message.Method.Name == "set_SelectedRow"), TargetDelegate = (Func<IInvocation, Action<IAccessor<string>>>) (row => accessor => accessor.Value = fnGetText(((IEntityRow)row.Arguments.First()).Context).Value) //TODO: 1. This seems a little complicated... //Somebody, or something in the xml needs to clue the framework in to how to do this wiring. }; actualRootNode.InstallHook(nodeMessage); var _entityListController = new EntityListController {EntityList = rowSelector.Get<IEntitySelector>()}; _entityListController.Beginning(); return _entityListController; }
public static void BrettyEfes() { EntitySelector selector = EntitySelector.Target("@p"); selector.Distance = "5..10"; selector.Gamemode = 3; selector.Limit = 5; selector.Scores.Where("myObj", 5); EntitySelector selector2 = EntitySelector.Target("@p").InDistance("5..10").InGamemode(3).LimitTo(5).Score("myObj", 5); EntitySelector selector3 = "@p[distance=5..10,gamemode=spectator,limit=5,scores={myObj=5}]"; execute.As(selector).Store(Storage.Result, "Shlomo", "myObj").Run().XP.Levels.Query(); execute.As(selector2).Store(Storage.Result, "Shlomo", "myObj").Run().XP.Levels.Query(); execute.As(selector3).Store(Storage.Result, "Shlomo", "myObj").Run().XP.Levels.Query(); Console.WriteLine(GetFirstRawCommand((c) => Give("diamond"))); RunFunction(Blocks.Hello); }
string Spreadplayers() { string center = ""; string kt = ""; if (sp_center_tilde.IsChecked == true) { center = "~" + LocX_sp.Text + " ~" + LocZ_sp.Text; } else { center = LocX_sp.Text + " " + LocZ_sp.Text; } if (keepTeam.IsChecked == true) { kt = "true"; } else { kt = "false"; } if (area.Value < separation.Value) { area.Value = separation.Value + 1; } return("/spreadplayers " + center + " " + separation.Value + " " + area.Value + " " + kt + " " + EntitySelector.GetEntity()); }