internal NITag(JsonNITag tag) : this(tag.path, tag.type.ToEnum(NITagType.STRING)) { if (keywords != null) { keywords = tag.keywords; } //Parse common properties if (tag.properties != null) { properties = tag.properties; if (properties.ContainsKey("active")) { active = bool.Parse(properties["active"]); properties.Remove("active"); } if (properties.ContainsKey("nitagRetention")) { nitagRetention = properties["nitagRetention"].ToEnum(NITagRetention.NONE); properties.Remove("nitagRetention"); } if (properties.ContainsKey("nitagHistoryTTLDays")) { nitagHistoryTTLDays = int.Parse(properties["nitagHistoryTTLDays"]); properties.Remove("nitagHistoryTTLDays"); } if (properties.ContainsKey("nitagMaxHistoryCount")) { nitagMaxHistoryCount = int.Parse(properties["nitagMaxHistoryCount"]); properties.Remove("nitagMaxHistoryCount"); } } }
internal DateTag(JsonNITag tag, string name, string se, DateTime date, int mothsTillWarn) : base(tag) { this.name = name; this.se = se; if (properties.ContainsKey("lifespan")) { int.TryParse(properties["lifespan"], out lifespan); } this.date = date.AddYears(lifespan); isDue = this.date.AddMonths(-mothsTillWarn).CompareTo(DateTime.Today) < 0; }
internal BootTag(string name, JsonNITag tag) : base(tag) { this.name = name; }