コード例 #1
0
ファイル: NavigationManager.cs プロジェクト: 0anion0/IBN
 /// <summary>
 /// Gets the customization item.
 /// </summary>
 /// <param name="fullId">The full id.</param>
 /// <param name="profileId">The profile id.</param>
 /// <returns></returns>
 private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId)
 {
     return GetCustomizationItem(fullId, structureType, commandType, profileId, null);
 }
コード例 #2
0
ファイル: NavigationManager.cs プロジェクト: 0anion0/IBN
        /// <summary>
        /// Gets the customization item.
        /// </summary>
        /// <param name="fullId">The full id.</param>
        /// <param name="profileId">The profile id.</param>
        /// <param name="principalId">The principal id.</param>
        /// <returns></returns>
        private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId, PrimaryKeyId? principalId)
        {
            CustomizationItemEntity result = null;

            FilterElementCollection filters = new FilterElementCollection();
            filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldXmlFullId, fullId));
            filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldStructureType, (int)structureType));
            filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldCommandType, (int)commandType));

            // Filter by profile
            if (profileId.HasValue)
                filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldProfileId, profileId.Value));
            else
                filters.Add(FilterElement.IsNullElement(CustomizationItemEntity.FieldProfileId));

            // Filter by principal
            if (principalId.HasValue)
                filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldPrincipalId, principalId.Value));
            else
                filters.Add(FilterElement.IsNullElement(CustomizationItemEntity.FieldPrincipalId));

            EntityObject[] items = BusinessManager.List(CustomizationItemEntity.ClassName, filters.ToArray());

            if (items != null && items.Length > 0)
            {
                result = items[0] as CustomizationItemEntity;
            }

            return result;
        }
コード例 #3
0
ファイル: NavigationManager.cs プロジェクト: 0anion0/IBN
 /// <summary>
 /// Creates the navigation item by parent.
 /// </summary>
 /// <param name="structureType">Type of the structure.</param>
 /// <param name="parentFullId">The parent full id.</param>
 /// <param name="commandType">Type of the command.</param>
 /// <param name="profileId">The profile id.</param>
 /// <param name="principalId">The principal id.</param>
 /// <returns></returns>
 private static CustomizationItemEntity CreateCustomizationItemByParent(string parentFullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId, PrimaryKeyId? principalId)
 {
     string fullId = string.Concat(parentFullId, "/", Guid.NewGuid().ToString("D"));
     return CreateCustomizationItem(fullId, structureType, commandType, profileId, principalId);
 }
コード例 #4
0
ファイル: NavigationManager.cs プロジェクト: 0anion0/IBN
 /// <summary>
 /// Gets the customization item.
 /// </summary>
 /// <param name="fullId">The full id.</param>
 /// <returns></returns>
 private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType)
 {
     return GetCustomizationItem(fullId, structureType, commandType, null, null);
 }
コード例 #5
0
ファイル: NavigationManager.cs プロジェクト: 0anion0/IBN
        /// <summary>
        /// Gets the customization item arguments.
        /// </summary>
        /// <param name="fullId">The full id.</param>
        /// <param name="structureType">Type of the structure.</param>
        /// <param name="commandType">Type of the command.</param>
        /// <param name="profileId">The profile id.</param>
        /// <param name="principalId">The principal id.</param>
        /// <returns></returns>
        public static Dictionary<string, CustomizationItemArgumentEntity> GetCustomizationItemArguments(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId, PrimaryKeyId? principalId)
        {
            CustomizationItemEntity item = GetCustomizationItem(fullId, structureType, commandType, profileId, principalId);

            if (item != null && item.PrimaryKeyId.HasValue)
            {
                return GetCustomizationItemArguments(item.PrimaryKeyId.Value);
            }

            return null;
        }
コード例 #6
0
ファイル: NavigationManager.cs プロジェクト: 0anion0/IBN
        /// <summary>
        /// Creates the navigation item.
        /// </summary>
        /// <param name="structureType">Type of the structure.</param>
        /// <param name="fullId">The full id.</param>
        /// <param name="commandType">Type of the command.</param>
        /// <param name="profileId">The profile id.</param>
        /// <param name="principalId">The principal id.</param>
        /// <returns></returns>
        private static CustomizationItemEntity CreateCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId, PrimaryKeyId? principalId)
        {
            CustomizationItemEntity item = BusinessManager.InitializeEntity<CustomizationItemEntity>(CustomizationItemEntity.ClassName);

            if (structureType != CustomizationStructureType.Undefined)
            {
                item.StructureType = (int)structureType;
            }
            item.XmlFullId = fullId;
            if (profileId.HasValue)
                item.Properties["ProfileId"].Value = profileId;
            if (principalId.HasValue)
                item.Properties["PrincipalId"].Value = principalId;

            item.CommandType = (int)commandType;

            item.PrimaryKeyId = BusinessManager.Create(item);

            return item;
        }
コード例 #7
0
ファイル: NavigationManager.cs プロジェクト: 0anion0/IBN
 /// <summary>
 /// Gets the customization item arguments.
 /// </summary>
 /// <param name="fullId">The full id.</param>
 /// <param name="structureType">Type of the structure.</param>
 /// <param name="commandType">Type of the command.</param>
 /// <returns></returns>
 public static Dictionary<string, CustomizationItemArgumentEntity> GetCustomizationItemArguments(string fullId, CustomizationStructureType structureType, ItemCommandType commandType)
 {
     return GetCustomizationItemArguments(fullId, structureType, commandType, null, null);
 }
コード例 #8
0
ファイル: NavigationManager.cs プロジェクト: 0anion0/IBN
 /// <summary>
 /// Gets the customization item arguments.
 /// </summary>
 /// <param name="fullId">The full id.</param>
 /// <param name="structureType">Type of the structure.</param>
 /// <param name="commandType">Type of the command.</param>
 /// <param name="profileId">The profile id.</param>
 /// <returns></returns>
 public static Dictionary<string, CustomizationItemArgumentEntity> GetCustomizationItemArguments(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId)
 {
     return GetCustomizationItemArguments(fullId, structureType, commandType, profileId, null);
 }
コード例 #9
0
 /// <summary>
 /// Gets the customization item.
 /// </summary>
 /// <param name="fullId">The full id.</param>
 /// <param name="profileId">The profile id.</param>
 /// <returns></returns>
 private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId)
 {
     return(GetCustomizationItem(fullId, structureType, commandType, profileId, null));
 }
コード例 #10
0
        /// <summary>
        /// Gets the customization item.
        /// </summary>
        /// <param name="fullId">The full id.</param>
        /// <param name="profileId">The profile id.</param>
        /// <param name="principalId">The principal id.</param>
        /// <returns></returns>
        private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId, PrimaryKeyId?principalId)
        {
            CustomizationItemEntity result = null;

            FilterElementCollection filters = new FilterElementCollection();

            filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldXmlFullId, fullId));
            filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldStructureType, (int)structureType));
            filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldCommandType, (int)commandType));

            // Filter by profile
            if (profileId.HasValue)
            {
                filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldProfileId, profileId.Value));
            }
            else
            {
                filters.Add(FilterElement.IsNullElement(CustomizationItemEntity.FieldProfileId));
            }

            // Filter by principal
            if (principalId.HasValue)
            {
                filters.Add(FilterElement.EqualElement(CustomizationItemEntity.FieldPrincipalId, principalId.Value));
            }
            else
            {
                filters.Add(FilterElement.IsNullElement(CustomizationItemEntity.FieldPrincipalId));
            }

            EntityObject[] items = BusinessManager.List(CustomizationItemEntity.ClassName, filters.ToArray());

            if (items != null && items.Length > 0)
            {
                result = items[0] as CustomizationItemEntity;
            }

            return(result);
        }
コード例 #11
0
 /// <summary>
 /// Gets the customization item.
 /// </summary>
 /// <param name="fullId">The full id.</param>
 /// <returns></returns>
 private static CustomizationItemEntity GetCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType)
 {
     return(GetCustomizationItem(fullId, structureType, commandType, null, null));
 }
コード例 #12
0
        /// <summary>
        /// Creates the navigation item.
        /// </summary>
        /// <param name="structureType">Type of the structure.</param>
        /// <param name="fullId">The full id.</param>
        /// <param name="commandType">Type of the command.</param>
        /// <param name="profileId">The profile id.</param>
        /// <param name="principalId">The principal id.</param>
        /// <returns></returns>
        private static CustomizationItemEntity CreateCustomizationItem(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId, PrimaryKeyId?principalId)
        {
            CustomizationItemEntity item = BusinessManager.InitializeEntity <CustomizationItemEntity>(CustomizationItemEntity.ClassName);

            if (structureType != CustomizationStructureType.Undefined)
            {
                item.StructureType = (int)structureType;
            }
            item.XmlFullId = fullId;
            if (profileId.HasValue)
            {
                item.Properties["ProfileId"].Value = profileId;
            }
            if (principalId.HasValue)
            {
                item.Properties["PrincipalId"].Value = principalId;
            }

            item.CommandType = (int)commandType;

            item.PrimaryKeyId = BusinessManager.Create(item);

            return(item);
        }
コード例 #13
0
        // ------------------- Private methods -------------------
        #region CreateCustomizationItemByParent(string parentFullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId? profileId, PrimaryKeyId? principalId)
        /// <summary>
        /// Creates the navigation item by parent.
        /// </summary>
        /// <param name="structureType">Type of the structure.</param>
        /// <param name="parentFullId">The parent full id.</param>
        /// <param name="commandType">Type of the command.</param>
        /// <param name="profileId">The profile id.</param>
        /// <param name="principalId">The principal id.</param>
        /// <returns></returns>
        private static CustomizationItemEntity CreateCustomizationItemByParent(string parentFullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId, PrimaryKeyId?principalId)
        {
            string fullId = string.Concat(parentFullId, "/", Guid.NewGuid().ToString("D"));

            return(CreateCustomizationItem(fullId, structureType, commandType, profileId, principalId));
        }
コード例 #14
0
        /// <summary>
        /// Gets the customization item arguments.
        /// </summary>
        /// <param name="fullId">The full id.</param>
        /// <param name="structureType">Type of the structure.</param>
        /// <param name="commandType">Type of the command.</param>
        /// <param name="profileId">The profile id.</param>
        /// <param name="principalId">The principal id.</param>
        /// <returns></returns>
        public static Dictionary <string, CustomizationItemArgumentEntity> GetCustomizationItemArguments(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId, PrimaryKeyId?principalId)
        {
            CustomizationItemEntity item = GetCustomizationItem(fullId, structureType, commandType, profileId, principalId);

            if (item != null && item.PrimaryKeyId.HasValue)
            {
                return(GetCustomizationItemArguments(item.PrimaryKeyId.Value));
            }

            return(null);
        }
コード例 #15
0
 /// <summary>
 /// Gets the customization item arguments.
 /// </summary>
 /// <param name="fullId">The full id.</param>
 /// <param name="structureType">Type of the structure.</param>
 /// <param name="commandType">Type of the command.</param>
 /// <param name="profileId">The profile id.</param>
 /// <returns></returns>
 public static Dictionary <string, CustomizationItemArgumentEntity> GetCustomizationItemArguments(string fullId, CustomizationStructureType structureType, ItemCommandType commandType, PrimaryKeyId?profileId)
 {
     return(GetCustomizationItemArguments(fullId, structureType, commandType, profileId, null));
 }