コード例 #1
0
        public void Attach(TemplateContract templateContract)
        {
            if (templateContract == null)
            {
                throw new ArgumentNullException(nameof(templateContract));
            }

            var type = templateContract.GetType();

            TemplateContractInfos.GetValueOrCreate(type, () => new TemplateContractInfo(type)).Bind(templateContract, _templateChildProvider);
        }
コード例 #2
0
 public void Detach(TemplateContract templateContract)
 {
     TemplateContractInfos.GetValueOrDefault(templateContract.GetType())?.Unbind(templateContract);
 }