Skip to content

Instantly share code, notes, and snippets.

@VincentDondain
Last active February 24, 2017 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VincentDondain/2a92f52e756775fe5d211cdf774aa6f0 to your computer and use it in GitHub Desktop.
Save VincentDondain/2a92f52e756775fe5d211cdf774aa6f0 to your computer and use it in GitHub Desktop.
UIContentSizeCategory GetValue
public static UIContentSizeCategory GetValue (NSString constant)
{
if (constant == null)
throw new ArgumentNullException (nameof (constant));
else if (constant == UIContentSizeCategoryUnspecified)
return UIContentSizeCategory.Unspecified;
else if (constant == UIContentSizeCategoryExtraSmall)
return UIContentSizeCategory.ExtraSmall;
else if (constant == UIContentSizeCategorySmall)
return UIContentSizeCategory.Small;
else if (constant == UIContentSizeCategoryMedium)
return UIContentSizeCategory.Medium;
else if (constant == UIContentSizeCategoryLarge)
return UIContentSizeCategory.Large;
else if (constant == UIContentSizeCategoryExtraLarge)
return UIContentSizeCategory.ExtraLarge;
else if (constant == UIContentSizeCategoryExtraExtraLarge)
return UIContentSizeCategory.ExtraExtraLarge;
else if (constant == UIContentSizeCategoryExtraExtraExtraLarge)
return UIContentSizeCategory.ExtraExtraExtraLarge;
else if (constant == UIContentSizeCategoryAccessibilityMedium)
return UIContentSizeCategory.AccessibilityMedium;
else if (constant == UIContentSizeCategoryAccessibilityLarge)
return UIContentSizeCategory.AccessibilityLarge;
else if (constant == UIContentSizeCategoryAccessibilityExtraLarge)
return UIContentSizeCategory.AccessibilityExtraLarge;
else if (constant == UIContentSizeCategoryAccessibilityExtraExtraLarge)
return UIContentSizeCategory.AccessibilityExtraExtraLarge;
else if (constant == UIContentSizeCategoryAccessibilityExtraExtraExtraLarge)
return UIContentSizeCategory.AccessibilityExtraExtraExtraLarge;
throw new NotSupportedException (constant + " has no associated enum value in " + nameof (UIContentSizeCategory) + " on this platform.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment