本文整理汇总了C#中IExtenderProvider类的典型用法代码示例。如果您正苦于以下问题:C# IExtenderProvider类的具体用法?C# IExtenderProvider怎么用?C# IExtenderProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IExtenderProvider类属于命名空间,在下文中一共展示了IExtenderProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterExtenderProvider
public int RegisterExtenderProvider(IExtenderProvider extenderProvider)
{
int cookie = this.lastCookie + 1;
this.extenderProviders.Add(cookie, extenderProvider);
this.lastCookie = cookie;
return cookie;
}
示例2: RemoveExtenderProvider
public void RemoveExtenderProvider (IExtenderProvider provider)
{
if (_extenderProviders != null) {
if (_extenderProviders.Contains (provider))
_extenderProviders.Remove (provider);
}
}
示例3: Create
/// <devdoc>
/// Creates a new ExtenderProvidedPropertyAttribute.
/// </devdoc>
internal static ExtenderProvidedPropertyAttribute Create(PropertyDescriptor extenderProperty, Type receiverType, IExtenderProvider provider) {
ExtenderProvidedPropertyAttribute e = new ExtenderProvidedPropertyAttribute();
e.extenderProperty = extenderProperty;
e.receiverType = receiverType;
e.provider = provider;
return e;
}
示例4: AddExtenderProvider
public void AddExtenderProvider (IExtenderProvider provider)
{
if (_extenderProviders != null) {
if (!_extenderProviders.Contains (provider))
_extenderProviders.Add (provider);
}
}
示例5:
internal ExtenderProvidedPropertyAttribute
(PropertyDescriptor extenderProperty,
IExtenderProvider provider, Type receiverType)
{
this.extenderProperty = extenderProperty;
this.provider = provider;
this.receiverType = receiverType;
}
示例6: CreateAttribute
// Call this method to create a ExtenderProvidedPropertyAttribute and set it's values
internal static ExtenderProvidedPropertyAttribute CreateAttribute (PropertyDescriptor extenderProperty, IExtenderProvider provider, Type receiverType)
{
ExtenderProvidedPropertyAttribute NewAttribute = new ExtenderProvidedPropertyAttribute();
NewAttribute.extender = extenderProperty;
NewAttribute.receiver = receiverType;
NewAttribute.extenderProvider = provider;
return NewAttribute;
}
示例7:
IExtenderProvider[] IExtenderListService.GetExtenderProviders()
{
if (this._providers != null)
{
IExtenderProvider[] array = new IExtenderProvider[this._providers.Count];
this._providers.CopyTo(array, 0);
return array;
}
return new IExtenderProvider[0];
}
示例8: GetExtenderProviders
public IExtenderProvider[] GetExtenderProviders()
{
if (_extenderProviders != null) {
IExtenderProvider[] result = new IExtenderProvider[_extenderProviders.Count];
_extenderProviders.CopyTo (result, 0);
return result;
}
return null;
}
示例9: ArgumentNullException
void IExtenderProviderService.RemoveExtenderProvider(IExtenderProvider provider)
{
if (provider == null)
{
throw new ArgumentNullException("provider");
}
if (this._providers != null)
{
this._providers.Remove(provider);
}
}
示例10: DebugExtendedPropertyDescriptor
/// <devdoc>
/// Creates a new extended property info. Callers can then treat this as
/// a standard property.
/// </devdoc>
public DebugExtendedPropertyDescriptor(DebugReflectPropertyDescriptor extenderInfo, Type receiverType, IExtenderProvider provider, Attribute[] attributes)
: base(extenderInfo, attributes) {
Debug.Assert(extenderInfo != null, "DebugExtendedPropertyDescriptor must have extenderInfo");
Debug.Assert(provider != null, "DebugExtendedPropertyDescriptor must have provider");
ArrayList attrList = new ArrayList(AttributeArray);
attrList.Add(ExtenderProvidedPropertyAttribute.Create(extenderInfo, receiverType, provider));
if (extenderInfo.IsReadOnly) {
attrList.Add(ReadOnlyAttribute.Yes);
}
Attribute[] temp = new Attribute[attrList.Count];
attrList.CopyTo(temp, 0);
AttributeArray = temp;
this.extenderInfo = extenderInfo;
this.provider = provider;
}
示例11: ExtenderShouldSerializeValue
internal bool ExtenderShouldSerializeValue(IExtenderProvider provider, object component) {
provider = (IExtenderProvider)GetDebugInvokee(componentClass, provider);
if (IsReadOnly) {
if (ShouldSerializeMethodValue != null) {
try {
return (bool)ShouldSerializeMethodValue.Invoke(provider, new object[] {component});
}
catch {}
}
return Attributes.Contains(DesignerSerializationVisibilityAttribute.Content);
}
else if (DefaultValue == noValue) {
if (ShouldSerializeMethodValue != null) {
try {
return (bool)ShouldSerializeMethodValue.Invoke(provider, new object[] {component});
}
catch {}
}
return true;
}
return !object.Equals(DefaultValue, ExtenderGetValue(provider, component));
}
示例12: ExtenderSetValue
internal void ExtenderSetValue(IExtenderProvider provider, object component, object value, PropertyDescriptor notifyDesc) {
if (provider != null) {
ISite site = GetSite(component);
IComponentChangeService changeService = null;
object oldValue = null;
// Announce that we are about to change this component
//
if (site != null) {
changeService = (IComponentChangeService)site.GetService(typeof(IComponentChangeService));
Debug.Assert(!CompModSwitches.CommonDesignerServices.Enabled || changeService != null, "IComponentChangeService not found");
}
// Make sure that it is ok to send the onchange events
//
if (changeService != null) {
oldValue = ExtenderGetValue(provider, component);
try {
changeService.OnComponentChanging(component, notifyDesc);
}
catch (CheckoutException coEx) {
if (coEx == CheckoutException.Canceled) {
return;
}
throw coEx;
}
}
provider = (IExtenderProvider)GetDebugInvokee(componentClass, provider);
if (SetMethodValue != null) {
SetMethodValue.Invoke(provider, new object[] { component, value});
// Now notify the change service that the change was successful.
//
if (changeService != null) {
changeService.OnComponentChanged(component, notifyDesc, oldValue, value);
}
}
}
}
示例13: ExtenderGetValue
internal object ExtenderGetValue(IExtenderProvider provider, object component) {
if (provider != null) {
provider = (IExtenderProvider)GetDebugInvokee(componentClass, provider);
return GetMethodValue.Invoke(provider, new object[] { component});
}
return null;
}
示例14: ExtenderGetType
internal Type ExtenderGetType(IExtenderProvider provider) {
return PropertyType;
}
示例15: ExtenderCanResetValue
internal bool ExtenderCanResetValue(IExtenderProvider provider, object component) {
if (DefaultValue != noValue) {
return !object.Equals(ExtenderGetValue(provider, component),defaultValue);
}
MethodInfo reset = ResetMethodValue;
if (reset != null) {
MethodInfo shouldSerialize = ShouldSerializeMethodValue;
if (shouldSerialize != null) {
try {
provider = (IExtenderProvider)GetDebugInvokee(componentClass, provider);
return (bool)shouldSerialize.Invoke(provider, new object[] { component});
}
catch {}
}
}
else {
return true;
}
return false;
}