Skip to content

Commit 0ea9274

Browse files
authored
Merge pull request #834 from rabbitmq/rabbitmq-dotnet-client-819-2
Move Constants to RabbitMQ.Client
2 parents 8f7a0b4 + bb621f8 commit 0ea9274

File tree

2 files changed

+36
-35
lines changed

2 files changed

+36
-35
lines changed

projects/Apigen/apigen/Apigen.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -480,11 +480,9 @@ internal sealed class Protocol : {ImplNamespaceBase}.ProtocolBase
480480
///<summary>Default TCP port (= {port})</summary>
481481
public override int DefaultPort => {port};
482482
";
483-
EmitLine(publicVars);
484-
EmitMethodArgumentReader();
485-
EmitLine("");
486-
EmitContentHeaderReader();
487-
EmitLine(" }");
483+
484+
EmitLine("namespace RabbitMQ.Client");
485+
EmitLine("{");
488486
EmitLine(" public static class Constants");
489487
EmitLine(" {");
490488
foreach (KeyValuePair<string, int> de in m_constants)
@@ -493,6 +491,12 @@ internal sealed class Protocol : {ImplNamespaceBase}.ProtocolBase
493491
EmitLine($" public const int {MangleConstant(de.Key)} = {de.Value};");
494492
}
495493
EmitLine(" }");
494+
EmitLine("}");
495+
EmitLine(publicVars);
496+
EmitMethodArgumentReader();
497+
EmitLine("");
498+
EmitContentHeaderReader();
499+
EmitLine(" }");
496500
foreach (AmqpClass c in m_classes)
497501
{
498502
EmitClassMethods(c);

projects/Unit/APIApproval.Approve.verified.txt

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,33 @@ namespace RabbitMQ.Client
110110
public ConnectionFactoryBase() { }
111111
public static RabbitMQ.Client.ITcpClient DefaultSocketFactory(System.Net.Sockets.AddressFamily addressFamily) { }
112112
}
113+
public static class Constants
114+
{
115+
public const int AccessRefused = 403;
116+
public const int ChannelError = 504;
117+
public const int CommandInvalid = 503;
118+
public const int ConnectionForced = 320;
119+
public const int ContentTooLarge = 311;
120+
public const int FrameBody = 3;
121+
public const int FrameEnd = 206;
122+
public const int FrameError = 501;
123+
public const int FrameHeader = 2;
124+
public const int FrameHeartbeat = 8;
125+
public const int FrameMethod = 1;
126+
public const int FrameMinSize = 4096;
127+
public const int InternalError = 541;
128+
public const int InvalidPath = 402;
129+
public const int NoConsumers = 313;
130+
public const int NotAllowed = 530;
131+
public const int NotFound = 404;
132+
public const int NotImplemented = 540;
133+
public const int PreconditionFailed = 406;
134+
public const int ReplySuccess = 200;
135+
public const int ResourceError = 506;
136+
public const int ResourceLocked = 405;
137+
public const int SyntaxError = 502;
138+
public const int UnexpectedFrame = 505;
139+
}
113140
public class DefaultBasicConsumer : RabbitMQ.Client.IBasicConsumer
114141
{
115142
public DefaultBasicConsumer() { }
@@ -782,36 +809,6 @@ namespace RabbitMQ.Client.Exceptions
782809
public object Offender { get; }
783810
}
784811
}
785-
namespace RabbitMQ.Client.Framing
786-
{
787-
public static class Constants
788-
{
789-
public const int AccessRefused = 403;
790-
public const int ChannelError = 504;
791-
public const int CommandInvalid = 503;
792-
public const int ConnectionForced = 320;
793-
public const int ContentTooLarge = 311;
794-
public const int FrameBody = 3;
795-
public const int FrameEnd = 206;
796-
public const int FrameError = 501;
797-
public const int FrameHeader = 2;
798-
public const int FrameHeartbeat = 8;
799-
public const int FrameMethod = 1;
800-
public const int FrameMinSize = 4096;
801-
public const int InternalError = 541;
802-
public const int InvalidPath = 402;
803-
public const int NoConsumers = 313;
804-
public const int NotAllowed = 530;
805-
public const int NotFound = 404;
806-
public const int NotImplemented = 540;
807-
public const int PreconditionFailed = 406;
808-
public const int ReplySuccess = 200;
809-
public const int ResourceError = 506;
810-
public const int ResourceLocked = 405;
811-
public const int SyntaxError = 502;
812-
public const int UnexpectedFrame = 505;
813-
}
814-
}
815812
namespace RabbitMQ.Client.Logging
816813
{
817814
[System.Diagnostics.Tracing.EventSource(Name="rabbitmq-dotnet-client")]

0 commit comments

Comments
 (0)