public Template(string tagname, string derFrom, string basedOn, ECATEGORY category = ECATEGORY.idxCategoryUndefined, ICollection <GAttribute> attrs = null, ICollection <Script> script = null, string shortDesc = null) { if (string.IsNullOrWhiteSpace(tagname)) { throw new ArgumentNullException($"Имя тега не может быть пустым"); } if (string.IsNullOrWhiteSpace(derFrom)) { throw new ArgumentNullException($"Имя шаблона не может быть пустым"); } if (string.IsNullOrWhiteSpace(basedOn)) { throw new ArgumentNullException($"Имя базового шаблона не может быть пустым"); } if (string.IsNullOrWhiteSpace(shortDesc)) { throw new ArgumentNullException($"Имя краткого описания не может быть пустым"); } TemplateName = tagname; DerivedFrom = derFrom; BasedOn = basedOn; ShortDesc = shortDesc; DateCreation = DateTime.Now; IsTemplate = true; AttributesList = attrs; CategoryTag = category; Script = script; }
public Template(string tagname, string derFrom, string basedOn, ECATEGORY category = ECATEGORY.idxCategoryUndefined, ICollection <GAttribute> attrs = null, string shortDesc = null, bool isnew = true) { DateCreation = DateTime.Now; TagName = tagname; DerivedFrom = derFrom; BasedOn = basedOn; IsTemplate = true; ShortDesc = shortDesc; AttributesList = attrs; IsNew = isnew; CategoryTag = category; HostName = null; AreaName = null; ContainerName = null; ContainedName = null; }
public Instance(string tagname, string derFrom, string basedOn, string host = null, string area = null, string container = null, string containedname = null, ECATEGORY category = ECATEGORY.idxCategoryUndefined, ICollection <GAttribute> attrs = null, string shortDesc = null, bool isnew = true) { if (string.IsNullOrWhiteSpace(tagname)) { throw new ArgumentNullException($"Имя тега не может быть пустым"); } if (string.IsNullOrWhiteSpace(derFrom)) { throw new ArgumentNullException($"Имя шаблона не может быть пустым"); } if (string.IsNullOrWhiteSpace(basedOn)) { throw new ArgumentNullException($"Имя базового шаблона не может быть пустым"); } if (string.IsNullOrWhiteSpace(shortDesc)) { throw new ArgumentNullException($"Имя краткого описания не может быть пустым"); } DateCreation = DateTime.Now; TagName = tagname; DerivedFrom = derFrom; BasedOn = basedOn; IsTemplate = false; ShortDesc = shortDesc; AttributesList = attrs; CategoryTag = category; HostName = host; AreaName = area; ContainerName = container; HierarchicalName = $"{HostName ?? null}.{AreaName ?? null}."; }