Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FeatureItem"/> class.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="name">The name.</param>
        public FeatureItem(Session session, string name)
        {
            var data = session.OpenView("select * from Feature where Feature = '" + name + "'");

            Dictionary<string, object> row = data.FirstOrDefault();

            if (row != null)
            {
                Name = name;
                ParentName = (string)row["Feature_Parent"];
                Title = (string)row["Title"].ToString();
                Description = (string)row["Description"];

                var defaultState = (InstallState)row["Level"];

                CurrentState = DetectFeatureState(session, name);
                RequestedState = session.IsInstalled() ? CurrentState : defaultState;

                Attributes = (FeatureAttributes)row["Attributes"];
            }
        }