public BatchingLogAgent(BatchingConfig Config)
     : this()
 {
     if (Config == null)
         ConfigUri = DefaultConfigUri;
     else
         Configuration = Config;
 }
コード例 #2
0
 public BatchingLogAgent(BatchingConfig Config)
     : this()
 {
     if (Config == null)
     {
         ConfigUri = DefaultConfigUri;
     }
     else
     {
         Configuration = Config;
     }
 }
 public RemoteVideoLogAgent(BatchingConfig Config)
     : base(Config)
 { }
コード例 #4
0
        public static BatchingConfig Load(XmlReader reader)
        {
            BatchingConfig result = new BatchingConfig();

            reader.GoToElement();
            reader.ReadStartElement();
            if (!reader.IsEmptyElement)
            {
                while (reader.GoToSibling())
                {
                    switch (reader.LocalName)
                    {
                    case "Application":
                        if (!reader.IsEmptyElement)
                        {
                            reader.ReadStartElement();
                            while (reader.GoToSibling())
                            {
                                switch (reader.LocalName)
                                {
                                case "Id":
                                    result.ApplicationId = new Guid(reader.ReadElementContentAsString());
                                    break;

                                case "Name":
                                    result.ApplicationName = reader.ReadElementContentAsString();
                                    break;

                                case "Version":
                                    result.ApplicationVersion = reader.ReadElementContentAsString();
                                    break;

                                case "Enabled":
                                    result.LoggingEnabled = reader.ReadElementContentAsBoolean();
                                    break;

                                default:
                                    reader.Skip();
                                    break;
                                }
                            }
                            reader.ReadEndElement();
                        }
                        else
                        {
                            reader.Skip();
                        }
                        break;

                    case "Queue":
                        if (!reader.IsEmptyElement)
                        {
                            reader.ReadStartElement();
                            while (reader.GoToSibling())
                            {
                                switch (reader.LocalName)
                                {
                                case "maxLength":
                                    result.MaxQueueLength = reader.ReadElementContentAsInt();
                                    break;

                                case "maxBatchLength":
                                    result.MaxBatchLength = reader.ReadElementContentAsInt();
                                    break;

                                case "maxSendErrors":
                                    result.MaxSendErrors = reader.ReadElementContentAsInt();
                                    break;

                                case "maxSendErrorsThrottled":
                                    result.MaxSendErrorsThrottled = reader.ReadElementContentAsInt();
                                    break;

                                case "pollingIntervalSeconds":
                                    result.QueuePollingInterval = TimeSpan.FromSeconds(reader.ReadElementContentAsInt());
                                    break;

                                case "pollingIntervalThrottledSeconds":
                                    result.QueuePollingIntervalThrottled = TimeSpan.FromSeconds(reader.ReadElementContentAsInt());
                                    break;

                                case "maxRetries":
                                    result.MaxRetries = reader.ReadElementContentAsInt();
                                    break;

                                default:
                                    reader.Skip();
                                    break;
                                }
                            }
                            reader.ReadEndElement();
                        }
                        else
                        {
                            reader.Skip();
                        }
                        break;

                    case "Session":
                        if (!reader.IsEmptyElement)
                        {
                            reader.ReadStartElement();
                            while (reader.GoToSibling())
                            {
                                switch (reader.LocalName)
                                {
                                case "maxSessionLogs":
                                    result.MaxSessionLogs = reader.ReadElementContentAsInt();
                                    break;

                                default:
                                    reader.Skip();
                                    break;
                                }
                            }
                            reader.ReadEndElement();
                        }
                        else
                        {
                            reader.Skip();
                        }
                        break;

                    case "MappingRules":
                        if (!reader.IsEmptyElement)
                        {
                            result.MappingRules = MappingRules.Load(reader);
                        }
                        else
                        {
                            reader.Skip();
                        }
                        break;

                    default:
                        reader.Skip();
                        break;
                    }
                }
                reader.ReadEndElement();
            }
            else
            {
                reader.Skip();
            }

            return(result);
        }
コード例 #5
0
 /// <summary>
 /// Causes the ConfigUri to be loaded.
 /// </summary>
 public void LoadConfig()
 {
     Configuration = BatchingConfig.Load(ConfigUri);
 }
        public static BatchingConfig Load(XmlReader reader)
        {
            BatchingConfig result = new BatchingConfig();

            reader.GoToElement();
            reader.ReadStartElement();
            if (!reader.IsEmptyElement)
            {
                while (reader.GoToSibling())
                {
                    switch (reader.LocalName)
                    {
                        case "Application":
                            if (!reader.IsEmptyElement)
                            {
                                reader.ReadStartElement();
                                while (reader.GoToSibling())
                                {
                                    switch (reader.LocalName)
                                    {
                                        case "Id":
                                            result.ApplicationId = new Guid(reader.ReadElementContentAsString());
                                            break;
                                        case "Name":
                                            result.ApplicationName = reader.ReadElementContentAsString();
                                            break;
                                        case "Version":
                                            result.ApplicationVersion = reader.ReadElementContentAsString();
                                            break;
                                        case "Enabled":
                                            result.LoggingEnabled = reader.ReadElementContentAsBoolean();
                                            break;
                                        default:
                                            reader.Skip();
                                            break;
                                    }
                                }
                                reader.ReadEndElement();
                            }
                            else
                                reader.Skip();
                            break;
                            
                        case "Queue":
                            if (!reader.IsEmptyElement)
                            {
                                reader.ReadStartElement();
                                while (reader.GoToSibling())
                                {
                                    switch (reader.LocalName)
                                    {
                                        case "maxLength":
                                            result.MaxQueueLength = reader.ReadElementContentAsInt();
                                            break;
                                        case "maxBatchLength":
                                            result.MaxBatchLength = reader.ReadElementContentAsInt();
                                            break;
                                        case "maxSendErrors":
                                            result.MaxSendErrors = reader.ReadElementContentAsInt();
                                            break;
                                        case "maxSendErrorsThrottled":
                                            result.MaxSendErrorsThrottled = reader.ReadElementContentAsInt();
                                            break;
                                        case "pollingIntervalSeconds":
                                            result.QueuePollingInterval = TimeSpan.FromSeconds(reader.ReadElementContentAsInt());
                                            break;
                                        case "pollingIntervalThrottledSeconds":
                                            result.QueuePollingIntervalThrottled = TimeSpan.FromSeconds(reader.ReadElementContentAsInt());
                                            break;
                                        case "maxRetries":
                                            result.MaxRetries = reader.ReadElementContentAsInt();
                                            break;
                                        default:
                                            reader.Skip();
                                            break;
                                    }
                                }
                                reader.ReadEndElement();
                            }
                            else
                                reader.Skip();
                            break;

                        case "Session":
                            if (!reader.IsEmptyElement)
                            {
                                reader.ReadStartElement();
                                while (reader.GoToSibling())
                                {
                                    switch (reader.LocalName)
                                    {
                                        case "maxSessionLogs":
                                            result.MaxSessionLogs = reader.ReadElementContentAsInt();
                                            break;
                                        default:
                                            reader.Skip();
                                            break;
                                    }
                                }
                                reader.ReadEndElement();
                            }
                            else
                                reader.Skip();
                            break;

                        case "MappingRules":
                            if (!reader.IsEmptyElement)
                                result.MappingRules = MappingRules.Load(reader);
                            else
                                reader.Skip();
                            break;

                        default:
                            reader.Skip();
                            break;
                    }
                }
                reader.ReadEndElement();
            }
            else
                reader.Skip();

            return result;
        }