Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

[WIP] Bait and switch conversion for plugins #63

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Cheesebaron
Copy link
Member

Don't merge this yet!

This is a work in progress PR for converting plugins to bait and switch.

  • Accelerometer
  • Bookmarks
  • Color
  • DownloadCache
  • Email
  • File
  • Location
  • Network
  • PhoneCall
  • ReflectionEx
  • ResourceLoader
  • Share
  • SoundEffects
  • SQLite-PCL
  • ThreadUtils
  • Visibility
  • WebBrowser
  • Samples?

@Cheesebaron Cheesebaron changed the title [WIP] Hook and bait conversion for plugins [WIP] Bait and switch conversion for plugins Mar 1, 2016
@Cheesebaron
Copy link
Member Author

So I've run into a little problem as I also mentioned on Slack.

Right now by convention MvvmCross is looking for plugin implementations in assemblies ending on .Droid/.iOS/.WindowsPhone etc.

In order to bait and switch to work nicely we should probably look into either:

  1. Explicitly write bootstrap files to tell it where to look, just like the iOS ones
  2. Maybe look into registering stuff using an Attribute, maybe like Xamarin.Forms does it for their IoC?
  3. ???

Any suggestions?

@roubachof
Copy link

I just looked at MvxFilePluginManager: can't we just simplify it ?
I mean if we have bait and switch we could load assembly with name:

        protected virtual string GetPluginAssemblyNameFrom(Type toLoad, string platformDllPostfix)
        {
            // Current implementation
            // return $"{toLoad.Namespace}{platformDllPostfix}{this._assemblyExtension}";            
            return $"{toLoad.Namespace}{this._assemblyExtension}";
        }

we would just drop the private readonly List<string> _platformDllPostfixes; field and delete all the code handling it.

@Cheesebaron
Copy link
Member Author

You are most likely right about this. Will have a deeper look sometime soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants