我正在使用Xamarin.iOS作为使用AVAudioEngine的应用程序.
有时我得到这个例外:
AVFoundation_AVAudioPlayerNode_Play由于未捕获的异常'com.apple.coreaudio.avfaudio'而终止应用程序,原因:'必需条件为false:_engine-> IsRunning()'
这指向我的代码:
private Dictionary<AudioTrack, AVAudioPlayerNode> _dicPlayerNodes;
private void PlayAudio()
{
try
{
NSError err;
if (Engine.StartAndReturnError(out err))
{
foreach (var audioTrack in _dicPlayerNodes)
{
AVAudioPlayerNode node = audioTrack.Value;
node.Play();
}
}
else
{
Messenger.Publish(new AudioErrorMessage(this) { Platform = "IOS", Code = Convert.ToInt32(err.Code), Message = err.LocalizedDescription ?? err.Description });
_exceptionHandlerService.PostHockeyApp(new Exception($"{err.Code} {err.Description}"));
}
}
catch (Exception ex)
{
_exceptionHandlerService.PostExceptionAsync(ex).Forget();
}
}
Run Code Online (Sandbox Code Playgroud)
我不明白怎么可能有这个异常引擎没有运行,因为在我的代码中我启动它并获得错误,如果它无法启动...然后播放它.
此外,我有一个尝试捕获在这种情况下不工作:(所以我的应用程序刚刚崩溃.
有什么建议或想法吗?
我来到这个主题,但它无法帮助我理解:https: //forums.developer.apple.com/thread/27980
IOS版本:10.3.3
设备:ipad 2
Xamarin.ios:11.2.0.11
谢谢
我只是将Web essentials和Typescript更新到新版本.
结果我的项目不再工作了.
这是我的打字稿代码:
/// <reference path="DefinitelyTyped/jqueryui.d.ts" />
/// <reference path="DefinitelyTyped/jquery-datatable.d.ts" />
import Common = module("Common");
import GMap = module("GMap");
declare var $: JQueryStatic;
export class Polygon extends GMap.Polygon {
Run Code Online (Sandbox Code Playgroud)
在更新之前,我生成的代码(有效)是:
var __extends = this.__extends || function (d, b) {
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
define(["require", "exports", "GMap", "Common"], function(require, exports, __GMap__, __Common__) {
var GMap = __GMap__;
var Common = __Common__;
var Polygon = (function (_super) {
__extends(Polygon, _super); …Run Code Online (Sandbox Code Playgroud) 我有一个问题是使用$ formatters.
我的目标是隐藏电话号码,只留下最后4个字符.如果你不在输入中写任何东西就没问题.如果你写的东西,模型会受到掩码的影响,我在DB中注册隐藏的手机......
这是我使用的指令:
.directive('tsHideField', function () {
return {
require: 'ngModel',
restrict: 'A',
link: function (scope, element, attributes, controller) {
var maskValue = function (value) {
if (!value) {
return "";
}
if (value.length <= 4) {
return value;
}
var valueHide = "";
if (value.indexOf('@') === -1) {
//leave last 4 chars
valueHide = value.toString().substring(0, value.length - 4).replace(/[\S]/g, "\u2022");
return valueHide + value.toString().substring(value.length - 4);
} else {
//Adresse email, on laisse après le @ et on cache …Run Code Online (Sandbox Code Playgroud) 我配置了一个使用AD FS的Web App,为此我使用了OWIN.
对于登录,一切都好.如果我是域名的用户并访问该网站,则会自动连接.
但我想要的是在登录后自己处理用户和角色.
所以我想用这个AD帐户检查我的数据库中是否存在用户(此过程将在另一个应用程序登录之前生成)
我想使用Microsoft的Identity来处理声明(角色和权限).但我不明白如何将我的代码用于处理来自AD FS(使用Ws-Federation)的成功连接,并添加验证并填写正确的角色.
我在ConfigureAuth中的代码:
public partial class Startup
{
private static string realm = ConfigurationManager.AppSettings["ida:Wtrealm"];
private static string adfsMetadata = ConfigurationManager.AppSettings["ida:ADFSMetadata"];
private NLogLoggingService _loggingService;
public void ConfigureAuth(IAppBuilder app)
{
_loggingService = new NLogLoggingService("Startup");
_loggingService.Debug("ConfigureAuth");
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseWsFederationAuthentication(
new WsFederationAuthenticationOptions
{
Wtrealm = realm,
MetadataAddress = adfsMetadata,
//CallbackPath = PathString.FromUriComponent("/Account/TestCallback"),
// https://msdn.microsoft.com/en-us/library/microsoft.owin.security.authenticationmode(v=vs.113).aspx
AuthenticationMode = AuthenticationMode.Passive,
//Notifications = new WsFederationAuthenticationNotifications
//{
//}
});
}
Run Code Online (Sandbox Code Playgroud)
在Web.config中,realm是我的Web App的链接(https://ssoadfs.test),adfsMetadata是AD FS的metadata.xml链接.
AD FS连接后设置角色和登录逻辑的方法是什么?
架构,我在想什么:
编辑:经过一些尝试,我无法处理任何成功的回调.我不想在HomeController中处理角色......
我上次的Auth配置:
_loggingService = …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的输入右侧添加一个简单的图标以清除他的内容。
我不想在我的列表中添加“无”选项。
我想添加一个“清除”按钮。
实际上,一切正常,但是当我单击清除按钮时,选择正在显示...
这是一个测试代码:https : //stackblitz.com/edit/angular-mpbl8q
<mat-form-field>
<mat-label>State</mat-label>
<mat-select [(ngModel)]="currentState" name="State">
<mat-option *ngFor="let state of states" [value]="state">{{state}}</mat-option>
</mat-select>
<div matSuffix>
<mat-icon (click)="currentState = null">clear</mat-icon>
</div>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)
点击 clear 正在打开 mat-select
读取多次与此错误相关的帖子并没有找到我的问题的解决方案后,我在这里解释.
我使用XmlSerializer来序列化简单类.
这是我的代码:
private void btnGenerateXml_Click(object sender, RoutedEventArgs e)
{
Orchard orchard = new Orchard
{
Recipe = new Recipe
{
Name = "Generated by JooWeb.Tools",
Author = "admin",
ExportUtc = DateTime.UtcNow
},
MyDatas = new MyDatas
{
//Test = "test"
TrendDatas = new TrendDatas
{
Id = null,
Status = "Published",
TrendDatasPart = new TrendDatasPart
{
IdSource = 0,
PostalCode = "1000",
Locality = "Test5",
Surface = (decimal)0.00,
Price = (decimal)0.00,
Type = "",
InsertDateIndicator = "",
UpdateDateIndicator = …Run Code Online (Sandbox Code Playgroud) c# xml xml-serialization invalidoperationexception xmlserializer
我有一个表单,我想将它发送到一个 ajax 端点,为此我有这个辅助方法:
$.fn.serializeFormToObject = function() {
//serialize to array
var data = $(this).serializeArray();
//add also disabled items
$(':disabled[name]', this)
.each(function() {
data.push({ name: this.name, value: $(this).val() });
});
//map to object
var obj = {};
data.map(function(x) { obj[x.name] = x.value; });
return obj;
};
Run Code Online (Sandbox Code Playgroud)
问题是我的表单的某些名称中有点符号(使用 MVC 强类型模型)所以我有这个对象作为结果:
Task.Addresses.Box:""
Task.Addresses.City:"Limal"
Task.Addresses.Country:"Belgique"
Task.Deadline:"1/10/2017 12:18:18 PM"
Task.TaskSourceId:"1"
Run Code Online (Sandbox Code Playgroud)
预期的结果是:
{ Task : { Addresses: { Box: "", City: "Limal", Country: "Belgique"}, Deadline: "1/10/2017 12:18:18 PM", TaskSourceId:"1" } }
Run Code Online (Sandbox Code Playgroud)
我使用 lodash 库,但几个小时后我找不到实现此预期结果的方法。
有人可以为我提供一个有效的 javascript …
c# ×3
javascript ×2
adfs ×1
angular ×1
angularjs ×1
asp.net-mvc ×1
import ×1
ios ×1
jquery ×1
lodash ×1
owin ×1
requirejs ×1
typescript ×1
xamarin ×1
xamarin.ios ×1
xml ×1