public static void InvokeStaticEvent() { StaticEvent?.Invoke(); }
public static void StaticFireEvent(short arg) { StaticEvent?.Invoke(typeof(StaticTestClass), new TestEventArgs <short> { Arg = arg }); }
public static void RaiseStaticEvent(EventArgs eventArgs) { StaticEvent?.Invoke(null, eventArgs); }
public void TestStaticEventInvoke() { StaticEvent += EventHandler; StaticEvent.Invoke(); }
public static void RaiseStaticEvent() { StaticEvent?.Invoke(null, new ViewModelClosedEventArgs(new TestViewModel(), true)); }
public void InvokeOnButton() { StaticEvent.Invoke(); StandartEvent = StandartEvents.ForStandartEvent.StandartEvent; StandartEvent.Invoke(); }
private void Chat_MessageSent(ChatSubmitMessage.Data messageData) { // by doing the below instead, we preserver formatting symbols. string message = UIExInputGeneric <string> .current_.Value_; //messageData.message_; var commandInfo = MessageUtilities.getCommandInfo(message); Cmd cmd = commandInfo.matches ? Cmd.all.getCommand(commandInfo.commandName) : null; string logMessage = ""; var client = GeneralUtilities.localClient(); var showRegularChat = (!commandInfo.local && !GeneralUtilities.isHost()) || !LogCmd.localHostCommands || !commandInfo.matches || commandInfo.forceVisible || (cmd != null && client != null && cmd.showChatPublic(client)); if (showRegularChat) { sendingLocalChat = true; replicateLocalChatFunc?.Invoke(messageData); if (!commandInfo.matches) { return; } logMessage = message; } if (client == null) { Console.WriteLine("Error: Local client can't be found !"); return; } if (!showRegularChat) { MessageUtilities.sendMessage(client, $"[00FFFF]{message}[-]"); logMessage = $"[00FFFF]{message}[-]"; } MessageStateOptionLog cmdLog = new MessageStateOptionLog(new List <string>()); MessageUtilities.pushMessageOption(cmdLog); if (LogCmd.localHostResults) { MessageUtilities.pushMessageOption(new MessageStateOptionPlayer(client)); } else { MessageUtilities.pushMessageOption(new MessageStateOptionPlayer()); } if (!commandInfo.local && commandInfo.commandName.ToLower() == "plugin") { printClient(); LogCmd.AddLog(client, logMessage, cmdLog.GetLogString()); MessageUtilities.popMessageOptions(2); return; } if (GeneralUtilities.isHost() && commandInfo.local) { MessageUtilities.sendMessage(client, "Cannot use local commands as host"); LogCmd.AddLog(client, logMessage, cmdLog.GetLogString()); MessageUtilities.popMessageOptions(2); return; } else if (!GeneralUtilities.isHost() && !commandInfo.local) { MessageUtilities.popMessageOptions(2); return; } if (cmd == null) { MessageUtilities.sendMessage(client, "The command '" + commandInfo.commandName + "' doesn't exist."); LogCmd.AddLog(client, logMessage, cmdLog.GetLogString()); MessageUtilities.popMessageOptions(2); return; } if (commandInfo.local && !cmd.canUseLocal && cmd.perm != PermType.LOCAL) { MessageUtilities.sendMessage(client, "You can't use that command as client"); LogCmd.AddLog(client, logMessage, cmdLog.GetLogString()); MessageUtilities.popMessageOptions(2); return; } MessageUtilities.popMessageOptions(); // remove local/non-local only option bool renderToPublic = commandInfo.forceVisible || !LogCmd.localHostResults; // log settings may change if cmd changes them if (renderToPublic) { MessageUtilities.pushMessageOption(new MessageStateOptionPlayer()); } exec(cmd, client, commandInfo.commandParams); if (renderToPublic) { MessageUtilities.popMessageOptions(); } LogCmd.AddLog(client, logMessage, cmdLog.GetLogString()); MessageUtilities.popAllMessageOptions(); }