summaryrefslogtreecommitdiff
path: root/docs/Xamarin.Forms.Core/Xamarin.Forms/ExportEffectAttribute.xml
blob: 566e000cfc61d556b493dda6f5f122d7c753f2e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<Type Name="ExportEffectAttribute" FullName="Xamarin.Forms.ExportEffectAttribute">
  <TypeSignature Language="C#" Value="public class ExportEffectAttribute : Attribute" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ExportEffectAttribute extends System.Attribute" />
  <AssemblyInfo>
    <AssemblyName>Xamarin.Forms.Core</AssemblyName>
    <AssemblyVersion>2.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>System.Attribute</BaseTypeName>
  </Base>
  <Interfaces />
  <Attributes>
    <Attribute>
      <AttributeName>System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)</AttributeName>
    </Attribute>
  </Attributes>
  <Docs>
    <summary>Attribute that identifies a <see cref="T:Xamarin.Forms.Effect" /> with a unique identifier that can be used with <see cref="MXamarin.Forms.Effect.Resolve" /> to locate an effect.</summary>
    <remarks>
      <para>Developers must supply a name that is unique over the scope of the value that was supplied to <see cref="T:Xamarin.Forms.ResolutionGroupNameAttribute" />. The <see cref="T:Xamarin.Forms.Effect.Resolve" /> method takes a string that is the concatenation of the the resolution group name that was provided to <see cref="T:Xamarin.Forms.ResolutionGroupNameAttribute" />, '<c>.</c>', and the name that was supplied to <see cref="T:Xamarin.Forms.ExportEffectAttribute" />, and returns an effect that will have the type <paramref name="effectType" />.</para>
      <example>
        <para>For example, with the declarations:</para>
        <code lang="c#"><![CDATA[
        [assembly: ResolutionGroupName ("com.YourCompany")]
        [assembly: ExportEffect (typeof (ShadowEffect), "ShadowEffect")]]]></code>
        <para>Then the code below will add the effect to a button:</para>
        <code lang="c#"><![CDATA[
        [var button = new Button { Text = "I have a shadow" };
button.Effects.Add (Effect.Resolve ("com.YourCompany.ShadowEffect"));]]></code>
      </example>
    </remarks>
    <altmember cref="T:Xamarin.Forms.ResolutionGroupNameAttribute" />
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public ExportEffectAttribute (Type effectType, string uniqueName);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Type effectType, string uniqueName) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Parameters>
        <Parameter Name="effectType" Type="System.Type" />
        <Parameter Name="uniqueName" Type="System.String" />
      </Parameters>
      <Docs>
        <param name="effectType">The type of the marked <see cref="T:Xamarin.Forms.Effect" />.</param>
        <param name="uniqueName">A unique name for the <see cref="T:Xamarin.Forms.Effect" />.</param>
        <summary>Creates a new <see cref="T:Xamarin.Forms.ExportEffectAttribute" />.</summary>
        <remarks>
          <para>Developers must supply a <paramref name="uniqueName" /> that is unique over the scope of the value that was supplied to <see cref="T:Xamarin.Forms.ResolutionGroupNameAttribute" />. The <see cref="T:Xamarin.Forms.Effect.Resolve" /> method takes a string that is the concatenation of the the resolution group name that was provided to <see cref="T:Xamarin.Forms.ResolutionGroupNameAttribute" />, '<c>.</c>', and the name that was supplied to <see cref="T:Xamarin.Forms.ExportEffectAttribute" />, and returns an effect that will have the type <paramref name="effectType" />.</para>
          <example>
            <para>For example, with the declarations:</para>
            <code lang="c#"><![CDATA[
        [assembly: ResolutionGroupName ("com.YourCompany")]
        [assembly: ExportEffect (typeof (ShadowEffect), "ShadowEffect")]]]></code>
            <para>Then the code below will add the effect to a button:</para>
            <code lang="c#"><![CDATA[
        [var button = new Button { Text = "I have a shadow" };
button.Effects.Add (Effect.Resolve ("com.YourCompany.ShadowEffect"));]]></code>
          </example>
        </remarks>
        <altmember cref="T:Xamarin.Forms.ResolutionGroupNameAttribute" />
      </Docs>
    </Member>
  </Members>
</Type>