-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1188 from dbeattie71/4.0
Fix merge of PR 1186
- Loading branch information
Showing
6 changed files
with
39 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Cirrious/Cirrious.MvvmCross.Droid.FullFragging/MvxFragmentAttributeExtensionMethods.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// MvxConventionAttributeExtensionMethods.cs | ||
// (c) Copyright Cirrious Ltd. http://www.cirrious.com | ||
// MvvmCross is licensed using Microsoft Public License (Ms-PL) | ||
// Contributions and inspirations noted in readme.md and license.txt | ||
// | ||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com | ||
|
||
using System; | ||
using System.Linq; | ||
|
||
namespace Cirrious.MvvmCross.Droid.FullFragging | ||
{ | ||
public static class MvxFragmentAttributeExtensionMethods | ||
{ | ||
public static bool IsCacheableFragmentAttribute(this Type candidateType) | ||
{ | ||
var attributes = candidateType.GetCustomAttributes(typeof(MvxFragmentAttribute), true); | ||
return attributes.Length > 0; | ||
} | ||
|
||
public static MvxFragmentAttribute GetCacheableFragmentAttribute(this Type fromFragmentType) | ||
{ | ||
var attributes = fromFragmentType.GetCustomAttributes(typeof (MvxFragmentAttribute), true); | ||
|
||
if (!attributes.Any()) | ||
throw new InvalidOperationException($"Type does not have {nameof(MvxFragmentAttribute)} attribute!"); | ||
|
||
var cacheableFragmentAttribute = attributes.First() as MvxFragmentAttribute; | ||
return cacheableFragmentAttribute; | ||
} | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
...rrious.MvvmCross.Droid.FullFragging/MvxOwnedViewModelFragmentAttributeExtensionMethods.cs
This file was deleted.
Oops, something went wrong.