16 using erminas.SmartAPI.CMS.Project;
17 using erminas.SmartAPI.CMS.Project.ContentClasses;
18 using erminas.SmartAPI.CMS.Project.ContentClasses.Elements;
19 using erminas.SmartAPI.CMS.Project.Folder;
20 using erminas.SmartAPI.Exceptions;
22 namespace erminas.SmartAPI.CMS.Converter
24 internal static class ConverterHelper
26 public static void CheckReadOnly<T>(IAttributeConverter<T> converter,
IProjectObject po,
29 if (converter.IsReadOnly || attribute.IsReadOnly)
32 string.Format(
"Writing to attribute {0} is forbidden", attribute.Description));
44 internal static bool AreFromTheSameProject<T>(
IProjectObject projectOfTarget, T value)
47 return projectOfTarget.
Session == value.Session && projectOfTarget.Project.Equals(value.Project);
58 string.Format(
"Missing content class folder {0} for project {1}", folderName,
63 if (!otherFolder.ContentClasses.TryGetByName(cc.
ContentClass.
Name, out otherContentClass))
66 string.Format(
"Missing content class {0} in folder {1} for project {2}",
71 if (!otherContentClass.Elements.TryGetByName(cc.
Name, out otherElement))
75 "Missing element {3} for content class {0} in folder {1} for project {2}",