public static void FileReplace(Action <US4UpdateModeBase, string, string> @delegate, US4UpdateModeBase @this, string src, string dest) { if (Guid.TryParse(@this._Game.AppId, out var AppId) && AppId.Equals(new Guid(0x0D726F91, 0x202E, 0x4158, 0x9B, 0x9D, 0xCA, 0x0B, 0xF9, 0x44, 0x6B, 0x36)) && string.Equals(Path.GetFileName(dest), "Gaffeine.Data.dll", StringComparison.OrdinalIgnoreCase)) { var executingAssembly = Assembly.GetExecutingAssembly(); using (var parentAssemblyDef = AssemblyDefinition.ReadAssembly(src)) using (var assemblyDef = AssemblyDefinition.ReadAssembly(executingAssembly.Location)) { if (assemblyDef.HasCustomAttributes) { var customAttributes = assemblyDef.CustomAttributes; for (int i = 0; i < customAttributes.Count; ++i) { if (customAttributes[i].AttributeType.FullName != "System.Xml.Serialization.XmlSerializerVersionAttribute") { continue; } var constructor = customAttributes[i].Constructor; customAttributes[i] = new CustomAttribute(constructor) { Properties = { new CustomAttributeNamedArgument("ParentAssemblyId", new CustomAttributeArgument(assemblyDef.MainModule.TypeSystem.String, parentAssemblyDef.GetAssemblyId())), new CustomAttributeNamedArgument("Version", new CustomAttributeArgument(assemblyDef.MainModule.TypeSystem.String, "4.0.0.0")) } }; assemblyDef.Write(Path.Combine(Path.GetDirectoryName(dest), Path.GetFileName(executingAssembly.Location))); break; } } } } @delegate(@this, src, dest); }
internal bool IsMatch(IParagonAppInfo appInfo) { if (!string.IsNullOrEmpty(AppId) && !AppId.Equals(appInfo.AppId, StringComparison.OrdinalIgnoreCase)) { // Skip apps that don't match the specified app ID. return(false); } return(string.IsNullOrEmpty(InstanceId) || InstanceId.Equals(appInfo.AppInstanceId, StringComparison.OrdinalIgnoreCase)); }
/// <inheritdoc /> public bool Equals(UserAppPair other) => AppId.Equals(other.AppId) && UserName == other.UserName;
public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } if (GetType() != obj.GetType()) { return(false); } var other = (MessageProperties)obj; if (AppId == null) { if (other.AppId != null) { return(false); } } else if (!AppId.Equals(other.AppId)) { return(false); } if (ClusterId == null) { if (other.ClusterId != null) { return(false); } } else if (!ClusterId.Equals(other.ClusterId)) { return(false); } if (ContentEncoding == null) { if (other.ContentEncoding != null) { return(false); } } else if (!ContentEncoding.Equals(other.ContentEncoding)) { return(false); } if (ContentLength != other.ContentLength) { return(false); } if (ContentType == null) { if (other.ContentType != null) { return(false); } } else if (!ContentType.Equals(other.ContentType)) { return(false); } if (CorrelationId == null) { if (other.CorrelationId != null) { return(false); } } else if (!CorrelationId.Equals(other.CorrelationId)) { return(false); } if (DeliveryMode != other.DeliveryMode) { return(false); } if (DeliveryTag != other.DeliveryTag) { return(false); } if (Expiration == null) { if (other.Expiration != null) { return(false); } } else if (!Expiration.Equals(other.Expiration)) { return(false); } if (!Headers.Equals(other.Headers)) { return(false); } if (MessageCount == null) { if (other.MessageCount != null) { return(false); } } else if (!MessageCount.Equals(other.MessageCount)) { return(false); } if (MessageId == null) { if (other.MessageId != null) { return(false); } } else if (!MessageId.Equals(other.MessageId)) { return(false); } if (Priority == null) { if (other.Priority != null) { return(false); } } else if (!Priority.Equals(other.Priority)) { return(false); } if (ReceivedExchange == null) { if (other.ReceivedExchange != null) { return(false); } } else if (!ReceivedExchange.Equals(other.ReceivedExchange)) { return(false); } if (ReceivedRoutingKey == null) { if (other.ReceivedRoutingKey != null) { return(false); } } else if (!ReceivedRoutingKey.Equals(other.ReceivedRoutingKey)) { return(false); } if (Redelivered == null) { if (other.Redelivered != null) { return(false); } } else if (!Redelivered.Equals(other.Redelivered)) { return(false); } if (ReplyTo == null) { if (other.ReplyTo != null) { return(false); } } else if (!ReplyTo.Equals(other.ReplyTo)) { return(false); } if (Timestamp == null) { if (other.Timestamp != null) { return(false); } } else if (!Timestamp.Equals(other.Timestamp)) { return(false); } if (Type == null) { if (other.Type != null) { return(false); } } else if (!Type.Equals(other.Type)) { return(false); } if (UserId == null) { if (other.UserId != null) { return(false); } } else if (!UserId.Equals(other.UserId)) { return(false); } return(true); }