示例#1
0
        /// <summary>
        /// Returns a new load pattern class.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <param name="uniqueName">Unique load pattern name.</param>
        /// <returns>Steel.</returns>
        internal static LoadPattern Factory(ApiCSiApplication app, string uniqueName)
        {
            LoadPattern loadPattern = new LoadPattern(app, uniqueName);

            loadPattern.FillData();

            return(loadPattern);
        }
        /// <summary>
        /// Gets all load patterns.
        /// </summary>
        /// <returns>List&lt;LoadPattern&gt;.</returns>
        public static List <LoadPattern> GetAll()
        {
            List <LoadPattern> loadPatterns     = new List <LoadPattern>();
            List <string>      loadPatternNames = GetNameList();

            foreach (var loadPatternName in loadPatternNames)
            {
                LoadPattern loadPattern = Factory(loadPatternName);

                loadPatterns.Add(loadPattern);
            }

            return(loadPatterns);
        }
        /// <summary>
        /// Returns a new load pattern class.
        /// </summary>
        /// <param name="uniqueName">Unique load pattern name.</param>
        /// <returns>Steel.</returns>
        public static LoadPattern Factory(string uniqueName)
        {
            if (Registry.Materials.Keys.Contains(uniqueName))
            {
                return(Registry.LoadPatterns[uniqueName]);
            }

            LoadPattern loadPattern = new LoadPattern(uniqueName);

            if (_loadPattern != null)
            {
                loadPattern.FillData();
            }
            Registry.LoadPatterns.Add(uniqueName, loadPattern);
            return(loadPattern);
        }