public void MergeFrom(UdpListenerConfig other)
        {
            if (other == null)
            {
                return;
            }
            if (other.UdpListenerName.Length != 0)
            {
                UdpListenerName = other.UdpListenerName;
            }
            switch (other.ConfigTypeCase)
            {
            case ConfigTypeOneofCase.Config:
                if (Config == null)
                {
                    Config = new global::Google.Protobuf.WellKnownTypes.Struct();
                }
                Config.MergeFrom(other.Config);
                break;

            case ConfigTypeOneofCase.TypedConfig:
                if (TypedConfig == null)
                {
                    TypedConfig = new global::Google.Protobuf.WellKnownTypes.Any();
                }
                TypedConfig.MergeFrom(other.TypedConfig);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
        public void configure_is_invoked_for_IConfig_object()
        {
            TypedConfig expected = new TypedConfig();
            object      actual   = null;

            injector.Map(typeof(Action <TypedConfig>), "callback").ToValue((Action <TypedConfig>) delegate(TypedConfig config) {
                actual = config;
            });
            configManager.AddConfig(expected);
            context.Initialize();
            Assert.That(actual, Is.EqualTo(expected));
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (UdpListenerName.Length != 0)
            {
                hash ^= UdpListenerName.GetHashCode();
            }
            if (configTypeCase_ == ConfigTypeOneofCase.Config)
            {
                hash ^= Config.GetHashCode();
            }
            if (configTypeCase_ == ConfigTypeOneofCase.TypedConfig)
            {
                hash ^= TypedConfig.GetHashCode();
            }
            hash ^= (int)configTypeCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
예제 #4
0
 protected override async Task <HttpResponseMessage> SendRequestAsync(
     HttpClient client, string url, CancellationToken cancellationToken)
 {
     return(await client.PutAsync(url, TypedConfig.GetContent(), cancellationToken));
 }