public CypherStringChatBuilder(WorldObject obj, ChatMsg msgType, CypherStrings textId, WorldObject target = null, object[] args = null) { _source = obj; _msgType = msgType; _textId = textId; _target = target; _args = args; }
static void NotifyModification(CommandHandler handler, Unit target, CypherStrings resourceMessage, CypherStrings resourceReportMessage, params object[] args) { Player player = target.ToPlayer(); if (player) { handler.SendSysMessage(resourceMessage, new object[] { handler.GetNameLink(player) }.Combine(args)); if (handler.needReportToTarget(player)) { player.SendSysMessage(resourceReportMessage, new object[] { handler.GetNameLink() }.Combine(args)); } } }
public bool SendSysMessage(CypherStrings str, params object[] args) { string input = ObjMgr.GetCypherString(str); string pattern = @"%(\d+(\.\d+)?)?(d|f|s|u)"; int count = 0; string result = Regex.Replace(input, pattern, m => { return(String.Concat("{", count++, "}")); }); return(SendSysMessage(result, args)); }
public virtual InternalRelationshipBuilder Apply(InternalRelationshipBuilder relationshipBuilder) { Check.NotNull(relationshipBuilder, nameof(relationshipBuilder)); var fk = relationshipBuilder.Metadata; var fromDeclaring = FindRelationshipAttributeOnProperty( fk.DeclaringEntityType, fk.DependentToPrincipal?.Name ); var fromPrincipal = FindRelationshipAttributeOnProperty( fk.PrincipalEntityType, fk.PrincipalToDependent?.Name ); if (!(fromDeclaring is null) && !(fromPrincipal is null)) { throw new InvalidOperationException( CypherStrings.DuplicateRelationshipAttribute( fk.DeclaringEntityType.DisplayName(), fk.DependentToPrincipal?.Name, fk.PrincipalEntityType.DisplayName(), fk.PrincipalToDependent?.Name ) ); } if (!(fromDeclaring is null)) { relationshipBuilder .Cypher(ConfigurationSource.DataAnnotation) .HasRelationship( fromDeclaring.Name ?? fromDeclaring.Type.DisplayName(), fk.DeclaringEntityType.Name ?? fk.DeclaringEntityType.ClrType.DisplayName() ); } if (!(fromPrincipal is null)) { relationshipBuilder .Cypher(ConfigurationSource.DataAnnotation) .HasRelationship( fromPrincipal.Name ?? fromPrincipal.Type.DisplayName(), fk.PrincipalEntityType.Name ?? fk.PrincipalEntityType.ClrType.DisplayName() ); } return(relationshipBuilder); }
public void SendNotification(CypherStrings str, params object[] args) { _session.SendNotification(str, args); }
public void SendSysMessage(CypherStrings cypherString, params object[] args) { SendSysMessage(string.Format(Global.ObjectMgr.GetCypherString(cypherString), args)); }
public string GetParsedString(CypherStrings cypherString, params object[] args) { return(string.Format(Global.ObjectMgr.GetCypherString(cypherString), args)); }
public string GetCypherString(CypherStrings str) { return(Global.ObjectMgr.GetCypherString(str)); }
public void SendNotification(CypherStrings str, params object[] args) { SendNotification(Global.ObjectMgr.GetCypherString(str), args); }
public static void SendSysMessage(WorldSession session, CypherStrings message, params object[] args) { string msg = string.Format(ObjMgr.GetCypherString(message), args); SendChatMessage(session, ChatMsg.System, Language.Universal, msg); }
public static void SendSysMessage(WorldObject obj, CypherStrings message, params object[] args) { SendSysMessage(obj.GetSession(), ObjMgr.GetCypherString(message), args); }