https://bugzilla.novell.com/show_bug.cgi?id=665840
https://bugzilla.novell.com/show_bug.cgi?id=665840#c0 Summary: Need a macro to replace tokens in attribute string constants (eg: __PackageName__ ) Classification: Mono Product: MonoDroid Version: SVN Platform: Other OS/Version: Other Status: NEW Severity: Enhancement Priority: P5 - None Component: Class Libraries AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10 Here's the scenario. For C2DM, I need to generate a manifest like this: <!-- Only C2DM servers can send messages for the app. If permission is not set - any other app can generate it --> <receiver android:name="{YOUR.PACKAGE}.C2dmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"> <!-- Receive the actual message --> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="{YOUR.PACKAGE}" /> </intent-filter> <!-- Receive the registration id --> <intent-filter> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="{YOUR.PACKAGE}" /> </intent-filter> </receiver> So, in the code I can use attributes to do most of this: [BroadcastReceiver(Permission="com.google.android.c2dm.permission.SEND")] [IntentFilter(new string[] { "com.google.android.c2dm.permission.RECEIVE", "com.google.android.c2dm.intent.REGISTRATION" }, Categories=new string[]{ "__PackageName__" })] public class C2dmBroadcastReceiver : BroadcastReceiver { ... } However note that i put __PackageName__ as the category. I need to somehow have this automatically replaced with the real package name. I realize I could type in the string manually, however I'm using this for my C2DM-Sharp library, and I won't know the package name at this point (this is a MonoDroid Library, so ideally the __PackageName__ gets replaced with the package name of the app which is referencing this library). Reproducible: Always -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
