public override Property Compute(PropertyList propertyList)
        {
            Property computedProperty      = null;
            Property correspondingProperty = propertyList.GetProperty("text-align");

            if (correspondingProperty != null)
            {
                int correspondingValue = correspondingProperty.GetEnum();

                if (correspondingValue == TextAlign.JUSTIFY)
                {
                    computedProperty = new EnumProperty(Constants.START);
                }
                else if (correspondingValue == TextAlign.END)
                {
                    computedProperty = new EnumProperty(Constants.END);
                }
                else if (correspondingValue == TextAlign.START)
                {
                    computedProperty = new EnumProperty(Constants.START);
                }
                else if (correspondingValue == TextAlign.CENTER)
                {
                    computedProperty = new EnumProperty(Constants.CENTER);
                }
            }
            return(computedProperty);
        }
예제 #2
0
        public override Property Compute(PropertyList propertyList)
        {
            Property  computedProperty = null;
            TextAlign textAlign;

            if (propertyList.TryGetTextAlign(out textAlign))
            {
                switch (textAlign)
                {
                case TextAlign.JUSTIFY:
                    computedProperty = new EnumProperty(Constants.START);
                    break;

                case TextAlign.END:
                    computedProperty = new EnumProperty(Constants.END);
                    break;

                case TextAlign.START:
                    computedProperty = new EnumProperty(Constants.START);
                    break;

                case TextAlign.CENTER:
                    computedProperty = new EnumProperty(Constants.CENTER);
                    break;
                }
            }

            return(computedProperty);
        }
예제 #3
0
        public void EnumCtor()
        {
            var enumProp = new EnumProperty(typeof(TestEnum));

            enumProp.EnumValues.Is(TestEnum.Red, TestEnum.Green);
            enumProp.Value.Value.Is(TestEnum.Red);
        }
        public static Node WithEnumPropertyProperty(this Node node, string id, string format, string name = "default", string unit = "", bool settable = false, bool retained = true)
        {
            var prop = new EnumProperty(node, id, format, name, unit, settable, retained);

            node.AddProperty(prop);
            return(node);
        }
예제 #5
0
        public override Property Compute(PropertyList propertyList)
        {
            Property computedProperty = null;
            Property correspondingProperty = propertyList.GetProperty("text-align");
            if (correspondingProperty != null)
            {
                int correspondingValue = correspondingProperty.GetEnum();

                if (correspondingValue == TextAlign.JUSTIFY)
                {
                    computedProperty = new EnumProperty(Constants.START);
                }
                else if (correspondingValue == TextAlign.END)
                {
                    computedProperty = new EnumProperty(Constants.END);
                }
                else if (correspondingValue == TextAlign.START)
                {
                    computedProperty = new EnumProperty(Constants.START);
                }
                else if (correspondingValue == TextAlign.CENTER)
                {
                    computedProperty = new EnumProperty(Constants.CENTER);
                }

            }
            return computedProperty;
        }
예제 #6
0
 protected override void Initialize()
 {
     scene           = GetEnumProperty("scene", typeof(R.E.Scene));
     controller      = GetEnumProperty("controller", typeof(R.E.GameObject));
     isActiveOnLoad  = GetBasicProperty("isActiveOnLoad");
     isStartedOnLoad = GetBasicProperty("isStartedOnLoad");
 }
        protected override void AddAppenderSpecificProperties()
        {
            base.AddAppenderSpecificProperties();

            EnumProperty <SmtpAuthentication> auth = new EnumProperty <SmtpAuthentication>("Authentication:", 60, "authentication");

            auth.PropertyChanged += AuthenticationOnPropertyChanged;

            AddProperty(new RequiredStringProperty("Host:", "smtpHost"));
            AddProperty(new NumericProperty <ushort>("Port:", "port", 25));
            AddProperty(auth);
            AddProperty(new BooleanPropertyBase("Enable SSL:", "enableSsl", false));

            mUsernameIndex = Properties.Count;
            AddRemoveBasedOnMode(auth.SelectedValue, mUsernameIndex, mUsername);

            mPasswordIndex = mUsernameIndex + 1;
            AddRemoveBasedOnMode(auth.SelectedValue, mPasswordIndex, mPassword);

            AddProperty(new RequiredStringProperty("To:", "to"));
            AddProperty(new RequiredStringProperty("From:", "from"));
            AddProperty(new StringValueProperty("Reply To:", "replyTo"));
            AddProperty(new StringValueProperty("Cc:", "cc"));
            AddProperty(new StringValueProperty("Bcc:", "bcc"));
            AddProperty(new StringValueProperty("Subject:", "subject"));
            AddProperty(new Encoding("Subject Encoding:", "subjectEncoding"));
            AddProperty(new Encoding("Body Encoding:", "bodyEncoding"));
            AddProperty(new EnumProperty <MailPriority>("Priority:", 75, "priority"));
        }
        internal static ModelClass DeserializeModelClass(JsonElement element)
        {
            Optional <string>  stringProperty = default;
            EnumProperty       enumProperty   = default;
            Optional <Product> objProperty    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("String_Property"))
                {
                    stringProperty = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("Enum_Property"))
                {
                    enumProperty = property.Value.GetString().ToEnumProperty();
                    continue;
                }
                if (property.NameEquals("Obj_Property"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    objProperty = Product.DeserializeProduct(property.Value);
                    continue;
                }
            }
            return(new ModelClass(stringProperty.Value, enumProperty, objProperty.Value));
        }
예제 #9
0
        public ResponseWrapper <CreateEnumPropertyModel> CreateEnumProperty(CreateEnumPropertyInputModel model)
        {
            var newEntity = new EnumProperty
            {
                Name       = model.Name,
                PropertyId = model.PropertyId,
                Property   =
                    new Property
                {
                    Name         = model.Property.Name,
                    PropertyType = model.Property.PropertyType,
                    EntityId     = model.Property.EntityId,
                },
            };

            context
            .EnumProperties
            .Add(newEntity);

            context.SaveChanges();
            var response = new CreateEnumPropertyModel
            {
                EnumPropertyId = newEntity.EnumPropertyId,
                Name           = newEntity.Name,
                PropertyId     = newEntity.PropertyId,
            };

            return(new ResponseWrapper <CreateEnumPropertyModel>(_validationDictionary, response));
        }
예제 #10
0
        public WinFormsRenderer()
        {
            _nameProperty = new Property("Name", FilterPropertyType.String)
            {
                Value = "Image"
            };
            AddProperty(_nameProperty);

            _sizeProperty = new PointProperty("Size", FilterPropertyType.Size)
            {
                Value = new Size(400, 300)
            };
            AddProperty(_sizeProperty);

            _locationProperty = new PointProperty("Point", FilterPropertyType.Point)
            {
                Value = Point.Empty
            };
            AddProperty(_locationProperty);

            _borderStyleProperty = new EnumProperty("Border", FilterPropertyType.Enum, Enum.GetNames(typeof(FormBorderStyle)))
            {
                Value = FormBorderStyle.Sizable.ToString()
            };
            AddProperty(_borderStyleProperty);

            _zoomProperty = new IntegerProperty("Zoom", 5, 1000, 5)
            {
                Value = 100
            };
            AddProperty(_zoomProperty);

            _inputPin = new InputPin("Image", PinMediaType.Image);
            AddPin(_inputPin);
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void GenerateArgumentEnum(ref CommandLineBuilder builder, Rule rule, EnumProperty property, object value)
        {
            if (string.IsNullOrWhiteSpace(value as string))
            {
                return;
            }

            var result = property.AdmissibleValues.Find(x => x.Name == value as string);

            if (property.AdmissibleValues.Count > 0 && result == null)
            {
                throw new ArgumentException($"Failed to find {value} in {nameof(property.AdmissibleValues)}");
            }

            string switchPrefix = !string.IsNullOrWhiteSpace(property.SwitchPrefix) ? property.SwitchPrefix : rule.SwitchPrefix;

            string evaluatedSwitch = $"{switchPrefix ?? string.Empty}{property.Switch ?? string.Empty}{property.Separator ?? string.Empty}";

            string enumSwitch = $"{result?.SwitchPrefix ?? string.Empty}{result?.Switch ?? string.Empty}";

            if (string.IsNullOrEmpty(enumSwitch))
            {
                return;
            }

            builder.AppendSwitch($"{evaluatedSwitch}{enumSwitch}");
        }
예제 #12
0
        public void Enumをモデルに読み込むことができる()
        {
            var enumModel = new EnumProperty(typeof(DayOfWeek));

            Load(enumModel, DayOfWeek.Tuesday);

            enumModel.EnumValue.Value.Is(DayOfWeek.Tuesday);
        }
 private void OnDestroy()
 {
     scene                = null;
     controller           = null;
     fragments            = null;
     menus                = null;
     activeFragmentOnLoad = null;
 }
 private void Awake()
 {
     scene                = GetEnumProperty("scene", typeof(R.E.Scene));
     controller           = GetEnumProperty("controller", typeof(R.E.GameObject));
     fragments            = GetListProperty("fragments");
     menus                = GetListProperty("menus");
     activeFragmentOnLoad = GetBasicProperty("activeFragmentOnLoad");
 }
예제 #15
0
 protected virtual void OnEnable()
 {
     state = RedpointCenter.Instance.GetRedpointState(m_RedpointId);
     count = RedpointCenter.Instance.GetRedpointCount(m_RedpointId);
     if (state != null && count != null)
     {
         UpdateRedpoint(state.Fetch(), count.Fetch());
     }
 }
예제 #16
0
 protected override void Initialize()
 {
     CustomerNameProperty                       = new TextProperty(this, CustomerName);
     CustomerNameOperatorProperty               = new OperatorProperty(this, CustomerNameOperator);
     CustomerNameOperatorProperty.Size          = 10;
     CustomerNameOperatorProperty.EnumType      = "operators";
     CustomerNameOperatorProperty.HasNullCheck  = true;
     CustomerStoreProperty                      = new TextProperty(this, CustomerStore);
     CustomerStoreOperatorProperty              = new OperatorProperty(this, CustomerStoreOperator);
     CustomerStoreOperatorProperty.Size         = 10;
     CustomerStoreOperatorProperty.EnumType     = "operators";
     CustomerStoreOperatorProperty.HasNullCheck = true;
     DueDateProperty                            = new DateProperty(this, DueDate);
     DueDate2Property                           = new DateProperty(this, DueDate2);
     DueDateOperatorProperty                    = new OperatorProperty(this, DueDateOperator);
     DueDateOperatorProperty.Size               = 10;
     DueDateOperatorProperty.EnumType           = "operators";
     GlobalRegionProperty                       = new EnumProperty(this, GlobalRegion);
     GlobalRegionProperty.Size                  = 50;
     GlobalRegionProperty.EnumType              = "sales territory group";
     OrderDateProperty                          = new DateProperty(this, OrderDate);
     OrderDate2Property                         = new DateProperty(this, OrderDate2);
     OrderDateOperatorProperty                  = new OperatorProperty(this, OrderDateOperator);
     OrderDateOperatorProperty.Size             = 10;
     OrderDateOperatorProperty.EnumType         = "operators";
     SalesOrderNumberProperty                   = new TextProperty(this, SalesOrderNumber);
     SalesOrderNumberProperty.Size              = 25;
     SalesOrderNumberOperatorProperty           = new OperatorProperty(this, SalesOrderNumberOperator);
     SalesOrderNumberOperatorProperty.Size      = 10;
     SalesOrderNumberOperatorProperty.EnumType  = "operators";
     SalesPersonIdProperty                      = new EnumIntProperty(this, SalesPersonId);
     SalesPersonIdProperty.IsMultiValued        = true;
     SalesPersonIdProperty.EnumType             = "sales person";
     SalesPersonIdOperatorProperty              = new OperatorProperty(this, SalesPersonIdOperator);
     SalesPersonIdOperatorProperty.Size         = 10;
     SalesPersonIdOperatorProperty.EnumType     = "operators";
     SalesPersonIdOperatorProperty.HasNullCheck = true;
     StatusProperty                           = new EnumByteProperty(this, Status);
     StatusProperty.Size                      = 10;
     StatusProperty.EnumType                  = "sales order status";
     StatusOperatorProperty                   = new OperatorProperty(this, StatusOperator);
     StatusOperatorProperty.Size              = 10;
     StatusOperatorProperty.EnumType          = "operators";
     TerritoryIdProperty                      = new EnumIntProperty(this, TerritoryId);
     TerritoryIdProperty.Size                 = 10;
     TerritoryIdProperty.EnumType             = "sales territory";
     TerritoryIdOperatorProperty              = new OperatorProperty(this, TerritoryIdOperator);
     TerritoryIdOperatorProperty.Size         = 10;
     TerritoryIdOperatorProperty.EnumType     = "operators";
     TerritoryIdOperatorProperty.HasNullCheck = true;
     TotalDueProperty                         = new MoneyProperty(this, TotalDue);
     TotalDue2Property                        = new MoneyProperty(this, TotalDue2);
     TotalDueOperatorProperty                 = new OperatorProperty(this, TotalDueOperator);
     TotalDueOperatorProperty.Size            = 10;
     TotalDueOperatorProperty.EnumType        = "operators";
 }
예제 #17
0
        protected override void Initialize()
        {
            configuration = Configuration.Get();
            activity      = target as Activity;

            scene      = GetEnumProperty("scene", typeof(R.E.Scene));
            controller = GetEnumProperty("controller", typeof(R.E.GameObject));
            fragments  = GetListProperty("fragments");
            menus      = GetListProperty("menus");
        }
예제 #18
0
        /// <summary>
        ///  [See win32 equivalent.]
        /// </summary>
        public int GetEnumValue(EnumProperty prop)
        {
            // Valid values are 0xfa1 to 0xfaf
            SourceGenerated.EnumValidator.Validate(prop, nameof(prop));

            int val = 0;

            _lastHResult = GetThemeEnumValue(this, Part, State, (int)prop, ref val);
            return(val);
        }
예제 #19
0
        public static void GetInGameRarity(BaseGCosmetic icon, EnumProperty e)
        {
            Package p = Utils.GetPropertyPakPackage("/Game/UI/UIKit/DT_RarityColors");

            if (p != null || p.HasExport())
            {
                var d = p.GetExport <UDataTable>();
                if (d != null)
                {
                    if (e != null && d.TryGetValue(e.Value.String["EXRarity::".Length..], out object r) && r is UObject rarity &&
예제 #20
0
        public void TestEnumPropertyEqualsFalse()
        {
            using (var e = new MockA11yElement())
            {
                e.Orientation = OrientationType.Horizontal;

                var p         = new EnumProperty <OrientationType>(PropertyType.UIA_OrientationPropertyId);
                var condition = p == OrientationType.Vertical;
                Assert.IsFalse(condition.Matches(e));
            } // using
        }
예제 #21
0
 protected void DrawEnumPropertyDropDown(EnumProperty property)
 {
     if (property != null && property.IsValid())
     {
         BeginHorizontal();
         EditorGUILayout.PrefixLabel(property.Name);
         property.CurrentValueIndex = EditorGUILayout.Popup(property.CurrentValueIndex,
                                                            property.ValuesNames);
         EndHorizontal();
     }
 }
예제 #22
0
        public int GetEnumValue(EnumProperty prop)
        {
            if (!System.Windows.Forms.ClientUtils.IsEnumValid(prop, (int)prop, 0xfa1, 0xfaf))
            {
                throw new InvalidEnumArgumentException("prop", (int)prop, typeof(EnumProperty));
            }
            int piVal = 0;

            this.lastHResult = System.Windows.Forms.SafeNativeMethods.GetThemeEnumValue(new HandleRef(this, this.Handle), this.part, this.state, (int)prop, ref piVal);
            return(piVal);
        }
예제 #23
0
        public int GetEnumValue(EnumProperty prop)
        {
            if (!Enum.IsDefined(typeof(EnumProperty), prop))
            {
                throw new System.ComponentModel.InvalidEnumArgumentException("prop", (int)prop, typeof(EnumProperty));
            }

            int result;

            last_hresult = VisualStyles.UxThemeGetThemeEnumValue(theme, this.part, this.state, prop, out result);
            return(result);
        }
예제 #24
0
        public void OnEnumChangedTest()
        {
            bool isCalled = false;

            var prop = new EnumProperty(typeof(Hoge));
            var vm   = new EnumViewModel(prop);

            vm.OnChanged.Subscribe(x => isCalled = true);

            vm.EnumValue.Value = Hoge.B;
            isCalled.IsTrue();
        }
예제 #25
0
 protected void DrawEnumPropertyGrid(EnumProperty property, int nbRows)
 {
     if (property != null && property.IsValid())
     {
         DrawTitleLabel(property.Name);
         property.CurrentValueIndex = GUILayout.SelectionGrid(property.CurrentValueIndex,
                                                              property.ValuesNames,
                                                              nbRows,
                                                              EditorStyles.radioButton);
         EditorGUILayout.Space();
     }
 }
예제 #26
0
        /// <summary>
        ///  [See win32 equivalent.]
        /// </summary>
        public int GetEnumValue(EnumProperty prop)
        {
            // Valid values are 0xfa1 to 0xfaf
            if (!ClientUtils.IsEnumValid(prop, (int)prop, (int)EnumProperty.BackgroundType, (int)EnumProperty.TrueSizeScalingType))
            {
                throw new InvalidEnumArgumentException(nameof(prop), (int)prop, typeof(EnumProperty));
            }

            int val = 0;

            _lastHResult = GetThemeEnumValue(this, Part, State, (int)prop, ref val);
            return(val);
        }
예제 #27
0
        /// <summary>
        ///  [See win32 equivalent.]
        /// </summary>
        public int GetEnumValue(EnumProperty prop)
        {
            //valid values are 0xfa1 to 0xfaf
            if (!ClientUtils.IsEnumValid(prop, (int)prop, (int)EnumProperty.BackgroundType, (int)EnumProperty.TrueSizeScalingType))
            {
                throw new InvalidEnumArgumentException(nameof(prop), (int)prop, typeof(EnumProperty));
            }

            int val = 0;

            lastHResult = SafeNativeMethods.GetThemeEnumValue(new HandleRef(this, Handle), part, state, (int)prop, ref val);
            return(val);
        }
예제 #28
0
        protected EnumProperty NewEnum(string name, string typeName, string value = "")
        {
            EnumProperty prop = new EnumProperty(name, value)
            {
                TypeName = typeName
            };

            Add(prop);
            if (prop.Parent == null)
            {
                throw new Exception("Another property with same name exists!");
            }
            return(prop);
        }
예제 #29
0
        protected override void Initialize()
        {
            logo = GetLogo();

            productNameProperty = GetProductNameProperty();
            companyNameProperty = GetCompanyNameProperty();

            startingScene   = GetEnumProperty("startingScene", typeof(R.E.Scene));
            utilitaryScenes = GetListProperty("utilitaryScenes");

            tags   = GetTagsProperty();
            layers = GetLayersProperty();

            physics2DLayerMatrixProperty = GetPhysics2DLayerMatrixProperty();
        }
예제 #30
0
            public void OnCustomerPersonChanged(object sender, PropertyChangeEventArgs e)
            {
                if (!e.Change.IncludesValue() || DataProperty.Equals(e.OldValue, e.NewValue) ||
                    salesOrder.CustomerObject.PersonIdProperty.Value == null)
                {
                    return;
                }

                LoadCache(Enumerations.PersonCreditCard.EnumName, delegate(LookupTable tbl)
                {
                    EnumProperty p = salesOrder.PaymentObject.CreditCardObject.CreditCardIdProperty;
                    p.SetValue(null);
                    p.LocalLookupTable = tbl;
                    p.FirePropertyChange(new PropertyChangeEventArgs(PropertyChange.Items, null, null));
                });
            }
예제 #31
0
        public void EnumPropertyWrite()
        {
            using (var stream = new MemoryStream())
                using (var writer = new BinaryWriter(stream))
                {
                    var prop = new EnumProperty(EnumName)
                    {
                        Type = EnumType,
                        Name = EnumValue
                    };

                    prop.Serialize(writer);

                    Assert.AreEqual(34, prop.SerializedLength);
                    CollectionAssert.AreEqual(EnumBytes, stream.ToArray());
                }
        }
 private void UpdateProperty(LookupTable tbl, EnumProperty ep)
 {
     ep.SetValue(null);
     ep.LocalLookupTable = tbl;
     ep.FirePropertyChange(new PropertyChangeEventArgs(PropertyChange.Items, null, null));
 }
 public int GetEnumValue(EnumProperty prop)
 {
 }
		public int UxThemeGetThemeEnumValue (IntPtr hTheme, int iPartId, int iStateId, EnumProperty prop, out int result)
		{
			result = 0;
			return (int)S.S_FALSE;
		}
 protected override void Initialize()
 {
     CustomerNameProperty = new TextProperty(this, CustomerName);
     CustomerNameOperatorProperty = new OperatorProperty(this, CustomerNameOperator);
     CustomerNameOperatorProperty.Size = 10;
     CustomerNameOperatorProperty.EnumType = "operators";
     CustomerNameOperatorProperty.HasNullCheck = true;
     CustomerStoreProperty = new TextProperty(this, CustomerStore);
     CustomerStoreOperatorProperty = new OperatorProperty(this, CustomerStoreOperator);
     CustomerStoreOperatorProperty.Size = 10;
     CustomerStoreOperatorProperty.EnumType = "operators";
     CustomerStoreOperatorProperty.HasNullCheck = true;
     DueDateProperty = new DateProperty(this, DueDate);
     DueDate2Property = new DateProperty(this, DueDate2);
     DueDateOperatorProperty = new OperatorProperty(this, DueDateOperator);
     DueDateOperatorProperty.Size = 10;
     DueDateOperatorProperty.EnumType = "operators";
     GlobalRegionProperty = new EnumProperty(this, GlobalRegion);
     GlobalRegionProperty.Size = 50;
     GlobalRegionProperty.EnumType = "sales territory group";
     OrderDateProperty = new DateProperty(this, OrderDate);
     OrderDate2Property = new DateProperty(this, OrderDate2);
     OrderDateOperatorProperty = new OperatorProperty(this, OrderDateOperator);
     OrderDateOperatorProperty.Size = 10;
     OrderDateOperatorProperty.EnumType = "operators";
     SalesOrderNumberProperty = new TextProperty(this, SalesOrderNumber);
     SalesOrderNumberProperty.Size = 25;
     SalesOrderNumberOperatorProperty = new OperatorProperty(this, SalesOrderNumberOperator);
     SalesOrderNumberOperatorProperty.Size = 10;
     SalesOrderNumberOperatorProperty.EnumType = "operators";
     SalesPersonIdProperty = new EnumIntProperty(this, SalesPersonId);
     SalesPersonIdProperty.IsMultiValued = true;
     SalesPersonIdProperty.EnumType = "sales person";
     SalesPersonIdOperatorProperty = new OperatorProperty(this, SalesPersonIdOperator);
     SalesPersonIdOperatorProperty.Size = 10;
     SalesPersonIdOperatorProperty.EnumType = "operators";
     SalesPersonIdOperatorProperty.HasNullCheck = true;
     StatusProperty = new EnumByteProperty(this, Status);
     StatusProperty.Size = 10;
     StatusProperty.EnumType = "sales order status";
     StatusOperatorProperty = new OperatorProperty(this, StatusOperator);
     StatusOperatorProperty.Size = 10;
     StatusOperatorProperty.EnumType = "operators";
     TerritoryIdProperty = new EnumIntProperty(this, TerritoryId);
     TerritoryIdProperty.Size = 10;
     TerritoryIdProperty.EnumType = "sales territory";
     TerritoryIdOperatorProperty = new OperatorProperty(this, TerritoryIdOperator);
     TerritoryIdOperatorProperty.Size = 10;
     TerritoryIdOperatorProperty.EnumType = "operators";
     TerritoryIdOperatorProperty.HasNullCheck = true;
     TotalDueProperty = new MoneyProperty(this, TotalDue);
     TotalDue2Property = new MoneyProperty(this, TotalDue2);
     TotalDueOperatorProperty = new OperatorProperty(this, TotalDueOperator);
     TotalDueOperatorProperty.Size = 10;
     TotalDueOperatorProperty.EnumType = "operators";
 }
        /// <include file='doc\VisualStyleRenderer.uex' path='docs/doc[@for="VisualStyleRenderer.GetEnumValue"]/*' />
        /// <devdoc>
        ///    <para>
        ///       [See win32 equivalent.]
        ///    </para>
        /// </devdoc>
        public int GetEnumValue(EnumProperty prop) {
            //valid values are 0xfa1 to 0xfaf
            if (!ClientUtils.IsEnumValid(prop, (int)prop, (int)EnumProperty.BackgroundType, (int)EnumProperty.TrueSizeScalingType))
            {
                throw new InvalidEnumArgumentException("prop", (int)prop, typeof(EnumProperty));
            }

            int val = 0;
            lastHResult = SafeNativeMethods.GetThemeEnumValue(new HandleRef(this, Handle), part, state, (int)prop, ref val);
            return val;
        }
 public int GetEnumValue(EnumProperty prop)
 {
     if (!System.Windows.Forms.ClientUtils.IsEnumValid(prop, (int) prop, 0xfa1, 0xfaf))
     {
         throw new InvalidEnumArgumentException("prop", (int) prop, typeof(EnumProperty));
     }
     int piVal = 0;
     this.lastHResult = System.Windows.Forms.SafeNativeMethods.GetThemeEnumValue(new HandleRef(this, this.Handle), this.part, this.state, (int) prop, ref piVal);
     return piVal;
 }
예제 #38
0
		public int UxThemeGetThemeEnumValue (IntPtr hTheme, int iPartId, int iStateId, EnumProperty prop, out int result)
		{
			int retval;
			int hresult = UXTheme.GetThemeEnumValue (hTheme, iPartId, iStateId, (int)prop, out retval);

			result = retval;
			return hresult;
		}
		public int GetEnumValue (EnumProperty prop)
		{
			if (!Enum.IsDefined (typeof (EnumProperty), prop))
				throw new System.ComponentModel.InvalidEnumArgumentException ("prop", (int)prop, typeof (EnumProperty));

			int result;
			last_hresult = VisualStyles.UxThemeGetThemeEnumValue (theme, this.part, this.state, prop, out result);
			return result;
		}