public override void RegisterAll(ITemplateRegistry registry) { if (registry == null) { return; } MessageTemplate[] templatesp = registry.Templates; if (templatesp != null) { foreach (MessageTemplate t in templatesp) { Add(registry.GetId(t), t); } } }
public void SendTemplates(ITemplateRegistry registry) { if (!_protocol.SupportsTemplateExchange) { throw new NotSupportedException("The procotol " + _protocol + " does not support template exchange."); } foreach (MessageTemplate template in registry.Templates) { _outStream.WriteMessage(_protocol.CreateTemplateDefinitionMessage(template)); int templateId = registry.GetId(template); _outStream.WriteMessage(_protocol.CreateTemplateDeclarationMessage(template, templateId)); // BUG? double check if IsRegister() done on the same object as RegisterTemplate if (!_outStream.TemplateRegistry.IsRegistered(template)) { _outStream.RegisterTemplate(templateId, template); } } }
public void SendTemplates(ITemplateRegistry registry) { if (!_protocol.SupportsTemplateExchange) { throw new NotSupportedException("The procotol " + _protocol + " does not support template exchange."); } foreach (MessageTemplate template in registry.Templates) { _outStream.WriteMessage(_protocol.CreateTemplateDefinitionMessage(template)); int templateId = registry.GetId(template); _outStream.WriteMessage(_protocol.CreateTemplateDeclarationMessage(template, templateId)); // BUG? double check if IsRegister() done on the same object as RegisterTemplate if (!_outStream.TemplateRegistry.IsRegistered(template)) _outStream.RegisterTemplate(templateId, template); } }
public override void RegisterAll(ITemplateRegistry registry) { if (registry == null) return; MessageTemplate[] templatesp = registry.Templates; if (templatesp != null) foreach (MessageTemplate t in templatesp) Add(registry.GetId(t), t); }