public void SetBinding(BindingSource bindingSource)
 {
     if (!object.ReferenceEquals(this.dataSource, bindingSource))
     {
         if (this.dataSource != null)
         {
             foreach (object obj in this.FeatureListView.Items)
             {
                 FeatureLauncherListViewItem featureLauncherListViewItem = (FeatureLauncherListViewItem)obj;
                 if (!string.IsNullOrEmpty(featureLauncherListViewItem.StatusPropertyName) && base.DataBindings[featureLauncherListViewItem.StatusBindingName] != null)
                 {
                     base.DataBindings[featureLauncherListViewItem.StatusBindingName].Format -= this.Binding_Format;
                     base.DataBindings[featureLauncherListViewItem.StatusBindingName].Parse  -= this.Binding_Parse;
                     base.DataBindings.Remove(base.DataBindings[featureLauncherListViewItem.StatusBindingName]);
                 }
             }
         }
         this.dataSource = bindingSource;
         if (this.dataSource != null)
         {
             foreach (object obj2 in this.FeatureListView.Items)
             {
                 FeatureLauncherListViewItem featureLauncherListViewItem2 = (FeatureLauncherListViewItem)obj2;
                 if (!string.IsNullOrEmpty(featureLauncherListViewItem2.StatusPropertyName))
                 {
                     Binding binding = new Binding(featureLauncherListViewItem2.StatusBindingName, bindingSource, featureLauncherListViewItem2.StatusPropertyName, true, featureLauncherListViewItem2.DataSourceUpdateMode);
                     binding.Format += this.Binding_Format;
                     binding.Parse  += this.Binding_Parse;
                     base.DataBindings.Add(binding);
                 }
             }
         }
     }
 }
        internal void UpdateFeatureItem(FeatureLauncherListViewItem featureItem)
        {
            FeatureLauncherPropertyControl featureLauncherPropertyControl = base.HostControl as FeatureLauncherPropertyControl;

            featureItem = (featureItem ?? (featureLauncherPropertyControl.FeatureListView.FirstSelectedItem as FeatureLauncherListViewItem));
            if (featureItem != null)
            {
                if (base[featureItem.StatusBindingName] == 3)
                {
                    featureItem.IsLocked = true;
                    if (object.ReferenceEquals(featureItem, featureLauncherPropertyControl.FeatureListView.FirstSelectedItem))
                    {
                        featureLauncherPropertyControl.PropertiesButton.Enabled = false;
                        featureLauncherPropertyControl.EnableButton.Enabled     = false;
                        featureLauncherPropertyControl.DisableButton.Enabled    = false;
                    }
                    featureLauncherPropertyControl.FeatureListView.DrawLockedIcon = true;
                    featureLauncherPropertyControl.FeatureListView.Invalidate();
                    return;
                }
                if (featureLauncherPropertyControl.EnablingButtonsVisible)
                {
                    featureItem.BulkEditing = (base[featureItem.StatusBindingName] != 0);
                    if (featureItem.BulkEditing && object.ReferenceEquals(featureItem, featureLauncherPropertyControl.FeatureListView.FirstSelectedItem))
                    {
                        featureLauncherPropertyControl.PropertiesButton.Enabled = (featureLauncherPropertyControl.PropertiesButton.Enabled && base[featureItem.StatusBindingName] != 2 && !featureItem.EnablePropertiesButtonOnFeatureStatus);
                        bool flag = base[featureItem.StatusBindingName] != 2;
                        flag = (flag && (featureLauncherPropertyControl.EnableButton.Enabled || featureLauncherPropertyControl.DisableButton.Enabled));
                        featureLauncherPropertyControl.EnableButton.Enabled  = flag;
                        featureLauncherPropertyControl.DisableButton.Enabled = flag;
                    }
                }
            }
        }
        void ISpecifyPropertyState.SetPropertyState(string propertyName, PropertyState state, string message)
        {
            FeatureLauncherListViewItem featureListItemByPropertyName = this.GetFeatureListItemByPropertyName(propertyName);

            featureListItemByPropertyName.IsBanned      = (state == PropertyState.UnsupportedVersion);
            featureListItemByPropertyName.BannedMessage = message;
            this.UpdateStatusWhenSelectionChanged();
        }
 public void Add(FeatureLauncherListViewItem item)
 {
     this.featureListView.Items.Add(item);
     if (item.Icon != null)
     {
         this.iconLibrary.Icons.Add(item.Text, item.Icon);
         item.ImageIndex = this.iconLibrary.Icons.Count - 1;
     }
 }
 private FeatureLauncherListViewItem GetFeatureListItemByUniqueName(string identity)
 {
     foreach (object obj in this.featureListView.Items)
     {
         FeatureLauncherListViewItem featureLauncherListViewItem = (FeatureLauncherListViewItem)obj;
         if (featureLauncherListViewItem.UniqueName.Equals(identity))
         {
             return(featureLauncherListViewItem);
         }
     }
     return(null);
 }
        public override PropertyDescriptorCollection GetCustomProperties(Attribute[] attributes)
        {
            PropertyDescriptorCollection propertyDescriptorCollection = new PropertyDescriptorCollection(null);

            foreach (object obj in this.featureListView.Items)
            {
                FeatureLauncherListViewItem featureLauncherListViewItem = (FeatureLauncherListViewItem)obj;
                PropertyDescriptor          propertyDescriptor          = TypeDescriptor.GetProperties(featureLauncherListViewItem)["Status"];
                propertyDescriptorCollection.Add(new DynamicPropertyDescriptor(base.GetType(), featureLauncherListViewItem.UniqueName, propertyDescriptor));
            }
            return(propertyDescriptorCollection);
        }
 private FeatureLauncherListViewItem GetFeatureListItemByPropertyName(string propertyName)
 {
     foreach (object obj in this.featureListView.Items)
     {
         FeatureLauncherListViewItem featureLauncherListViewItem = (FeatureLauncherListViewItem)obj;
         if (featureLauncherListViewItem.StatusBindingName.Equals(propertyName))
         {
             return(featureLauncherListViewItem);
         }
     }
     return(null);
 }
        protected override void OnStateChanged(BulkEditorAdapter sender, BulkEditorStateEventArgs e)
        {
            base.OnStateChanged(sender, e);
            Control hostControl = base.HostControl;
            FeatureLauncherListViewItem featureLauncherListViewItem = this.FindItemByPropertyName(e.PropertyName);

            this.UpdateFeatureItem(featureLauncherListViewItem);
            if (featureLauncherListViewItem != null && base[e.PropertyName] == null)
            {
                featureLauncherListViewItem.FireStatusChanged();
            }
        }
        protected override IList <string> InnerGetManagedProperties()
        {
            IList <string> list = base.InnerGetManagedProperties();
            FeatureLauncherPropertyControl featureLauncherPropertyControl = base.HostControl as FeatureLauncherPropertyControl;

            foreach (object obj in featureLauncherPropertyControl.FeatureListView.Items)
            {
                FeatureLauncherListViewItem featureLauncherListViewItem = (FeatureLauncherListViewItem)obj;
                list.Add(featureLauncherListViewItem.StatusBindingName);
            }
            return(list);
        }
        private FeatureLauncherListViewItem FindItemByPropertyName(string propertyName)
        {
            FeatureLauncherListViewItem    result = null;
            FeatureLauncherPropertyControl featureLauncherPropertyControl = base.HostControl as FeatureLauncherPropertyControl;

            foreach (object obj in featureLauncherPropertyControl.FeatureListView.Items)
            {
                FeatureLauncherListViewItem featureLauncherListViewItem = (FeatureLauncherListViewItem)obj;
                if (featureLauncherListViewItem.StatusBindingName.Equals(propertyName))
                {
                    result = featureLauncherListViewItem;
                    break;
                }
            }
            return(result);
        }