Esempio n. 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)
        {
            // Debug.Assert(false);

            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"];
                Description = (string)row["Description"];

                RawDisplay = (int)row["Display"];
                Display    = RawDisplay.MapToFeatureDisplay();

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

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

                Attributes = (FeatureAttributes)row["Attributes"];
            }
        }
Esempio n. 2
0
        public void ImportujAtrybutyWarstwyKolumnowo(AttributeLayer layer)
        {
            foreach (GeometryFeature gf in Features)
            {
                string            geomValue  = gf.Value;
                FeatureAttributes attributes = layer.CommonAttributes;

                foreach (LayerField field in _schema.Fields)
                {
                    string value = attributes[field.Name];

                    string variableName = "[" + _schema.GeomKey + "]";
                    value = value.Replace(variableName, geomValue);

                    gf.Attributes[field.Name] = value;
                }
            }
        }
Esempio n. 3
0
        public void ImportujAtrybutyWarstwy(AttributeLayer layer)
        {
            foreach (KeyValuePair <string, GeometryFeature> kv in _features)
            {
                GeometryFeature gf        = kv.Value;
                string          geomValue = kv.Key;

                if (layer.ContainsKey(geomValue))
                {
                    FeatureAttributes attributes = layer[geomValue];

                    gf.Attributes = attributes;
                }
                else
                {
                    throw new Exception("Brak atrybutów dla zasięgu: " + geomValue);
                }
            }
        }
Esempio n. 4
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"];
            }
        }