Beispiel #1
0
        public Contingency GetContingencies(string enumCode)
        {
            Contingency contingency = null;

            if (Contingencies.TryGetValue(enumCode, out contingency) == true)
            {
                return(contingency);
            }

            return(null);
        }
Beispiel #2
0
        /// <summary>
        /// Initialize a new CIM Line
        /// </summary>
        /// <param name="ElementSource">The XML source for this line</param>
        /// <param name="AddIfNew">Whether to add any new elements that may be created</param>
        public MM_Line(XmlElement ElementSource, bool AddIfNew)
            : base(ElementSource, AddIfNew)
        {
            this.ElemType = MM_Repository.FindElementType("Line");

            if (ElementSource.HasAttribute("Contingencies"))
            {
                String[] splStr = ElementSource.Attributes["Contingencies"].Value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                foreach (string str in splStr)
                {
                    MM_Contingency con = null;
                    MM_Repository.Contingencies.TryGetValue(str, out con);
                    if (con != null && !Contingencies.Any(c => con.Name == c.Name))
                    {
                        this.Contingencies.Add(con);
                    }
                }
            }
        }