我正在尝试打开一个弹出窗口,使其高度从屏幕顶部到Windows的"应用程序"栏.这是代码:
function windowOpener(windowHeight, windowWidth, windowName, windowUri) {
var windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
var centerWidth = (window.screen.width - windowWidth) / 2;
var centerHeight = (window.screen.height - windowHeight) / 2;
newWindow = window.open(windowUri, windowName, 'resizable=0,scrollbars=1,width=' + windowWidth +
',height=' + windowHeight +
',left=' + centerWidth);
newWindow.focus();
return newWindow.name;
}
Run Code Online (Sandbox Code Playgroud)
为什么它在IE中不起作用?(适用于镀铬)
谢谢
我有以下css代码:
-webkit-gradient(linear, left bottom, left top, from(#5AE), to(#036));
Run Code Online (Sandbox Code Playgroud)
这在Chrome中非常好地显示了背景.Internet Explorer只显示白色背景.我尝试使用CSS 3馅饼,它没有改变任何东西.
以下是我的css:
body {
behavior: url(css3pie/PIE.htc);
color: #000000;
font-family: Arial, Helvetica, sans-serif;
margin: 0px;
padding: 0px;
/*background:url("../image/bg.png") repeat scroll 0 0 transparent;*/
background: -webkit-gradient(linear, left bottom, left top, from(#5AE), to(#036));
}
Run Code Online (Sandbox Code Playgroud)
谢谢
我试图建立与.NET Core 2.0项目和xUnit的VSTS持续集成.
我已经安装了xunit.runner.visualstudio NuGet包,并且在Visual Studio中一切正常.
VSTS无法找到任何测试.
到目前为止我能找到的是本文,它使用project.json描述了如何使用.NET Core 1.0进行设置.不幸的是,它不会工作,因为project.json在.NET Core 2.0中消失了.
有什么建议?
VSTS输出:
2017-11-08T20:00:30.4824989Z ## [section]开始:VsTest - testAssemblies 2017-11-08T20:00:30.4834988Z ==================== ================================================== ======== 2017-11-08T20:00:30.4834988Z任务:Visual Studio测试2017-11-08T20:00:30.4834988Z描述:使用Visual Studio测试运行器运行测试2017-11-08T20:00: 30.4834988Z版本:2.2.3 2017-11-08T20:00:30.4834988Z作者:Microsoft Corporation 2017-11-08T20:00:30.4834988Z帮助:更多信息 2017-11-08T20:00:30.4834988Z ===== ================================================== ======================= 2017-11-08T20:00:31.2064989Z使用vstest.console.exe在本地运行测试2017-11-08T20:00 :31.2064989Z =============================================== ========= 2017-11-08T20:00:31.2074983Z测试选择器:测试组件2017-11-08T20:00:31.2084986Z测试组件: \ release*test*.dll,\release \netcoreapp2. 0*单位*.dll, - :\ xunit.runner.visualstudio.testadapter.dll ,! \ obj**2017-11-08T20:00:31.2084986Z测试筛选条件:null 2017-11-08T20:00:31.2094992Z搜索文件夹:d:\ a\1\s 2017-11-08T20:00:31.2094992Z运行设置文件:d:\ a\1\s 2017-11-08T20:00:31.2094992Z并行运行:false 2017-11-08T20:00:31.2115263Z隔离运行:false 2017-11-08T20:00: 31.2184982Z自定义适配器的路径:null 2017-11-08T20:00:31.2194992Z其他控制台选项:null 2017-11-08T20:00:31.2194992Z启用代码覆盖率:false 2017-11-08T20:00:31.2205509Z VisualStudio版本选择用于测试执行:最新2017-11-08T20:00:32.3430734Z ================================== ====================== 2017-11-08T20:00:38.4660600Z [command]"C:\ Program Files(x86)\ Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"@d:\ a_temp\7a0ab851-c4bf-11e7-9264-0bc93cd5677b.txt 2017-11-08T20:00:38.6420650Z Microsoft(R)测试执行命令行工具版本15.0.26929.2 2017-11-08T20:00:38.6420650Z版权所有(c)Mic 罗斯托夫公司.版权所有.2017-11-08T20:00:38.6420650Z …
我有一个无序列表,看起来像这样:
1
2.2
1.1.1
3
当我对列表进行排序时,1.1.1变得大于3和2.2,而2.2变得大于3.
这是因为Double.Parse删除了点并使其成为整数.
这是我用来排序的方法:
public class CompareCategory: IComparer<Category>
{
public int Compare(Category c1, Category c2)
{
Double cat1 = Double.Parse(c1.prefix);
Double cat2 = Double.Parse(c2.prefix);
if (cat1 > cat2)
return 1;
else if (cat1 < cat2)
return -1;
else
return 0;
}
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?谢谢
我的操作系统(Windows)的语言是丹麦语,我的浏览器的语言也是如此.
当我试图解析丹麦格式的日期(dd-MM-yyyy)时,如下所示:
var x = "18-08-1989"
var date = new Date(x);
Run Code Online (Sandbox Code Playgroud)
我从javascript得到错误的日期(我想要1989年8月18日).当我将此字符串转换为英语并解析它时,它返回正确的日期.
当使用JS Date对象时,日期字符串的格式是否必须是:yyyy-MM-dd?
为什么splice方法返回undefined并且不删除以下代码中位置4的元素:
var excludedDepartmentsList = [1, 2, 3, 4, 5, 6];
var currentDepartmentId = 5;
var position = $.inArray(currentDepartmentId, excludedDepartmentsList);
if (position > -1) {
var q = excludedDepartmentsList.splice[position, 1];
return;
}
Run Code Online (Sandbox Code Playgroud)
我在这里做了一个测试:http://jsfiddle.net/PnVEb/
我需要为同一个ViewModel使用两个不同的DisplayTemplates.一个用于在常规页面上显示ViewModel,另一个用于在打印页面上显示ViewModel.我的ViewModel都是从一个基本模型派生出来的,而DisplayFor在我给它一个基本模型的List时会找出要使用的DisplayTemplate.
据我所知,DisplayFor在DisplayTemplates文件夹中查找一个文件名,该文件名等于它已传递的模型的类型.我不能有多个同名文件.
我怎么解决这个问题?
谢谢!
在我的Windows服务的构造函数中,我在#if DEBUG条件中有一些代码:
#if DEBUG
var container = CompositionRoot.DiBootstrapper.Initialize();
_initializeApplication = container.Resolve<IInitializeApplication>();
_initializeApplication.Initialize();
#endif
Run Code Online (Sandbox Code Playgroud)
当我在发布模式下编译/构建项目并将其安装为Windows服务时,将执行#if DEBUG条件中的代码.
我只想在调试应用程序时运行代码.
有什么建议?
我有以下ViewModel:
public class ShowMatrixQuestionViewModel : ShowQuestionViewModel
{
public Dictionary<MatrixRows, List<MatrixColumns>> columnrow;
public List<MatrixColumns> columns;
public List<MatrixRows> rows;
public ShowMatrixQuestionViewModel()
{
columns = new List<MatrixColumns>();
rows = new List<MatrixRows>();
columnrow = new Dictionary<MatrixRows, List<MatrixColumns>>();
}
}
public class MatrixColumns
{
public int Column_ID { get; set; }
public int Column_Number { get; set; }
public String Column_Description { get; set; }
public Boolean IsAnswer { get; set; }
}
public class MatrixRows
{
public int Row_Id { get; set; }
public …Run Code Online (Sandbox Code Playgroud) 据我从同事和网络上了解到,锁定正在同步的对象是不好的做法,但我不明白为什么?
以下类应该将设置加载到字典中,并且它还有一种方法来检索设置.
public class TingbogSettingService : ITingbogSettingService
{
private readonly ISettingRepository _settingRepository;
private readonly ICentralLog _centralLog;
private Dictionary<string, ISetting> _settingDictionary = new Dictionary<string, ISetting>();
public TingbogSettingService(ISettingRepository settingRepository, ICentralLog centralLog)
{
_settingRepository = settingRepository;
_centralLog = centralLog;
}
public ISetting GetSetting(string settingName)
{
ISetting setting;
if (!_settingDictionary.TryGetValue(settingName, out setting))
{
return null;
}
return setting;
}
public void LoadSettings()
{
var settings = _settingRepository.LoadSettings();
try
{
lock (_settingDictionary)
{
_settingDictionary = settings.ToDictionary(x => x.SettingName);
}
}
catch (Exception ex)
{
_centralLog.Log(Targets.Database, …Run Code Online (Sandbox Code Playgroud) c# ×3
javascript ×3
asp.net-mvc ×2
css ×2
jquery ×2
azure-devops ×1
css3 ×1
css3pie ×1
html ×1
webkit ×1
xunit ×1