private void UpdateSendCommandInfo(bool animate = true) { StringBuilder sb = new StringBuilder(); if (asmPaths.ItemsCount > 0) { CommandDefinition cmdDef = new CommandDefinition(); if (tbCmdInherits.Text.IsValid()) { cmdDef.InheritsType = tbCmdInherits.Text; } var cmdNamespace = tbNamespace.RetrieveValue <string>(); if (cmdNamespace.IsValid()) { cmdDef.NamespaceContains = cmdNamespace; } if (_sys.GetAvailableCommands(asmPaths.GetItems(), cmdDef).Length == 0) { sb.Append("No commands found "); if (cmdDef.InheritsType.IsValid()) { sb.Append("that inherits " + cmdDef.InheritsType.Substring(0, cmdDef.InheritsType.IndexOf(',')).CutBeginning(40)); } if (cmdDef.NamespaceContains.IsValid()) { if (cmdDef.InheritsType.IsValid()) { sb.Append(" or "); } else { sb.Append("that "); } sb.AppendFormat("contains '{0}' in Namespace", cmdDef.NamespaceContains); } sb.Append(", make sure your Command Definition is correct"); } } else { sb.Append("You need to add atleast one assembly path to be able to send commands"); } if (sb.Length > 0) { lbSendCommandInfo.Text = sb.ToString(); } UpdateInfoBox(sb.Length > 0, animate, ROW_SENDCMD_INFO, ConfigWindow.SendCommandInfoHeightProperty); }
private void BindCommands() { var cmdTypes = _sys.GetAvailableCommands(); _commands.Clear(); foreach (Type t in cmdTypes.OrderBy(t => t.Name)) { var cmd = new CommandItem(); cmd.Type = t; cmd.DisplayName = string.Format("{0} ({1})", t.Name, t.Namespace); cmd.FullName = t.FullName; _commands.Add(cmd); } cbCommands.ItemsSource = _commands; cbCommands.DisplayMemberPath = "DisplayName"; cbCommands.SelectedValuePath = "FullName"; cbCommands.SelectedValue = null; }
private Type[] GetAvailableCommands(string[] asmPaths, CommandDefinition cmdDef, bool suppressErrors) { var srv = CurrentServer; return(_sys.GetAvailableCommands(srv.ServiceBus, srv.ServiceBusVersion, srv.ServiceBusQueueType, asmPaths, cmdDef, suppressErrors)); }