示例#1
0
        public PropertyValue GetProperty(PropertyId id)
        {
            FormatStore.NodeEntry[] array = this.nodes.Plane(this.nodeHandle);
            int num = this.nodes.Index(this.nodeHandle);

            if (FlagProperties.IsFlagProperty(id))
            {
                return(array[num].FlagProperties.GetPropertyValue(id));
            }
            if (array[num].PropertyMask.IsSet(id))
            {
                for (int i = 0; i < array[num].Properties.Length; i++)
                {
                    Property property = array[num].Properties[i];
                    if (property.Id == id)
                    {
                        return(property.Value);
                    }
                    if (property.Id > id)
                    {
                        break;
                    }
                }
            }
            return(PropertyValue.Null);
        }
示例#2
0
 public PropertyValue GetDistinctProperty(PropertyId id)
 {
     if (FlagProperties.IsFlagProperty(id))
     {
         return(this.distinctFlagProperties.GetPropertyValue(id));
     }
     else if (this.distinctPropertyMask.IsSet(id))
     {
         return(this.properties[(int)(id - PropertyBitMask.FirstNonFlag)]);
     }
     return(PropertyValue.Null);
 }
示例#3
0
 public PropertyValue GetEffectiveProperty(PropertyId id)
 {
     if (FlagProperties.IsFlagProperty(id))
     {
         return(flagProperties.GetPropertyValue(id));
     }
     else if (propertyMask.IsSet(id))
     {
         return(properties[(int)(id - PropertyBitMask.FirstNonFlag)]);
     }
     return(PropertyValue.Null);
 }
示例#4
0
 public PropertyValue GetDistinctProperty(PropertyId id)
 {
     if (FlagProperties.IsFlagProperty(id))
     {
         return(this.distinctFlagProperties.GetPropertyValue(id));
     }
     if (this.distinctPropertyMask.IsSet(id))
     {
         return(this.properties[(int)(id - PropertyId.FontColor)]);
     }
     return(PropertyValue.Null);
 }
示例#5
0
        public void SetProperty(PropertyId id, PropertyValue value)
        {
            FormatStore.NodeEntry[] array = this.nodes.Plane(this.nodeHandle);
            int num = this.nodes.Index(this.nodeHandle);

            if (FlagProperties.IsFlagProperty(id))
            {
                array[num].FlagProperties.SetPropertyValue(id, value);
                return;
            }
            int i = 0;

            if (array[num].Properties != null)
            {
                while (i < array[num].Properties.Length)
                {
                    Property property = array[num].Properties[i];
                    if (property.Id == id)
                    {
                        array[num].Properties[i].Set(id, value);
                        return;
                    }
                    if (property.Id > id)
                    {
                        break;
                    }
                    i++;
                }
            }
            if (array[num].Properties == null)
            {
                array[num].Properties = new Property[1];
                array[num].Properties[0].Set(id, value);
                array[num].PropertyMask.Set(id);
                return;
            }
            Property[] array2 = new Property[array[num].Properties.Length + 1];
            if (i != 0)
            {
                Array.Copy(array[num].Properties, 0, array2, 0, i);
            }
            if (i != array[num].Properties.Length)
            {
                Array.Copy(array[num].Properties, i, array2, i + 1, array[num].Properties.Length - i);
            }
            array2[i].Set(id, value);
            array[num].Properties = array2;
            array[num].PropertyMask.Set(id);
        }
 // Token: 0x06001BD0 RID: 7120 RVA: 0x000D5B10 File Offset: 0x000D3D10
 private void SetPropertyImpl(int entry, PropertyId id, PropertyValue value)
 {
     if (!FlagProperties.IsFlagProperty(id))
     {
         if (this.PropertyMask.IsSet(id))
         {
             int num;
             int num2;
             this.FindProperty(id, out num, out num2);
             if (num < entry)
             {
                 return;
             }
             if (num == entry)
             {
                 if (this.entries[entry].Properties[num2].Value.IsRefCountedHandle)
                 {
                     this.Store.ReleaseValue(this.entries[entry].Properties[num2].Value);
                 }
                 else if (this.entries[entry].Properties[num2].Value.IsRelativeHtmlFontUnits && value.IsRelativeHtmlFontUnits)
                 {
                     value = new PropertyValue(PropertyType.RelHtmlFontUnits, this.entries[entry].Properties[num2].Value.RelativeHtmlFontUnits + value.RelativeHtmlFontUnits);
                 }
                 this.entries[entry].Properties[num2].Value = value;
                 return;
             }
             this.RemoveProperty(num, num2);
         }
         if (!value.IsNull)
         {
             this.AddProperty(entry, id, value);
         }
         return;
     }
     if (!value.IsNull)
     {
         this.entries[entry].FlagProperties.Set(id, value.Bool);
         return;
     }
     this.entries[entry].FlagProperties.Remove(id);
 }
 // Token: 0x06001BC9 RID: 7113 RVA: 0x000D5474 File Offset: 0x000D3674
 public PropertyValue GetProperty(PropertyId id)
 {
     if (FlagProperties.IsFlagProperty(id))
     {
         for (int i = 0; i < this.topEntry; i++)
         {
             if (this.entries[i].FlagProperties.IsDefined(id))
             {
                 return(this.entries[i].FlagProperties.GetPropertyValue(id));
             }
         }
     }
     else if (this.PropertyMask.IsSet(id))
     {
         int num;
         int num2;
         this.FindProperty(id, out num, out num2);
         return(this.entries[num].Properties[num2].Value);
     }
     return(PropertyValue.Null);
 }