Example #1
0
    public static void horizontalLinePatternizer(ref ArrayList arrayList, int[] rowNumber, int maxNumber, ResourceItemType itemType, bool isTrack)
    {
        if (isTrack)
        {
            foreach (int row in rowNumber)
            {
                horizontalLineTrackAndItemInserter(ref arrayList, row, itemType);
            }

            if (rowNumber[rowNumber.Length - 1] < maxNumber - 1)
            {
                horizontalLineTrackAndItemInserter(ref arrayList, rowNumber[rowNumber.Length - 1], itemType);
            }
        }
        else
        {
            foreach (int row in rowNumber)
            {
                foreach (ArrayList al in arrayList)
                {
                    if (al.Count < maxNumber)
                    {
                        for (int i = al.Count; i < maxNumber; i++)
                        {
                            al.Add(ResourceItemType.NONE);
                        }
                    }

                    al[row] = itemType;
                }
            }
        }
    }
Example #2
0
        /// <summary>
        /// Prints the name of the resource.
        /// </summary>
        /// <param name="prop">The prop.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="resourceType">Type of the resource.</param>
        /// <returns></returns>
        public static string PrintResourceName(this Property prop, EntityMap entity, ResourceItemType resourceType)
        {
            if (prop == null)
            {
                throw new ArgumentNullException("prop");
            }
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            var rname = string.Format("{0}_{1}", entity.FullName.Replace(".", "_").ToLower(), prop.Name.ToLower());

            return(GetResourceName(rname, resourceType));
        }
Example #3
0
        public static string PrintClassResourceName(string classFullName, ResourceItemType resourceType)
        {
            if (classFullName == null)
            {
                throw new ArgumentNullException("classFullName");
            }

            if (resourceType == ResourceItemType.Description)
            {
                return(classFullName.Replace(".", "_").ToLower() + "_description");
            }
            else
            {
                return(classFullName.Replace(".", "_").ToLower() + "_label");
            }
        }
Example #4
0
        /// <summary>
        /// Prints the name of the resource.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <param name="resourceType">Type of the resource.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">entity</exception>
        public static string PrintResourceName(this EntityMap entity, ResourceItemType resourceType)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            if (resourceType == ResourceItemType.Description)
            {
                return(entity.FullName.Replace(".", "_").ToLower() + "_description");
            }
            else
            {
                return(entity.FullName.Replace(".", "_").ToLower() + "_label");
            }
        }
Example #5
0
 public ResourceItem(
     Guid id,
     Guid resourceId,
     ResourceItemType resourceItemType,
     string name,
     string description,
     bool isPublished,
     bool isPublic
     ) : base(id)
 {
     ResourceId       = resourceId;
     ResourceItemType = resourceItemType;
     Name             = name;
     Description      = description;
     IsPublished      = isPublished;
     IsPublic         = isPublic;
 }
Example #6
0
    static void horizontalLineTrackAndItemInserter(ref ArrayList arrayList, int row, ResourceItemType itemType)
    {
        int mediumTrackNum = row / 2;
        int shortTrackNum  = row % 2;

        foreach (ArrayList al in arrayList)
        {
            for (int i = 0; i < mediumTrackNum; i++)
            {
                al.Add(ResourceItemType.MEDIUM_TRACK);
            }
            for (int i = 0; i < shortTrackNum; i++)
            {
                al.Add(ResourceItemType.SHORT_TRACK);
            }

            al.Add(itemType);
        }
    }
Example #7
0
        static string GetResourceName(string rname, ResourceItemType resourceType)
        {
            switch (resourceType)
            {
            case ResourceItemType.Description:
                return(rname + "_description");

            case ResourceItemType.ErrorWhenMissing:
                return(rname + "_reqError");

            case ResourceItemType.ErrorNull:
                return(string.Concat(rname, "_nullError"));

            case ResourceItemType.ErrorLength:
                return(string.Concat(rname, "_lengthError"));

            case ResourceItemType.Prompt:
                return(rname + "_dispPrompt");

            default:
                return(rname + "_label");
            }
        }
Example #8
0
        /// <summary>
        /// Prints the name of the property resource.
        /// </summary>
        /// <param name="propertyName">Name of the property.</param>
        /// <param name="classFullName">Full name of the class.</param>
        /// <param name="resourceType">Type of the resource.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">
        /// propertyName
        /// or
        /// classFullName
        /// </exception>
        public static string PrintPropertyResourceName(string propertyName, string classFullName, ResourceItemType resourceType)
        {
            if (propertyName == null)
            {
                throw new ArgumentNullException("propertyName");
            }
            if (classFullName == null)
            {
                throw new ArgumentNullException("classFullName");
            }

            var rname = string.Format("{0}_{1}", classFullName.Replace(".", "_").ToLower(), propertyName.ToLower());

            return(GetResourceName(rname, resourceType));
        }
Example #9
0
        public static string PrintResourceName(this ControlInfo controlInfo, EntityMap entity, ResourceItemType resourceType)
        {
            if (controlInfo == null)
            {
                throw new ArgumentNullException("controlInfo");
            }
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            var rname = string.Format("{0}_{1}", entity.FullName.Replace(".", "_").ToLower(), controlInfo.PropertyName.ToLower());

            return(GetResourceName(rname, resourceType));
        }
Example #10
0
        /// <summary>
        /// Prints the name of the property group resource.
        /// </summary>
        /// <param name="propertyGroupName">Name of the property group.</param>
        /// <param name="resourceType">Type of the resource.</param>
        /// <returns></returns>
        public static string PrintPropertyGroupResourceName(string propertyGroupName, ResourceItemType resourceType)
        {
            if (propertyGroupName == null)
            {
                throw new ArgumentNullException("propertyGroupName");
            }

            if (resourceType == ResourceItemType.Description)
            {
                return(string.Format("prop_group_{0}_description", propertyGroupName));
            }
            else
            {
                return(string.Format("prop_group_{0}_label", propertyGroupName));
            }
        }