Exemple #1
0
        private void ItemDelete_Click(object sender, RoutedEventArgs e)
        {
            CustomItemPropertyData cipd = lvDetails.SelectedItem as CustomItemPropertyData;

            if (ReadOnlyProperties.Contains(cipd.Property))
            {
                return;
            }
            if (NameTypeProtectedProperties.Contains(cipd.Property))
            {
                return;
            }
            if (DatasetManager.CategoryProperties.Contains(cipd.Property))
            {
                return;
            }
            lvDetails.Items.Remove(cipd);
            Item.Properties.Remove(cipd.ItemProperty);
        }
Exemple #2
0
        void AddItemProperty(ItemProperty ip)
        {
            CustomItemPropertyData cipd = new CustomItemPropertyData(ip);

            if (ReadOnlyProperties.Contains(ip.Property))
            {
                cipd.IsEditable = false;
            }
            else
            {
                cipd.IsEditable = true;
            }
            if (NameTypeProtectedProperties.Contains(ip.Property))
            {
                cipd.EditProperty = cipd.EditType = false;
            }
            else if (DatasetManager.CategoryProperties.Contains(ip.Property))
            {
                cipd.EditProperty = false;
                cipd.AnyType      = false;
            }
            if (!cipd.EditProperty)
            {
                cipd.AvailableProperties = new List <string> {
                    ip.Property
                }
            }
            ;
            else
            {
                cipd.AvailableProperties = AvailableProperties;
            }
            if (cipd.EditType)
            {
                cipd.SetAvailableTypes();
            }
            lvDetails.Items.Add(cipd);
        }