portable-class-library

Portable Class Library equivalent to MethodBase.GetCurrentMethod

左心房为你撑大大i 提交于 2019-12-10 13:32:24
问题 s there Portable Class Library equivalent to MethodBase.GetCurrentMethod? I'm new to PCLs. I'm justing looking into whether I can use a PCL to hold some client code that will definitely be used on Silverlight and may be used elsewhere. Having scanned the source, I can see plenty of calls to MethodBase.GetCurrentMethod which doesn't seem to exist in the PCL. ** EDIT ** I've ripped this sample out of the library in question. IsNullOrEmpty() was using String.IsNullOrWhiteSpace(String) which

How to change the PCL profile in Xamarin.Forms (Portable) Application

我的梦境 提交于 2019-12-10 03:51:58
问题 I just wanted to know about, how to change the PCL profile in Xamarin with Visual Studio 2015 Update 2. While installing some of the package, I am getting an error that, this package is not compatible with the PCL profile 259. Thank You in advance. 回答1: Right-click on the PCL project and select Properties. Then, in the "Library" tab, select the "Change..." button under the Targeting section. Select the targets you want which match the profile you want. 来源: https://stackoverflow.com/questions

Portable Class Library Profile 78 missing attribute related methods/properties

旧城冷巷雨未停 提交于 2019-12-09 17:38:58
问题 In my PCL core project (WP8, Android, iOS, Xamarin, MvvmCross) I use custom attributes. The Type.GetCustomAttributes() extension method lets me examine the attributes used. Using PCL Profile104 this works well. But because I want to use async/await, I'll need to use PCL Profile78 (and .NET 4.5) Problem: Seems the GetCustomAttributes() and the Attributes property are not available in Profile78. Why?? Note: I am looking into the workaround by creating a PCL Profile 104 class library and

Why Activity Indicator Not working In Xamarin.forms?

删除回忆录丶 提交于 2019-12-09 13:03:07
问题 I am trying to display ActivityIndicator After I press a button while I am trying to update The Column Field On DataBase, it is not appearing? What is the problem? On the following My Code: ActivityIndicator ai = new ActivityIndicator() { HorizontalOptions = LayoutOptions.CenterAndExpand, Color = Color.Black }; ai.IsRunning = true; ai.IsEnabled = true; ai.BindingContext = this; ai.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy"); ProcessToCheckOut = new Button { Text = "Set Inf" };

Portable Class Library (PCL) Version Of HttpUtility.ParseQueryString

你。 提交于 2019-12-09 08:35:11
问题 Is there a Portable Class Library (PCL) version Of HttpUtility.ParseQueryString contained in System.Web or some code I could use? I want to read a very complex URL. 回答1: HttpUtility.ParseQueryString returns HttpValueCollection (Internal Class) which inherits from NameValueCollection . NameValueCollection is a collection of key value pairs like a dictionary but it supports duplicates, maintains order and only implements IEnumerable (This collection is pre-generics). NameValueCollection is not

Localization for mobile cross platform using xamarin and issue with iOS only

本小妞迷上赌 提交于 2019-12-09 04:39:07
问题 I have a project in Xamarin which targets Android, iOS and windows phone. I used core (PCL library) to share common code between different platform. I added Resource files (.net resource) .Resx in my core library and to read the culture specific string i used following code snippet in one of my ViewModel: public string GetString() { // CommonResources is the name of my resource file ResourceManager resManager = new ResourceManager(typeof(CommonResources)); return resManager.GetString(

MissingMethodException with Newtonsoft.Json when using TypeNameAssemblyFormat with PCLs

霸气de小男生 提交于 2019-12-09 02:53:10
问题 Is there a problem with using the TypeNameAssemblyFormat with PCLs? I have no problems using any other settings with Newtonsoft.Json except when I use this serialization setting. Here is my Json-related code: var settings = new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.Objects, Formatting = Formatting.Indented, TypeNameAssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Full }; var json = JsonConvert.SerializeObject(obj, settings); var

Portable Class Library Testing

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 20:00:36
问题 So when testing a Portable Class Library without any platform specific code, is testing against just one of the platforms (.net 4.5) from the profile enough? My intuition says no, but I've read some claims otherwise. And if you do need to test against each platform, do any of the multitude of test frameworks out there for .net have a PCL testing library with runners for each or most platforms, so only one DLL of unit tests would be necessary? 回答1: It's usually best to test on all platforms.

System.Security.Cryptography vs PCLCrypto

耗尽温柔 提交于 2019-12-08 18:01:05
问题 We are in the process of gutting a lot of shared functionality in our system and porting it to PCL libraries. I am having an issue using PCLCrypto. I am taking some existing data in our database, and trying to decrypt it with the same algorithm. I get the value back, but there are 16 extra bytes at the end that are just garbage. See Code below: Old Algorithm using System.Security.Cryptography public static string SymmetricEncrypt(this string plaintext, string key, SymmetricAlgorithm algorithm

RuntimeReflectionExtensions.GetRuntimeMethod does not work as expected

两盒软妹~` 提交于 2019-12-08 17:08:23
问题 Does anyone have any clue on why calling GetRuntimeMethod is returning null for the following case? _toListMethod = typeof(Enumerable).GetRuntimeMethod("ToList", new Type[] { typeof(IEnumerable<>) }); It should work just like it does for: _castMethod = typeof(Enumerable).GetRuntimeMethod("Cast", new Type[] { typeof(IEnumerable) }); I tried to debug this by running the following code: var bah = typeof (Enumerable).GetRuntimeMethods().Where(m => m.Name.Contains("ToList")); var derp = bah.First(