示例#1
0
 private static bool IsCategoryStillUsed(XmlElement category)
 {
     return category.GetIntAttributeValue("countkeywordonpag") > 0 ||
            category.GetIntAttributeValue("countkeywordonpge") > 0 ||
            category.GetIntAttributeValue("countkeywordonpgeandpag") > 0;
 }
示例#2
0
 private static bool IsKeywordStillUsed(XmlElement keyword)
 {
     return keyword.GetIntAttributeValue("countkeywordonpag").GetValueOrDefault() > 0 ||
            keyword.GetIntAttributeValue("countkeywordonpge") > 0 ||
            keyword.GetIntAttributeValue("countkeywordonpgeandpag") > 0;
 }
示例#3
0
        private void LoadXml(XmlElement element)
        {
            Link = (ILinkElement) PageElement.CreateElement(Project, element);

            var start = element.GetOADate("startdate");
            AppearenceStart = !start.HasValue ? DateTime.MinValue : start.Value;

            var end = element.GetOADate("enddate");
            AppearenceEnd = !end.HasValue ? DateTime.MaxValue : end.Value;

            var dateState = element.GetIntAttributeValue("datestate").GetValueOrDefault();
            IsActive = dateState == 1 || dateState == 3;
        }
示例#4
0
 public UserInfo(IProject project, XmlElement user)
 {
     User = new User(project.Session, user.GetGuid()) {Name = user.GetName()};
     HasUserReleasedPage = user.GetIntAttributeValue("released").GetValueOrDefault() == 1;
     PageReleaseDate = user.GetOADate().GetValueOrDefault();
 }
示例#5
0
 protected Locale(ISession session, XmlElement xmlElement)
 {
     _session = session;
     LanguageAbbreviation = xmlElement.GetAttributeValue("id");
     Country = xmlElement.GetAttributeValue("country");
     Language = xmlElement.GetAttributeValue("language");
     IsStandardLanguage = xmlElement.GetBoolAttributeValue("standardlanguage").GetValueOrDefault();
     LCID = xmlElement.GetIntAttributeValue("lcid").GetValueOrDefault();
     RFCLanguageId = xmlElement.GetAttributeValue("rfclanguageid");
     DateTimeFormats = new IndexedCachedList<int, IDateTimeFormat>(GetFormats, x => x.TypeId, Caching.Enabled);
 }
示例#6
0
 internal static IFolder CreateFolder(IProject project, XmlElement element)
 {
     var folderType = element.GetIntAttributeValue("foldertype");
     if (!folderType.HasValue)
     {
         throw new SmartAPIException(project.Session.ServerLogin, "Could not load folder information");
     }
     switch (folderType.Value)
     {
         case 0:
             var isAssetManagerFolder = element.GetBoolAttributeValue("catalog").GetValueOrDefault();
             if (!isAssetManagerFolder)
             {
                 return new FileFolder(project, element);
             }
             return new AssetManagerFolder(project, element);
         default:
             throw new SmartAPIInternalException(string.Format("Unsupported folder type: {0}", folderType));
     }
 }
示例#7
0
        public static bool HasSupportedFolderType(XmlElement element)
        {
            var folderType = element.GetIntAttributeValue("foldertype");
            if (!folderType.HasValue)
            {
                return false;
            }

            switch (folderType)
            {
                case 0:
                    return true;
                default:
                    return false;
            }
        }