public override bool CanResetValue(object component) { return(MainName.CanResetValue(component)); }
public override bool CanResetValue(object component) { return(_propDesc.CanResetValue(component)); }
public override bool CanResetValue(object component) { return(subProperty.CanResetValue(parentProperty.GetValue(component))); }
public override bool CanResetValue(object component) { return(parent.CanResetValue(component)); }
public override bool CanResetValue(object component) { return(_descriptor.CanResetValue(component)); }
public override bool CanResetValue(object component) { return(m_basePropertyDescriptor.CanResetValue(component)); }
public override bool CanResetValue(object component) { return(baseDescriptor.CanResetValue(GetWrappedComponent(component))); }
public void SetValue(IDesignerSerializationManager manager, string resourceName, object value, bool forceInvariant, bool shouldSerializeInvariant, bool ensureInvariant, bool applyingCachedResources) { if ((value == null) || value.GetType().IsSerializable) { if (forceInvariant) { if (this.ReadCulture.Equals(CultureInfo.InvariantCulture)) { if (shouldSerializeInvariant) { this.Writer.AddResource(resourceName, value); } } else { Hashtable resourceSet = this.GetResourceSet(CultureInfo.InvariantCulture); if (shouldSerializeInvariant) { resourceSet[resourceName] = value; } else { resourceSet.Remove(resourceName); } this.invariantCultureResourcesDirty = true; } } else { switch (this.CompareWithParentValue(resourceName, value)) { case CompareValue.Different: this.Writer.AddResource(resourceName, value); break; case CompareValue.New: if (!ensureInvariant) { bool flag = true; bool flag2 = false; PropertyDescriptor descriptor = (PropertyDescriptor)manager.Context[typeof(PropertyDescriptor)]; if (descriptor != null) { ExpressionContext context = (ExpressionContext)manager.Context[typeof(ExpressionContext)]; if ((context != null) && (context.Expression is CodePropertyReferenceExpression)) { flag = descriptor.ShouldSerializeValue(context.Owner); flag2 = !descriptor.CanResetValue(context.Owner); } } if (flag) { this.Writer.AddResource(resourceName, value); if (flag2) { this.GetResourceSet(CultureInfo.InvariantCulture)[resourceName] = value; this.invariantCultureResourcesDirty = true; } } break; } this.GetResourceSet(CultureInfo.InvariantCulture)[resourceName] = value; this.invariantCultureResourcesDirty = true; this.Writer.AddResource(resourceName, value); break; } } if (!applyingCachedResources) { this.AddCacheEntry(manager, resourceName, value, false, forceInvariant, shouldSerializeInvariant, ensureInvariant); } } }
public override bool CanResetValue(object component) { return(descriptor.CanResetValue(extender)); }
public override bool CanResetValue(object ignored) { return(_property.CanResetValue(_component)); }
public void ImageListComponentModelTest() { PropertyDescriptor colordepth_prop = TypeDescriptor.GetProperties(typeof(ImageList))["ColorDepth"]; PropertyDescriptor imagesize_prop = TypeDescriptor.GetProperties(typeof(ImageList))["ImageSize"]; PropertyDescriptor transparentcolor_prop = TypeDescriptor.GetProperties(typeof(ImageList))["TransparentColor"]; // create a blank ImageList ImageList il = new ImageList(); // test its defaults #if NET_2_0 Assert.IsTrue(colordepth_prop.ShouldSerializeValue(il), "1"); Assert.IsTrue(colordepth_prop.CanResetValue(il), "2"); Assert.IsTrue(imagesize_prop.ShouldSerializeValue(il), "3"); Assert.IsTrue(imagesize_prop.CanResetValue(il), "4"); Assert.IsTrue(transparentcolor_prop.ShouldSerializeValue(il), "5"); Assert.IsTrue(transparentcolor_prop.CanResetValue(il), "6"); // test what happens when we set the transparent color to LightGray il.TransparentColor = Color.LightGray; Assert.IsFalse(transparentcolor_prop.ShouldSerializeValue(il), "7"); Assert.IsFalse(transparentcolor_prop.CanResetValue(il), "8"); // test what happens when we set the depth to something other than the default il.ColorDepth = ColorDepth.Depth16Bit; Assert.IsTrue(colordepth_prop.ShouldSerializeValue(il), "9"); Assert.IsTrue(colordepth_prop.CanResetValue(il), "10"); // same test for ImageSize il.ImageSize = new Size(32, 32); Assert.IsTrue(imagesize_prop.ShouldSerializeValue(il), "11"); Assert.IsTrue(imagesize_prop.CanResetValue(il), "12"); // create an ImageList containing an image il = new ImageList(); il.Images.Add(Image.FromFile("M.gif")); Assert.IsFalse(colordepth_prop.ShouldSerializeValue(il), "13"); Assert.IsFalse(colordepth_prop.CanResetValue(il), "14"); Assert.IsFalse(imagesize_prop.ShouldSerializeValue(il), "15"); Assert.IsFalse(imagesize_prop.CanResetValue(il), "16"); Assert.IsTrue(transparentcolor_prop.ShouldSerializeValue(il), "17"); Assert.IsTrue(transparentcolor_prop.CanResetValue(il), "18"); // test what happens when we set the transparent color to LightGray il.TransparentColor = Color.LightGray; Assert.IsFalse(transparentcolor_prop.ShouldSerializeValue(il), "19"); Assert.IsFalse(transparentcolor_prop.CanResetValue(il), "20"); // test what happens when we set the depth to something other than the default il.ColorDepth = ColorDepth.Depth16Bit; Assert.IsFalse(colordepth_prop.ShouldSerializeValue(il), "21"); Assert.IsFalse(colordepth_prop.CanResetValue(il), "22"); // same test for ImageSize il.ImageSize = new Size(32, 32); Assert.IsFalse(imagesize_prop.ShouldSerializeValue(il), "23"); Assert.IsFalse(imagesize_prop.CanResetValue(il), "24"); #else Assert.IsFalse(colordepth_prop.ShouldSerializeValue(il), "1"); Assert.IsFalse(colordepth_prop.CanResetValue(il), "2"); Assert.IsFalse(imagesize_prop.ShouldSerializeValue(il), "3"); Assert.IsFalse(imagesize_prop.CanResetValue(il), "4"); Assert.IsTrue(transparentcolor_prop.ShouldSerializeValue(il), "5"); Assert.IsFalse(transparentcolor_prop.CanResetValue(il), "6"); // test what happens when we set the transparent color to LightGray il.TransparentColor = Color.LightGray; Assert.IsFalse(transparentcolor_prop.ShouldSerializeValue(il), "7"); Assert.IsFalse(transparentcolor_prop.CanResetValue(il), "8"); // test what happens when we set the depth to something other than the default il.ColorDepth = ColorDepth.Depth16Bit; Assert.IsTrue(colordepth_prop.ShouldSerializeValue(il), "9"); Assert.IsTrue(colordepth_prop.CanResetValue(il), "10"); // same test for ImageSize il.ImageSize = new Size(32, 32); Assert.IsTrue(imagesize_prop.ShouldSerializeValue(il), "11"); Assert.IsFalse(imagesize_prop.CanResetValue(il), "12"); // create an ImageList containing an image il = new ImageList(); il.Images.Add(Image.FromFile("M.gif")); Assert.IsFalse(colordepth_prop.ShouldSerializeValue(il), "13"); Assert.IsFalse(colordepth_prop.CanResetValue(il), "14"); Assert.IsFalse(imagesize_prop.ShouldSerializeValue(il), "15"); Assert.IsFalse(imagesize_prop.CanResetValue(il), "16"); Assert.IsTrue(transparentcolor_prop.ShouldSerializeValue(il), "17"); Assert.IsFalse(transparentcolor_prop.CanResetValue(il), "18"); // test what happens when we set the transparent color to LightGray il.TransparentColor = Color.LightGray; Assert.IsFalse(transparentcolor_prop.ShouldSerializeValue(il), "19"); Assert.IsFalse(transparentcolor_prop.CanResetValue(il), "20"); // test what happens when we set the depth to something other than the default il.ColorDepth = ColorDepth.Depth16Bit; Assert.IsTrue(colordepth_prop.ShouldSerializeValue(il), "21"); Assert.IsTrue(colordepth_prop.CanResetValue(il), "22"); // same test for ImageSize il.ImageSize = new Size(32, 32); Assert.IsTrue(imagesize_prop.ShouldSerializeValue(il), "23"); Assert.IsFalse(imagesize_prop.CanResetValue(il), "24"); #endif }
public void CanResetValue_ReturnsFalse() { Assert.IsFalse(_descriptor.CanResetValue(_vm)); }
public override bool CanResetValue(object component) { return(property.CanResetValue(extender)); }
public override bool CanResetValue(object component) { return(_originalDescriptor != null && _originalDescriptor.CanResetValue(component)); }
protected override bool ComputeCanResetValue() { return(PropertyDescriptor.CanResetValue(SelectedObject) && !PropertyDescriptor.IsReadOnly); }
public override bool CanResetValue(object component) { object parentValue = Parent.GetValue(component); return(parentValue != null && Child.CanResetValue(parentValue)); }
public override bool CanResetValue(object component) { return(innerProp.CanResetValue(GetRowView(component))); }
public override bool CanResetValue(object component) { return(property.CanResetValue(CorrectExtender(component))); }
public override bool CanResetValue(object component) { return(Property.CanResetValue(component)); }
public override bool CanResetValue(object component) => _basePropertyDescriptor.CanResetValue(component);
public override bool CanResetValue(object component) { return(_originalPropertyDescriptor.CanResetValue(_originalComponent)); }
public override bool CanResetValue(object component) { return(pd.CanResetValue(((Node)component).Drv)); }
public override bool CanResetValue(object component) { return(myInnerDescriptor.CanResetValue(myInnerElement)); }
public override bool CanResetValue(object component) => _descriptor.CanResetValue(component);
public override bool CanResetValue(object o) { return(descriptor.CanResetValue(o)); }
public override bool CanResetValue(object component) { bool canResetValue = descriptor.CanResetValue(component); return(canResetValue); }
public override bool CanResetValue(object component) { return(_originalPropertyDescriptor.CanResetValue(ExtractAvailableGameViewModel(component))); }
override public bool CanResetValue(object obj) { return(_pd.CanResetValue(obj)); }
public override bool CanResetValue(object component) { return(_property.CanResetValue(_target)); }
override public bool CanResetValue(object component) { return(_pd.CanResetValue(component)); }