public virtual IProjectItem Resolve() { if (IsResolved && ResolvedUri != null) { if (!IsValid) { return null; } var result = Owner.Project.FindQualifiedItem(ResolvedUri); if (result == null) { IsValid = false; ResolvedUri = null; } return result; } IsResolved = true; var projectItem = Owner.Project.FindQualifiedItem(ReferenceText); if (projectItem == null) { IsValid = false; ResolvedUri = null; return null; } ResolvedUri = projectItem.Uri; IsValid = true; return projectItem; }
public TemplateSection([NotNull] Template template, Guid guid, [NotNull] ITextNode templateSectionTextNode) { Template = template; SourceTextNodes.Add(templateSectionTextNode); Uri = new ProjectItemUri(template.DatabaseName, guid); }
public TemplateSection([NotNull] Template template, Guid guid) { Template = template; IconProperty = NewSourceProperty("Icon", string.Empty); SectionNameProperty = NewSourceProperty("Name", string.Empty); SortorderProperty = NewSourceProperty("Sortorder", 0); Fields = new LockableList <TemplateField>(this); Uri = new ProjectItemUri(template.DatabaseName, guid); }
public TemplateField([NotNull] Template template, Guid guid) { Template = template; FieldNameProperty = NewSourceProperty("Name", string.Empty); LongHelpProperty = NewSourceProperty("LongHelp", string.Empty); ShortHelpProperty = NewSourceProperty("ShortHelp", string.Empty); SortorderProperty = NewSourceProperty("SortOrder", 0); SourceProperty = NewSourceProperty("Source", string.Empty); TypeProperty = NewSourceProperty("Type", string.Empty); IconProperty = NewSourceProperty("Icon", string.Empty); Uri = new ProjectItemUri(template.DatabaseName, guid); }
public void Invalidate() { IsResolved = false; IsValid = false; ResolvedUri = null; }