Ejemplo n.º 1
0
        /// <summary>
        /// Loads top level entry list
        /// </summary>
        /// <history>
        ///     [tamttt] 20/10/2004	Created
        /// </history>
        private void InitList()
        {
            ListController ctlLists  = new ListController();
            string         listName  = SelectedKey.Substring(SelectedKey.IndexOf(":") + 1);
            string         parentKey = SelectedKey.Replace(listName, "").TrimEnd(':');

            selListInfo     = ctlLists.GetListInfo(listName, parentKey);
            SelectedText    = selListInfo.DisplayName;
            EnableSortOrder = selListInfo.EnableSortOrder;
            SystemList      = selListInfo.SystemList;
        }
Ejemplo n.º 2
0
        private ListInfo GetList(string key, bool update)
        {
            var    ctlLists  = new ListController();
            int    index     = key.IndexOf(":", StringComparison.Ordinal);
            string listName  = key.Substring(index + 1);
            string parentKey = Null.NullString;

            if (index > 0)
            {
                parentKey = key.Substring(0, index);
            }
            if (update)
            {
                ListName  = listName;
                ParentKey = parentKey;
            }
            return(ctlLists.GetListInfo(listName, parentKey, ListPortalID));
        }
Ejemplo n.º 3
0
        private ListInfo GetList(string key, bool update)
        {
            var    ctlLists   = new ListController();
            int    index      = key.IndexOf(":");
            string _ListName  = key.Substring(index + 1);
            string _ParentKey = Null.NullString;

            if (index > 0)
            {
                _ParentKey = key.Substring(0, index);
            }
            if (update)
            {
                ListName  = _ListName;
                ParentKey = _ParentKey;
            }
            return(ctlLists.GetListInfo(_ListName, _ParentKey, ListPortalID));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets a single list.
        /// </summary>
        /// <param name="key">The key to fetch the list.</param>
        /// <param name="cache">A value indicating whether to cache this list.</param>
        /// <returns>A list object.</returns>
        public object Item(string key, bool cache)
        {
            int    index;
            object obj        = null;
            bool   itemExists = false;

            // Do validation first
            try
            {
                if (this.mKeyIndexLookup[key.ToLowerInvariant()] != null)
                {
                    itemExists = true;
                }
            }
            catch (Exception exc)
            {
                Logger.Error(exc);
            }

            // key will be in format Country.US:Region
            if (!itemExists)
            {
                var      ctlLists  = new ListController();
                string   listName  = key.Substring(key.IndexOf(":") + 1);
                string   parentKey = key.Replace(listName, string.Empty).TrimEnd(':');
                ListInfo listInfo  = ctlLists.GetListInfo(listName, parentKey);

                // the collection has been cache, so add this entry list into it if specified
                if (cache)
                {
                    this.Add(listInfo.Key, listInfo);
                    return(listInfo);
                }
            }
            else
            {
                index = Convert.ToInt32(this.mKeyIndexLookup[key.ToLowerInvariant()]);
                obj   = this.List[index];
            }

            return(obj);
        }
 private ListInfo GetList(string key, bool update)
 {
     var ctlLists = new ListController();
     int index = key.IndexOf(":", StringComparison.Ordinal);
     string listName = key.Substring(index + 1);
     string parentKey = Null.NullString;
     if (index > 0)
     {
         parentKey = key.Substring(0, index);
     }
     if (update)
     {
         ListName = listName;
         ParentKey = parentKey;
     }
     return ctlLists.GetListInfo(listName, parentKey, ListPortalID);
 }
Ejemplo n.º 6
0
 // Another method, get Lists on demand
 public object Item(string key, bool Cache)
 {
     int index;
     object obj = null;
     bool itemExists = false;
     try //Do validation first
     {
         if (mKeyIndexLookup[key.ToLower()] != null)
         {
             itemExists = true;
         }
     }
     catch (Exception exc)
     {
         Logger.Error(exc);
     }
     //key will be in format Country.US:Region
     if (!itemExists)
     {
         var ctlLists = new ListController();
         string listName = key.Substring(key.IndexOf(":") + 1);
         string parentKey = key.Replace(listName, "").TrimEnd(':');
         ListInfo listInfo = ctlLists.GetListInfo(listName, parentKey);
         //the collection has been cache, so add this entry list into it if specified
         if (Cache)
         {
             Add(listInfo.Key, listInfo);
             return listInfo;
         }
     }
     else
     {
         index = Convert.ToInt32(mKeyIndexLookup[key.ToLower()]);
         obj = base.List[index];
     }
     return obj;
 }
Ejemplo n.º 7
0
 private ListInfo GetList(string key, bool update)
 {
     var ctlLists = new ListController();
     int index = key.IndexOf(":");
     string _ListName = key.Substring(index + 1);
     string _ParentKey = Null.NullString;
     if (index > 0)
     {
         _ParentKey = key.Substring(0, index);
     }
     if (update)
     {
         ListName = _ListName;
         ParentKey = _ParentKey;
     }
     return ctlLists.GetListInfo(_ListName, _ParentKey, ListPortalID);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Loads top level entry list
        /// </summary>       
        /// <history>
        ///     [tamttt] 20/10/2004	Created
        /// </history>
        private void InitList()
        {
            ListController ctlLists = new ListController();
            string listName = SelectedKey.Substring(SelectedKey.IndexOf(":") + 1);
            string parentKey = SelectedKey.Replace(listName, "").TrimEnd(':');

            selListInfo = ctlLists.GetListInfo(listName, parentKey);
            SelectedText = selListInfo.DisplayName;
            EnableSortOrder = selListInfo.EnableSortOrder;
            SystemList = selListInfo.SystemList;

        }