private void UpdateSendCommandInfo(bool animate = true) { StringBuilder sb = new StringBuilder(); try { 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; } var mw = App.Current.MainWindow as MainWindow; if (!ServiceBusFactory.CanSendCommand(CurrentServer.ServiceBus, CurrentServer.ServiceBusVersion, CurrentServer.ServiceBusQueueType)) { sb.Append("Service Bus Adapter doesn't support Sending Commands"); lbCmdsFound.Content = string.Empty; return; } var cmds = GetAvailableCommands(asmPaths.GetItems(), cmdDef, !animate); // !animate = on dialog startup lbCmdsFound.Content = "{0} Commands Found".With(cmds.Length); if (cmds.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 at least one assembly path containing commands libraries to be able to Send Commands"); lbCmdsFound.Content = string.Empty; } } finally { if (sb.Length > 0) { lbSendCommandInfo.Text = sb.ToString(); } UpdateInfoBox(sb.Length > 0, animate, ROW_SENDCMD_INFO, ConfigWindow.SendCommandInfoHeightProperty); } }