protected override VirtualPropertySet CreateAvailableSet()
 {
     VirtualPropertySet set = new VirtualPropertySet();
     set[0x15] = this.HasThumbnail;
     set[TextPropertyProvider.PropertyEncoding] = true;
     return set;
 }
 protected override VirtualPropertySet CreateAvailableSet()
 {
     VirtualPropertySet set = new VirtualPropertySet();
     if ((this.FVersionInfo == null) && (this.FFileName != null))
     {
         set[11] = true;
         set[0x12] = true;
         set[FileVersionPropertyProvider.PropertyProductVersion] = true;
         set[0x13] = true;
         set[FileVersionPropertyProvider.PropertyProductName] = true;
         set[FileVersionPropertyProvider.PropertyCompanyName] = true;
         return set;
     }
     FileVersionInfo versionInfo = this.GetVersionInfo();
     if (versionInfo != null)
     {
         set[11] = !string.IsNullOrEmpty(versionInfo.FileDescription);
         set[0x12] = versionInfo.FileVersion != null;
         set[FileVersionPropertyProvider.PropertyProductVersion] = versionInfo.ProductVersion != null;
         set[0x13] = !string.IsNullOrEmpty(versionInfo.LegalCopyright);
         set[FileVersionPropertyProvider.PropertyProductName] = !string.IsNullOrEmpty(versionInfo.ProductName);
         set[FileVersionPropertyProvider.PropertyCompanyName] = !string.IsNullOrEmpty(versionInfo.CompanyName);
     }
     return set;
 }
 public static VirtualPropertySet FromNotifyFilters(NotifyFilters filters)
 {
     VirtualPropertySet set = new VirtualPropertySet();
     if ((filters & NotifyFilters.FileName) > 0)
     {
         set[0] = true;
     }
     if ((filters & NotifyFilters.Attributes) > 0)
     {
         set[6] = true;
     }
     if ((filters & NotifyFilters.Size) > 0)
     {
         set[3] = true;
     }
     if ((filters & NotifyFilters.LastWrite) > 0)
     {
         set[8] = true;
     }
     if ((filters & NotifyFilters.LastAccess) > 0)
     {
         set[9] = true;
     }
     if ((filters & NotifyFilters.CreationTime) > 0)
     {
         set[7] = true;
     }
     if ((filters & NotifyFilters.Security) > 0)
     {
         set[14] = true;
     }
     return set;
 }
 protected void ResetAvailableSet()
 {
     bool flag = this.FAvailableSet != null;
     this.FAvailableSet = null;
     if (flag)
     {
         this.OnAvailablePropertiesChanged(EventArgs.Empty);
     }
 }
 public VirtualPropertySet GetRegisteredProperties()
 {
     VirtualPropertySet set = new VirtualPropertySet(new int[] { 0x15 });
     foreach (int num in PropertyMap.Keys)
     {
         set[num] = true;
     }
     return set;
 }
 protected override VirtualPropertySet CreateAvailableSet()
 {
     VirtualPropertySet set = new VirtualPropertySet();
     foreach (int num in this.FProperties.Keys)
     {
         set[num] = true;
     }
     return set;
 }
 protected override VirtualPropertySet CreateAvailableSet()
 {
     VirtualPropertySet set = new VirtualPropertySet();
     set[0x15] = this.CheckCapability(PsdCapability.Thumbnail);
     if (this.CheckCapability(PsdCapability.Size))
     {
         set[PsdPropertyProvider.PropertyImageWidth] = true;
         set[PsdPropertyProvider.PropertyImageHeight] = true;
         set[PsdPropertyProvider.PropertyImageSize] = true;
     }
     set[PsdPropertyProvider.PropertyColorSpace] = this.CheckCapability(PsdCapability.ColorSpace);
     set[PsdPropertyProvider.PropertyBPP] = this.CheckCapability(PsdCapability.BPP);
     set[PsdPropertyProvider.PropertyDPI] = this.CheckCapability(PsdCapability.DPI);
     return set;
 }
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
 {
     if (value is string)
     {
         VirtualPropertySet set = new VirtualPropertySet();
         foreach (string str in StringHelper.SplitString((string) value, new char[] { ',', ' ' }))
         {
             VirtualProperty property = VirtualProperty.Get(str);
             if (property != null)
             {
                 set[property.PropertyId] = true;
             }
         }
         return set;
     }
     return base.ConvertFrom(context, culture, value);
 }
 public VirtualPropertySet GetRegisteredProperties()
 {
     VirtualPropertySet set = new VirtualPropertySet();
     foreach (int num in PropertyTagMap.Values)
     {
         set[num] = true;
     }
     set[11] = true;
     set[0x15] = true;
     set[PropertyImageWidth] = true;
     set[PropertyImageHeight] = true;
     set[PropertyImageSize] = true;
     set[PropertyFrameCount] = true;
     set[PropertyColorSpace] = true;
     set[PropertyBPP] = true;
     set[PropertyDPI] = true;
     return set;
 }
 protected override VirtualPropertySet CreateAvailableSet()
 {
     int[] properties = new int[3];
     properties[1] = 6;
     properties[2] = 20;
     VirtualPropertySet set = new VirtualPropertySet(properties);
     if ((this.Size > 0L) || ((this.Size == 0L) && (this.CompressedSize == 0L)))
     {
         set[3] = true;
     }
     if ((this.CompressedSize > 0L) || ((this.Size == 0L) && (this.CompressedSize == 0L)))
     {
         set[5] = true;
     }
     if (this.CRC > 0)
     {
         set[0x18] = true;
     }
     if (this.LastWriteTime.HasValue)
     {
         set[8] = true;
     }
     return set;
 }
 private void lvProviders_ItemChecked(object sender, ItemCheckedEventArgs e)
 {
     if (e.Item.Tag != null)
     {
         VirtualPropertySet set = new VirtualPropertySet(DefaultProperty.DefaultSet);
         foreach (ListViewItem item in this.lvProviders.Items)
         {
             PropertyProviderInfo tag = (PropertyProviderInfo) item.Tag;
             if ((item.Checked && (tag != null)) && (tag.Provider != null))
             {
                 set.Or(tag.Provider.GetRegisteredProperties());
             }
         }
         this.lvProperties.BeginUpdate();
         try
         {
             foreach (ListViewItem item in this.lvProperties.Items)
             {
                 VirtualProperty property = (VirtualProperty) item.Tag;
                 if (!set[property.PropertyId])
                 {
                     item.Checked = false;
                     item.ForeColor = SystemColors.GrayText;
                 }
                 else if (property.PropertyId != 0)
                 {
                     item.ForeColor = this.lvProperties.ForeColor;
                 }
             }
         }
         finally
         {
             this.lvProperties.EndUpdate();
         }
     }
 }
        public void LoadComponentSettings()
        {
            ListViewItem item;
            VirtualPropertySet set = new VirtualPropertySet(DefaultProperty.DefaultSet);
            this.lvProviders.BeginUpdate();
            try
            {
                this.lvProviders.Items.Clear();
                foreach (string str in StringHelper.SplitString(Settings.Default.DisabledPropertyProviders, new char[] { ',' }))
                {
                    this.DisabledProviders.Add(str, 0);
                }
                foreach (PropertyProviderInfo info in PropertyProviderManager.GetAllProviders())
                {
                    item = new ListViewItem(info.DisplayName) {
                        Tag = info,
                        Checked = !this.DisabledProviders.ContainsKey(info.Key)
                    };
                    IPropertyProvider component = info.Provider;
                    if (component == null)
                    {
                        item.SubItems.Add(Resources.sNotAvailable);
                        item.ForeColor = SystemColors.GrayText;
                    }
                    else
                    {
                        VersionAttribute attribute = TypeDescriptor.GetAttributes(component).OfType<VersionAttribute>().FirstOrDefault<VersionAttribute>();
                        if (attribute != null)
                        {
                            item.SubItems.Add(attribute.Version.ToString());
                        }
                        if (item.Checked)
                        {
                            set.Or(component.GetRegisteredProperties());
                        }
                    }
                    this.lvProviders.Items.Add(item);
                }
            }
            finally
            {
                this.lvProviders.EndUpdate();
            }
            this.lvProperties.BeginUpdate();
            try
            {
                this.lvProperties.Items.Clear();
                Dictionary<int, ListViewGroup> dictionary = new Dictionary<int, ListViewGroup>();
                foreach (VirtualProperty property in (IEnumerable<VirtualProperty>) VirtualProperty.All)
                {
                    ListViewGroup group;
                    if ((property.PropertyOptions & VirtualPropertyOption.Hidden) > 0)
                    {
                        continue;
                    }
                    if (!dictionary.TryGetValue(property.GroupId, out group))
                    {
                        group = new ListViewGroup(property.LocalizedGroupName);
                        this.lvProperties.Groups.Add(group);
                        dictionary.Add(property.GroupId, group);
                    }
                    item = new ListViewItem(property.LocalizedName) {
                        Group = group,
                        Checked = !property.PropertyVisible ? false : set[property.PropertyId],
                        Tag = property
                    };
                    if (!((property.PropertyId != 0) && set[property.PropertyId]))
                    {
                        item.ForeColor = SystemColors.GrayText;
                    }
                    switch (System.Type.GetTypeCode(property.PropertyType))
                    {
                        case TypeCode.Byte:
                        case TypeCode.Int16:
                        case TypeCode.UInt16:
                        case TypeCode.Int32:
                        case TypeCode.UInt32:
                        case TypeCode.Int64:
                        case TypeCode.UInt64:
                            item.ImageIndex = 1;
                            break;

                        case TypeCode.DateTime:
                            item.ImageIndex = 3;
                            break;

                        case TypeCode.String:
                            item.ImageIndex = 2;
                            break;

                        default:
                            if (property.PropertyType == typeof(Version))
                            {
                                item.ImageIndex = 4;
                            }
                            else
                            {
                                item.ImageIndex = 0;
                            }
                            break;
                    }
                    this.lvProperties.Items.Add(item);
                }
            }
            finally
            {
                this.lvProperties.EndUpdate();
            }
        }
 protected override VirtualPropertySet CreateAvailableSet()
 {
     bool flag = this._FileInfo != null;
     VirtualPropertySet set = new VirtualPropertySet();
     set[0x18] = flag;
     set[0x19] = flag;
     set[HashPropertyProvider.PropertyHashSHA1] = flag;
     return set;
 }
Ejemplo n.º 14
0
 public VirtualPropertySet CreateAvailableSet()
 {
     int[] properties = new int[1];
     VirtualPropertySet set = new VirtualPropertySet(properties);
     if (this.FLastWriteTime.HasValue)
     {
         set[8] = true;
     }
     return set;
 }
 protected override VirtualPropertySet CreateAvailableSet()
 {
     VirtualPropertySet set = new VirtualPropertySet();
     set[0x15] = this.HasThumbnail;
     return set;
 }
 private object GetProperty(int propertyId, bool delayed)
 {
     object obj2;
     Tuple<int, int> tuple;
     object obj3;
     if ((this.CachedProperties != null) && this.CachedProperties.TryGetValue(propertyId, out obj2))
     {
         return obj2;
     }
     if (!(((this.ActualAvailableSet == null) || this.ActualAvailableSet[propertyId]) && this.Provider.PropertyFieldMap.TryGetValue(propertyId, out tuple)))
     {
         return null;
     }
     try
     {
         obj2 = this.Provider.GetValue(this.FileName, tuple.Item1, tuple.Item2, delayed);
         if (obj2 == null)
         {
             if (this.ActualAvailableSet == null)
             {
                 this.ActualAvailableSet = this.Provider.GetRegisteredProperties();
             }
             this.ActualAvailableSet[propertyId] = false;
             base.ResetAvailableSet();
         }
         else
         {
             if ((obj2 == WdxFieldInfo.DelayedValue) || (obj2 == WdxFieldInfo.OnDemandValue))
             {
                 return obj2;
             }
             if (this.CachedProperties == null)
             {
                 this.CachedProperties = new Dictionary<int, object>();
             }
             this.CachedProperties.Add(propertyId, obj2);
         }
         obj3 = obj2;
     }
     catch (IOException)
     {
         this.ActualAvailableSet = VirtualPropertySet.Empty;
         base.ResetAvailableSet();
         obj3 = null;
     }
     catch
     {
         this.ActualAvailableSet = VirtualPropertySet.Empty;
         base.ResetAvailableSet();
         throw;
     }
     return obj3;
 }
 protected override VirtualPropertySet CreateAvailableSet()
 {
     VirtualPropertySet set = new VirtualPropertySet();
     set[11] = (this.FDescription == null) || (GetDescription(this.FFileFolder, false) != null);
     return set;
 }
 protected void ClearCache()
 {
     bool flag;
     lock (this.CacheLock)
     {
         flag = (this.CachedProperties != null) && this.CachedProperties.Any<int>();
         this.CachedProperties = null;
         this.SlowCache = null;
         this.FastCacheKeys = null;
         this.FastCacheValues = null;
     }
     if (flag)
     {
         base.ResetAvailableSet();
     }
 }
 protected override VirtualPropertySet CreateAvailableSet()
 {
     VirtualPropertySet set = new VirtualPropertySet();
     set[0x15] = this.HasThumbnail;
     if (this.HasSummary)
     {
         if (this.Summary == null)
         {
             foreach (int num in OlePropertyProvider.PropertyMap.Keys)
             {
                 set[num] = true;
             }
             return set;
         }
         foreach (KeyValuePair<int, int> pair in OlePropertyProvider.PropertyMap)
         {
             set[pair.Key] = this.Summary.ContainsProperty(pair.Value);
         }
     }
     return set;
 }
 public bool Execute(IVirtualFolder folder, ICustomizeFolder customize, ICustomizeFolder defaultCustomize, VirtualPropertySet availableProperties)
 {
     if (folder == null)
     {
         throw new ArgumentNullException("folder");
     }
     if (customize == null)
     {
         throw new ArgumentNullException("customizeFolder");
     }
     this.FAvailableProperties = availableProperties;
     this.FCustomizeFolder = customize;
     this.tsFolder.Add(folder);
     this.btnListBackColor.Color = (customize.BackColor.IsEmpty && (defaultCustomize != null)) ? defaultCustomize.BackColor : customize.BackColor;
     this.btnListForeColor.Color = (customize.ForeColor.IsEmpty && (defaultCustomize != null)) ? defaultCustomize.ForeColor : customize.ForeColor;
     this.chkCustomizeFilter.Enabled = (this.FCustomizeFolder.UpdatableParts & CustomizeFolderParts.Filter) > 0;
     if (this.chkCustomizeFilter.Enabled)
     {
         this.btnCustomizeFilter.Tag = this.FCustomizeFolder.Filter;
         this.chkCustomizeFilter.Checked = this.btnCustomizeFilter.Tag != null;
         if ((this.btnCustomizeFilter.Tag == null) && (defaultCustomize != null))
         {
             this.btnCustomizeFilter.Tag = defaultCustomize.Filter;
         }
     }
     this.chkCustomizeSort.Enabled = (this.FCustomizeFolder.UpdatableParts & CustomizeFolderParts.Sort) > 0;
     if (this.chkCustomizeSort.Enabled)
     {
         this.btnCustomizeSort.Tag = this.FCustomizeFolder.Sort;
         this.chkCustomizeSort.Checked = this.btnCustomizeSort.Tag != null;
         if ((this.btnCustomizeSort.Tag == null) && (defaultCustomize != null))
         {
             this.btnCustomizeSort.Tag = defaultCustomize.Sort;
         }
     }
     this.chkCustomizeView.Enabled = (this.FCustomizeFolder.UpdatableParts & CustomizeFolderParts.View) > 0;
     if (this.chkCustomizeView.Enabled)
     {
         this.FFolderView = this.FCustomizeFolder.View;
         this.chkCustomizeView.Checked = this.FFolderView.HasValue;
         if (this.FFolderView.HasValue)
         {
             this.cmbView.SelectedItem = this.FFolderView.Value;
         }
         else if (defaultCustomize != null)
         {
             this.cmbView.SelectedItem = defaultCustomize.View;
         }
         int? listColumnCount = this.FCustomizeFolder.ListColumnCount;
         if (listColumnCount.HasValue)
         {
             this.FListColumnCount = listColumnCount.Value;
         }
         else if ((defaultCustomize != null) && defaultCustomize.ListColumnCount.HasValue)
         {
             this.FListColumnCount = defaultCustomize.ListColumnCount.Value;
         }
         this.FThumbnailSize = this.FCustomizeFolder.ThumbnailSize;
         if (this.FThumbnailSize.IsEmpty && (defaultCustomize != null))
         {
             this.FThumbnailSize = defaultCustomize.ThumbnailSize;
         }
         this.FThumbnailSpacing = this.FCustomizeFolder.ThumbnailSpacing;
         if (this.FThumbnailSpacing.IsEmpty && (defaultCustomize != null))
         {
             this.FThumbnailSpacing = defaultCustomize.ThumbnailSpacing;
         }
     }
     this.chkCustomizeColumns.Enabled = (this.FCustomizeFolder.UpdatableParts & CustomizeFolderParts.Columns) > 0;
     if (this.chkCustomizeColumns.Enabled)
     {
         this.btnCustomizeColumns.Tag = this.FCustomizeFolder.Columns;
         this.chkCustomizeColumns.Checked = this.btnCustomizeColumns.Tag != null;
         if ((this.btnCustomizeColumns.Tag == null) && (defaultCustomize != null))
         {
             this.btnCustomizeColumns.Tag = defaultCustomize.Columns;
         }
         bool? autoSizeColumns = this.FCustomizeFolder.AutoSizeColumns;
         if (autoSizeColumns.HasValue)
         {
             this.FAutoSizeColumns = autoSizeColumns.Value;
         }
         else if ((defaultCustomize != null) && defaultCustomize.AutoSizeColumns.HasValue)
         {
             this.FAutoSizeColumns = defaultCustomize.AutoSizeColumns.Value;
         }
     }
     Size size = new Size(0x20, 0x20);
     if ((this.FCustomizeFolder.UpdatableParts & CustomizeFolderParts.Icon) == 0)
     {
         this.chkCustomizeIcon.Enabled = false;
         IVirtualItemUI mui = folder as IVirtualItemUI;
         if (mui != null)
         {
             this.picIcon.Image = mui.GetIcon(size, 0);
         }
         else
         {
             this.picIcon.Image = ImageProvider.Default.GetDefaultIcon(DefaultIcon.Drive, size);
         }
     }
     else
     {
         IconLocation icon = this.FCustomizeFolder.Icon;
         if (icon != null)
         {
             this.picIcon.Image = CustomImageProvider.LoadIcon(Environment.ExpandEnvironmentVariables(icon.IconFileName), icon.IconIndex, size);
         }
         if (this.picIcon.Image != null)
         {
             this.txtIconLocation.Text = icon.ToString();
             this.chkCustomizeIcon.Checked = true;
         }
         else
         {
             this.picIcon.Image = ImageProvider.Default.GetDefaultIcon(DefaultIcon.Folder, size);
         }
     }
     this.ViewTypeConverter = TypeDescriptor.GetConverter(typeof(PanelView));
     this.CheckWatcher.RememberValues();
     return (base.ShowDialog() == DialogResult.OK);
 }
 public VirtualItemChangedEventArgs(WatcherChangeTypes changeType, IVirtualItem item) : base(item)
 {
     this.ChangeType = changeType;
     this.PropertySet = VirtualProperty.All;
 }
 public VirtualItemChangedEventArgs(IVirtualItem item, VirtualPropertySet propertySet) : base(item)
 {
     this.ChangeType = WatcherChangeTypes.Changed;
     this.PropertySet = propertySet;
 }
        private void InitializeToolStripItems()
        {
            this.tsmiConditionAll.Tag = AggregatedFilterCondition.All;
            this.tsmiConditionAny.Tag = AggregatedFilterCondition.Any;
            this.tsmiConditionNone.Tag = AggregatedFilterCondition.None;
            this.tsmiContainer.Tag = typeof(ContainerFilterControl);
            this.tsmiName.Tag = typeof(NameFilterControl);
            this.tsmiAttributes.Tag = typeof(AttrFilterControl);
            this.tsmiDate.Tag = typeof(DateFilterControl);
            this.tsmiTime.Tag = typeof(TimeFilterControl);
            this.tsmiSize.Tag = typeof(SizeFilterControl);
            this.tsmiContent.Tag = typeof(ContentFilterControl);
            this.tsmiHexContent.Tag = typeof(HexContentFilterControl);
            this.imgPropertyTag.Images.Add(IconSet.GetImage("PropertyType_Other"));
            this.imgPropertyTag.Images.Add(IconSet.GetImage("PropertyType_Integral"));
            this.imgPropertyTag.Images.Add(IconSet.GetImage("PropertyType_String"));
            this.imgPropertyTag.Images.Add(IconSet.GetImage("PropertyType_DateTime"));
            this.imgPropertyTag.Images.Add(IconSet.GetImage("PropertyType_Version"));
            this.tsmiAdditional.DropDown.ImageList = this.imgPropertyTag;
            if (!base.DesignMode)
            {
                VirtualPropertySet set = new VirtualPropertySet(VirtualProperty.Visible);
                set[0] = false;
                set[1] = false;
                set[6] = false;
                set[3] = false;
                set[7] = false;
                set[9] = false;
                set[8] = false;
                set[0x1b] = false;
                set[0x1a] = false;
                int groupId = -1;
                ToolStripMenuItem item = null;
                foreach (VirtualProperty property in (IEnumerable<VirtualProperty>) set)
                {
                    int num2 = -1;
                    switch (System.Type.GetTypeCode(property.PropertyType))
                    {
                        case TypeCode.Byte:
                        case TypeCode.Int16:
                        case TypeCode.UInt16:
                        case TypeCode.Int32:
                        case TypeCode.UInt32:
                        case TypeCode.Int64:
                            num2 = 1;
                            break;

                        case TypeCode.DateTime:
                            num2 = 3;
                            break;

                        case TypeCode.String:
                            num2 = 2;
                            break;

                        default:
                            if (property.PropertyType != typeof(Version))
                            {
                                continue;
                            }
                            num2 = 4;
                            break;
                    }
                    if (property.GroupId != groupId)
                    {
                        item = new ToolStripMenuItem(property.LocalizedGroupName) {
                            DropDown = { ImageList = this.imgPropertyTag }
                        };
                        this.tsmiAdditional.DropDownItems.Add(item);
                        groupId = property.GroupId;
                    }
                    ToolStripMenuItem item2 = new ToolStripMenuItem {
                        Text = property.LocalizedName,
                        ImageIndex = num2,
                        Tag = property
                    };
                    item2.Click += new EventHandler(this.tsmiProperty_Click);
                    item.DropDownItems.Add(item2);
                }
            }
            this.tsddAddCondition.Image = IconSet.GetImage("ContainerFilterControl.tsddAddCondition.Image");
            this.tsddCondition.DropDownOpening += new EventHandler(this.Condition_DropDownOpening);
            this.tsMatch.Renderer = BorderLessToolStripRenderer.Default;
            this.tsNewCondition.Renderer = this.tsMatch.Renderer;
        }
 protected void AddPropertyToCache(int propertyId, object value)
 {
     lock (this.CacheLock)
     {
         if (this.SlowCache == null)
         {
             if (this.FastCacheKeys == null)
             {
                 if (value != null)
                 {
                     int[] numArray = new int[] { 0, -1, -1, -1, -1, -1, -1 };
                     numArray[0] = propertyId;
                     this.FastCacheKeys = numArray;
                     object[] objArray = new object[7];
                     objArray[0] = value;
                     this.FastCacheValues = objArray;
                 }
             }
             else
             {
                 int num;
                 bool flag = false;
                 if (value == null)
                 {
                     if ((this.CachedProperties != null) && this.CachedProperties[propertyId])
                     {
                         for (num = 0; num < this.FastCacheKeys.Length; num++)
                         {
                             if (this.FastCacheKeys[num] == propertyId)
                             {
                                 this.FastCacheKeys[num] = -1;
                                 this.FastCacheValues[num] = null;
                                 break;
                             }
                         }
                     }
                 }
                 else
                 {
                     flag = true;
                     for (num = 0; num < this.FastCacheKeys.Length; num++)
                     {
                         if ((this.FastCacheKeys[num] < 0) || (this.FastCacheKeys[num] == propertyId))
                         {
                             this.FastCacheKeys[num] = propertyId;
                             this.FastCacheValues[num] = value;
                             flag = false;
                             break;
                         }
                     }
                 }
                 if (flag)
                 {
                     this.SlowCache = new Dictionary<int, object>();
                     for (num = 0; num < this.FastCacheKeys.Length; num++)
                     {
                         this.SlowCache.Add(this.FastCacheKeys[num], this.FastCacheValues[num]);
                     }
                     this.FastCacheKeys = null;
                     this.FastCacheValues = null;
                 }
             }
         }
         if (this.SlowCache != null)
         {
             if (value == null)
             {
                 this.SlowCache.Remove(propertyId);
             }
             else
             {
                 this.SlowCache[propertyId] = value;
             }
         }
         if (this.CachedProperties == null)
         {
             this.CachedProperties = new VirtualPropertySet();
         }
         this.CachedProperties[propertyId] = true;
     }
     if (!(!base.HasAvailableSet || this.AvailableProperties[propertyId]))
     {
         base.ResetAvailableSet();
     }
 }
 public VirtualPropertySet GetRegisteredProperties()
 {
     VirtualPropertySet set = new VirtualPropertySet();
     foreach (int num in this.PropertyFieldMap.Keys)
     {
         set[num] = true;
     }
     return set;
 }
        protected override VirtualPropertySet CreateAvailableSet()
        {
            VirtualPropertySet set = new VirtualPropertySet();
            this.Context.EnterArchiveLock();
            try
            {
                uint numberOfProperties = this.Context.GetNumberOfProperties();
                for (uint i = 0; i < numberOfProperties; i++)
                {
                    string str;
                    ItemPropId id;
                    ushort num3;
                    this.Context.GetPropertyInfo(i, out str, out id, out num3);
                    switch (id)
                    {
                        case ItemPropId.kpidPath:
                            set[0] = true;
                            break;

                        case ItemPropId.kpidIsFolder:
                        case ItemPropId.kpidAttributes:
                        case ItemPropId.kpidEncrypted:
                            set[6] = true;
                            break;

                        case ItemPropId.kpidSize:
                            set[3] = true;
                            break;

                        case ItemPropId.kpidPackedSize:
                            set[5] = true;
                            break;

                        case ItemPropId.kpidCreationTime:
                            set[7] = true;
                            break;

                        case ItemPropId.kpidLastAccessTime:
                            set[9] = true;
                            break;

                        case ItemPropId.kpidLastWriteTime:
                            set[8] = true;
                            break;

                        case ItemPropId.kpidCRC:
                            set[0x18] = true;
                            break;

                        case ItemPropId.kpidMethod:
                            set[20] = true;
                            break;

                        case ItemPropId.kpidComment:
                            set[11] = true;
                            break;
                    }
                }
            }
            finally
            {
                Monitor.Exit(this.Context.ArchiveLock);
            }
            return set;
        }
 protected override VirtualPropertySet CreateAvailableSet()
 {
     VirtualPropertySet set = new VirtualPropertySet();
     lock (this.CacheLock)
     {
         if (this.SlowCache != null)
         {
             foreach (int num in this.SlowCache.Keys)
             {
                 set[num] = true;
             }
         }
         if (this.FastCacheKeys == null)
         {
             return set;
         }
         foreach (int num in this.FastCacheKeys)
         {
             if (num >= 0)
             {
                 set[num] = true;
             }
         }
     }
     return set;
 }
 public static VirtualPropertySet GetGroupSet(int groupId)
 {
     VirtualPropertySet set = new VirtualPropertySet();
     for (int i = 0; i < PropertyList.Count; i++)
     {
         if (PropertyList[i].GroupId == groupId)
         {
             set[i] = true;
         }
     }
     return set;
 }
 public static int RegisterProperty(string name, int groupId, Type type, int length, TypeConverter converter, VirtualPropertyOption options, Func<VirtualProperty, string> getLocalizedNameCallback)
 {
     VirtualProperty property;
     if (PropertyMap.TryGetValue(name, out property))
     {
         throw new ArgumentException(string.Format("Property with name '{0}' already registered.", name));
     }
     if ((converter == null) && type.IsEnum)
     {
         converter = TypeDescriptor.GetConverter(type);
     }
     property = new VirtualProperty(PropertyList.Count, groupId, name, type, length, converter, options, getLocalizedNameCallback);
     PropertyList.Add(property);
     PropertyMap.Add(name, property);
     FAllSet = null;
     FVisibleSet = null;
     return property.PropertyId;
 }
 protected override VirtualPropertySet CreateAvailableSet()
 {
     VirtualPropertySet set = new VirtualPropertySet();
     set[11] = (this.HasCapabilities & ImagePropertyProvider.TagCapability.Properties) > 0;
     set[0x15] = (this.HasCapabilities & ImagePropertyProvider.TagCapability.Thumbnail) > 0;
     foreach (KeyValuePair<PropertyTag, int> pair in ImagePropertyProvider.PropertyTagMap)
     {
         bool flag = false;
         if (this.CheckCapability(ImagePropertyProvider.TagCapability.Dirty))
         {
             flag = this.CheckCapability(ImagePropertyProvider.TagCapability.Properties);
             if (flag && pair.Key.ToString().StartsWith("Exif", StringComparison.OrdinalIgnoreCase))
             {
                 flag = this.CheckCapability(ImagePropertyProvider.TagCapability.Exif);
             }
         }
         else
         {
             flag = (this.ImagePropertyList != null) && this.ImagePropertyList.ContainsKey(pair.Value);
         }
         set[pair.Value] = flag;
     }
     if (this.CheckCapability(ImagePropertyProvider.TagCapability.Size))
     {
         set[ImagePropertyProvider.PropertyImageWidth] = true;
         set[ImagePropertyProvider.PropertyImageHeight] = true;
         set[ImagePropertyProvider.PropertyImageSize] = true;
     }
     set[ImagePropertyProvider.PropertyFrameCount] = this.CheckCapability(ImagePropertyProvider.TagCapability.Frames);
     set[ImagePropertyProvider.PropertyColorSpace] = this.CheckCapability(ImagePropertyProvider.TagCapability.ColorSpace);
     set[ImagePropertyProvider.PropertyBPP] = this.CheckCapability(ImagePropertyProvider.TagCapability.BPP);
     set[ImagePropertyProvider.PropertyDPI] = this.CheckCapability(ImagePropertyProvider.TagCapability.DPI);
     return set;
 }