小编Jam*_*emp的帖子

JQuery突出显示行与复选框单击

$(document).ready(function(){
    $(".txtDate").datepicker({ showOn: "both", 
        buttonImage: "library/ui/datepicker/img/calendar2.gif", dateFormat: "yy/mm/dd", buttonImageOnly: true });

    //added this checkbox click for something I given earlier

    $("#Table input").click(function() { 
        if ($(this).attr("checked") == true)
        {
            $(this).parent().parent().addClass("highlight");  
        } 
        else
        {   
            $(this).parent().parent().removeClass("highlight");
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

我有一个复选框控件,我在后面的代码中动态添加每一行

for( int i=0; i< data.count;i++){   
    HtmlTableCell CheckCell = new HtmlTableCell();
    CheckBox Check = new CheckBox(); 

    CheckCell.Controls.Add(Check);

    row.Cells.Add(CheckCell);
    Table.Rows.Add(row);
}
Run Code Online (Sandbox Code Playgroud)

带有标记的表id在这里:

<table id="Table"  runat="server" width="100%" cellspacing="5" border="1"> 
    <colgroup width="3%"></colgroup>
    <colgroup width="15%"></colgroup>
    <colgroup width="20%"></colgroup>
    <colgroup width="15%"></colgroup>
    <colgroup width="47%"></colgroup>
    <thead>
        <tr> 
            <th id="CheckBox" runat="server"><input type="checkbox" id="CheckBox1" …
Run Code Online (Sandbox Code Playgroud)

jquery

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

ASP.NET MVC控制器中的方法似乎没有XML记录吗?

我是一个巨大的.NET XML文档的风扇.

但是,我可以诚实地说,我从未见过教程或项目,例如,我们有这样的标记:

/// <summary>
/// dummy text
/// </summary>
/// <returns>blah</returns>
public ActionResult LogOff() {
    FormsService.SignOut();

    return RedirectToAction("Index", "Home");
}
Run Code Online (Sandbox Code Playgroud)

代替:

// **************************************
// URL: /Account/LogOff
// **************************************

public ActionResult LogOff() {
    FormsService.SignOut();

    return RedirectToAction("Index", "Home");
}
Run Code Online (Sandbox Code Playgroud)

这有什么特别的原因吗?我是唯一一个想要记录我的Controller方法的人吗?

编辑1:

虽然大多数控制器方法看起来很简单,但详细说明的问题如何说明这个问题:MVC:如何使用具有许多子实体的实体?

asp.net-mvc xml-documentation

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

我可以在Android Studio中隐藏Thumbs.db吗?

我正在使用Android Studio中的libGDX项目,该项目有一个包含照片的资源目录.

Windows是Windows,它喜欢在Windows资源管理器中浏览此目录时创建Thumbs.db文件.但是,Android Studio(1.1.0)在文件夹目录(项目窗口)中显示Thumbs.db文件.

由于某些应用程序(如Visual Studio)会自动隐藏系统文件,或者让您将其排除,我想知道是否有办法在Android Studio/IntelliJ中执行此操作,或者我只需要使用该文件.

.gitignore已将这些排除在检查源代码管理之外; 我真的只是想找到一种方法来隐藏Thumbs.db,使其不显示在Android Studio中的目录文件列表中.

android-studio

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

如何使用 Jasmine 测试 Phaser 3 项目?

我目前正在phaser.js框架中开发一个小游戏,由于项目范围相当大,我真的很想进行单元测试。然而,当尝试在 Jasmine 中为 Phaser 设置单元测试时,我遇到了有关依赖项的错误。

我对 Jasmine 或任何其他测试框架没有经验,所以我可能忽略了对经验丰富的开发人员来说显而易见的事情。

我的 .spec 文件如下所示:

describe("motorMain", function() {
    var Phaser = require('../phaser');
    var MotorMain = require("../motorMain"); 

    var motorMain;
    var phaser;

    beforeEach(function() {
        phaser = new Phaser();
        motorMain = new motorMain();
      });

    it("should increase the score if a object is clicked", function(){
        var scoreBeforeClicking = motorMain.score;
        var gameobject;
        motorMain.clickhandler("",gameobject);
        expect(scoreBeforeClicking+1).toEqual(score);
    })
});
Run Code Online (Sandbox Code Playgroud)

但由于 Phaser 依赖于在浏览器中运行,当我运行它时,它抱怨无法访问Phaser 中的window和 等元素。document

我收到如下错误:

ReferenceError:文档未定义

有人有测试 Phaser 游戏的经验吗?我在网上似乎找不到任何有关它的信息。甚至可以测试移相游戏吗?

至于其他测试框架,我也研究过 nightwatch,但它的 Phaser 支持已经过时,而且它主要是 e2e 而不是单元测试,所以它不是我想要的。我还在网上看到有人开发了Phaser 2.4.7的shimming版本,但是现在已经过时了,Phaser 3已经发生了很大的变化。

jasmine phaser-framework

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

与 log4net 相比,使用 Nlog 的性能较低

我们最近将 ASP.NET Core Web API 项目的日志记录框架从 log4net 更新为 NLog,当我们进行性能测试时,与 NLog 相比,NLog 的请求/秒速服务要少得多。下面是我的 NLog 配置文件。

请就使用 NLog 的性能问题提出任何想法。

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true"
      internalLogLevel="info"
      internalLogFile="C:\temp\internal-nlog.txt">

  <!-- enable asp.net core layout renderers -->
  <extensions>
    <add assembly="NLog.Web.AspNetCore"/>
    <add assembly="SumoLogic.Logging.NLog"/>
  </extensions>

  <!-- the targets to write to -->
  <targets>
    <!-- write logs to console -->
    <target xsi:type="ColoredConsole" name="allConsole" formatMessage="false" layout="${longdate}|${level:uppercase=true}|${message}" />

    <target name="sumoLogic" type="SumoLogicTarget" formatMessage="false" layout="${date:format=yyyy-MM-dd HH\:mm\:ss.fff} ${level}, ${message}${exception:format=tostring}${newline}">
      <Url>#{Logging__SumoLogic__EndpointUrl}</Url>
      <ConnectionTimeout>30000</ConnectionTimeout>
      <SourceName>#{Logging__SumoLogic__SourceName}</SourceName>
      <SourceCategory>#{Logging__SumoLogic__SourceCategory}</SourceCategory>
      <UseConsoleLog>true</UseConsoleLog>
    </target>

    <target name="bufferedSumoLogic" type="BufferedSumoLogicTarget" formatMessage="false" layout="${date:format=yyyy-MM-dd HH\:mm\:ss.fff} …
Run Code Online (Sandbox Code Playgroud)

log4net nlog .net-core dotnet-core-pack

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

尝试在 Phaser 中获得鼠标滚轮缩放效果

使用鼠标滚轮放大和缩小似乎有效。不过我想在混合中放置鼠标位置。

如果用户放大,相机会(最好是缓慢地,但也可以立即工作)随着放大或缩小而向鼠标位置移动。换句话说,在缩放时,相机应以当前鼠标 x,y 坐标为中心或至少转向它。

相机 x,y 不等于画布 x,y 吗?它似乎朝相反的方向平移。我已经在我的 [Typescript]方法中尝试了pan()和:centerOn()create()

this.input.on("wheel",  (pointer, gameObjects, deltaX, deltaY, deltaZ) => {

  if (deltaY > 0) {
    this.camera.zoom -= .1;
  }

  if (deltaY < 0) {
    this.camera.zoom += .1;
  }

  this.camera.pan(pointer.x, point.y, 2000, "Power2");

  //this.camera.centerOn(pointer.x, pointer.y);

});
Run Code Online (Sandbox Code Playgroud)

这是一个不太可能的方案,但我想模仿游戏《遥远的世界》中的缩放行为。

phaser-framework

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

角度定制垫片颜色

除了主色、强调色、警告色和默认色之外,是否有任何方法可以使垫片具有自定义颜色?这是我现在的代码:

<mat-chip *ngIf="status.name==='open'" color="warn" selected trans>{{status.display_name}}</mat-chip>
<mat-chip *ngIf="status.name==='pending'" color="accent" selected trans>{{status.display_name}}</mat-chip>
<mat-chip *ngIf="status.name==='assigned'" color="primary" selected trans>{{status.display_name}}</mat-chip>
<mat-chip *ngIf="status.name==='verification'" color="yellow" selected trans>{{status.display_name}}</mat-chip>
Run Code Online (Sandbox Code Playgroud)

是的,很明显我希望最后一个垫片具有黄色。color='primary' 现在是黑色,我想将其更改为绿色,但我不知道该怎么做。任何帮助,将不胜感激。

angular

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

使用ASP.NET(C#)解析多个XML文件并返回具有特定元素的XML文件

问候.

我正在寻找一种方法,用ASP.NET(C#)解析特定目录中的大量XML文件.我希望能够从特定元素返回内容,但在此之前,需要找到元素之间具有特定值的内容.

示例XML文件1:

<file>
    <title>Title 1</title>
    <someContent>Content</someContent>
    <filter>filter</filter>
</file>
Run Code Online (Sandbox Code Playgroud)

示例XML文件2:

<file>
    <title>Title 2</title>
    <someContent>Content</someContent>
    <filter>filter, different filter</filter>
</file>
Run Code Online (Sandbox Code Playgroud)

示例案例1:

给我所有具有'过滤器'过滤器的XML.

案例2:

给我所有标题为"Title 1"的XML.

看起来,这似乎应该可以用LINQ,但我只看到有关如何在有一个XML文件时执行此操作的示例,而不是在存在多个时,例如在这种情况下.

我希望这可以在服务器端完成,这样我就可以在那一端缓存.

可以使用任何版本的.NET Framework的功能.

谢谢!

〜詹姆斯

c# xml asp.net

2
推荐指数
1
解决办法
1万
查看次数

相位器3中的图片和图片之间有什么区别?

在Phaser 3文档中,我可以看到Sprite和之间的最大区别Image是您不能为设置动画或向其添加物理物体Image,但是在Image属性中可以看到animationManager。我对此有些困惑。谁能澄清一下?

phaser-framework

2
推荐指数
1
解决办法
480
查看次数

如何将 [formControlName] 与 mat-checkbox 一起使用

在 Angular Material 文档中,他们说[formControlName]不能与mat-checkbox. 如何根据值数组动态创建复选框并使用反应式表单获取复选框值?还有其他方法吗?

typescript form-control angular-material angular angular-reactive-forms

2
推荐指数
1
解决办法
1万
查看次数