小编det*_*ode的帖子

如何使用 SQLite.Net-PCL 制作 SQLite 外键

在 UWP 中,我享受使用 SQLite.Net-PCL 的好处,创建要在应用程序中使用的类作为 ObservableCollections 以绑定到 GridView。在包含 SQLiteNetExtensions 以构建带有外键的数据库后,我注意到在 SQLite Maestro 中查看数据库时并未真正创建外键。而是创建索引。 如果 SQLiteNetExtensions 并没有真正创建外键,那么使用它有什么好处?

使用 LAMDA 表达式或 LINQ 进行查询时,可能不需要外键(稍后在创建数据库后的应用程序中)。 如果我在不使用 SQLite.Net-PCL 的情况下执行查询以创建带有外键的表,我是否仍然可以使用 SQLite.Net-PCL 继续将 ObservableCollections 绑定到 GridViews?

示例数据库:

[Table("Book")]
public class Book
{
    [PrimaryKey, AutoIncrement, Column("ID")]
    public int ID { get; set; }
    [Column("Name")]
    public string Name { get; set; }

    [ManyToMany]
    public List<Checkout> Checkout { get; set; }
}

[Table("School")]
public class School
{
    [PrimaryKey, AutoIncrement, Column("ID")]
    public int ID { get; set; }
    [Column("Name")]
    public string …
Run Code Online (Sandbox Code Playgroud)

c# sqlite-net sqlite-net-extensions uwp

9
推荐指数
1
解决办法
8299
查看次数

复杂的Webkit Bug?相对位置+ Z-Index +溢出隐藏+ CSS3变换

下面的代码(JSFiddle Preview)与其他现代浏览器相比,在Webkit中产生了意想不到的结果:

<script type="text/javascript">
jQuery(document).ready(function($) {
    RunFunction();

    $('.ColorSquare').click(function() {
        $('#Lightbox').css('display','block');
        $('#ShowColorSquare').css('display','block');
        $('#ShowColorSquare').css('z-index','10');
        $('#ShowColorSquare').css('left',$('#ShowColorSquare').parent().width() / 2 - 50);
        $('#ShowColorSquare').css('top',$('#ShowColorSquare').parent().height() / 2 - 50);
        $('#ShowColorSquare').html('The color is: ' + $(this).css('background-color'));
    });
    $('#ShowColorSquare').click(function() {
        $('#Lightbox').css('display','none');
        $('#ShowColorSquare').css('display','none');
        $('#ShowColorSquare').html('');
    });
    $('#Lightbox').click(function() {
        $('#Lightbox').css('display','none');
        $('#ShowColorSquare').css('display','none');
        $('#ShowColorSquare').html('');
    });
});
function RunFunction() {
    $('#slide1').animate({
        left: '-=310'
    }, 3000);
    $('#slide2').animate({
        left: '-=310'
    }, 3000);
    $('#slide3').animate({
        left: '-=310'
    }, 3000, function() {
        if($('#slide1').css("left") == '-310px') {
            $('#slide1').css("left",620);
        }
        if($('#slide2').css("left") == '-310px') {
            $('#slide2').css("left",620);
        }
        if($('#slide3').css("left") == '-310px') { …
Run Code Online (Sandbox Code Playgroud)

html jquery html5 webkit css3

7
推荐指数
1
解决办法
2283
查看次数

SharePoint REST显示当前用户配置文件图片

通过REST从当前用户的配置文件获取URL时,更新src时将无法显示image标签:

<img id="escMyPic" src="" alt="" />

<script type="text/javascript">
$.ajax({
    url: strURL + "/_api/sp.userprofiles.peoplemanager/getmyproperties",
    type: "GET",
    headers: {
        "accept": "application/json;odata=verbose",
    },
    success: MyPictureSucceeded,
    error: MyPictureFailed
});
function MyPictureSucceeded(data) {
    if(data.d.PictureUrl != null) {
        $('#escMyPic').attr('src', data.d.PictureUrl);
    }
}
function MyPictureFailed() {
        alert('Error: Unexpected error loading profile picture.');
}
</script>
Run Code Online (Sandbox Code Playgroud)

在SharePoint Online中,返回URL如下所示:https : //tenant-my.sharepoint.com : 443/ User%20Photos/ Profile%20Pictures/email_address_MThumb.jpg?t=63601764394

它将重定向到:https : //tenant-my.sharepoint.com/User%20Photos/Profile%20Pictures/email_address_MThumb.jpg?t=63601764394

使用浏览器开发工具,您会看到返回的mime类型不是image / jpg,而是text / plain。我删除了查询字符串参数,甚至将硬编码URL放在了图像标签src中,但它只是不显示。开发工具中的响应正文也为空白。在显示之前,它似乎正在重定向和认证。

将硬编码的URL放置在浏览器地址栏中时,图片会显示正常,而dev工具的响应标头将图片显示为URL的内容,而MIME类型是image / jpg。

您如何从REST呼叫中显示个人资料图像?

sharepoint office365 sharepoint-2013 office365-apps office365-restapi

3
推荐指数
1
解决办法
5848
查看次数