我知道我可以通过使用来获得主屏幕的大小
System.Windows.SystemParameters.PrimaryScreenWidth;
System.Windows.SystemParameters.PrimaryScreenHeight;
Run Code Online (Sandbox Code Playgroud)
但是如何获得当前屏幕的大小?(多屏用户并不总是使用主屏幕,并非所有屏幕都使用相同的分辨率,对吧?)
能够从XAML访问大小会很好,但是从代码(C#)这样做就足够了.
在我工作的公司,我们使用hg作为(d)vcs.
使用的大多数存储库都保存在一个中心化的空间中,并通过hgweb提供服务.
为了便于使用和更好的用户体验(和概述),我喜欢有一些像gitorious(github,bitbucket).
它应该允许
我正在尝试创建一个平衡的(2-)列布局.
内容不是文本,而是块,高度不同.只要"左"和"右"具有(大致)相同的高度,内容就应该左右交替放置.
即在这张图片中:
1到3之间的空间不应该存在.
或者在这张图片中:
2'应该独立在右侧,1,3和4应该站在左侧(它们之间没有空间).
我尝试使用<li>像这样的"浮动":
HTML:
<ol class="context">
<li class="gruppe">1</li>
<li class="gruppe">2.0<br />2.1</li>
<li class="gruppe">3.0<br />3.1</li>
<li class="gruppe">4</li>
</ol>
Run Code Online (Sandbox Code Playgroud)
CSS:
ol.context
{
border: 1px solid #048;
list-style: none;
margin: 0;
padding: 0 0 8px 0;
overflow: auto;
}
li.gruppe
{
background: #048;
color: white;
float: left;
font: bold 32px Arial, sans-serif;
margin: 1px;
text-align: center;
width: calc(50% - 2px);
}
Run Code Online (Sandbox Code Playgroud)
我也尝试使用列的(column-count: 2; column-fill: auto;)但这不会首先从左到右填充列.(它首先从上到下填充.)
没有JavaScript,这甚至可能吗?
我已经找到大量示例来使用正则表达式替换文件中的文本.然而,它归结为两个版本:
1.迭代文件中的所有行并将regex应用于每一行
2.加载整个文件.
第2号使用"我的"文件是不可行的 - 它们大约是2GiB ......
至于第1号:目前这是我的方法,但是我想知道......如果需要应用跨越多个的正则表达式怎么办?线?
他写道,当Scott Guthrie 第一次在Razor上写博客时
新的视图引擎实现将支持单元测试视图的能力(无需控制器或Web服务器,并且可以托管在任何单元测试项目中 - 无需特殊的app-domain).
但是,我找不到关于剃刀可测试性的其他声明(或示例).有指向使用CodelanguageServie或RazorGenerator或一些自制的渲染器 - 我称之为"设计".
目前是否可以通过简单的方式对剃刀视图进行单元测试?(在asp.net mvc应用程序中,即.Nancy Nx在它的nancy.testing-package中带来了可测试性.)
(目前我不在乎是否应该测试视图.)
我知道有很多像这样的问题,但大多数问题都比较陈旧......
如果我写这样的HTML:
<div id="foo">Foo<div>
Run Code Online (Sandbox Code Playgroud)
window.foo返回一个dom元素并window.document.getElementById("foo") === window.foo返回true.
这是为什么?为什么每个人都使用getElementById?
并在旁注:为什么window.foo在IE7/8中禁止超越?如果我设置会发生什么window.foo = "bar"?
我可以Window使用以下代码打印当前的代码:
PrintDialog printDialog = new PrintDialog();
if (printDialog.ShowDialog().GetValueOrDefault(false))
{
printDialog.PrintVisual(this, this.Title);
}
Run Code Online (Sandbox Code Playgroud)
但是,如果Window它不适合页面,则会被截断.如何使Window页面适合?
我想我需要首先制作一个图形元素并检查这些图形是否适合页面,但到目前为止我还没有找到任何结果.
我目前正在使用以下网格布局:
display: -ms-grid;
-ms-grid-columns: 400px 100px max-content 1fr 50px;
-ms-grid-rows: 1fr 1fr;
Run Code Online (Sandbox Code Playgroud)
这类似于这种布局:
| <----------------- this has a fixed width --------------------------> |
+----------+----------+-------------------+-----------------+-----------+
|<- fix -> |<- fix -> | <--- growing ---> | <- shrinking -> | <- fix -> |
+----------+----------+-------------------+-----------------+-----------+
| | | max-width content | | |
+----------+----------+-------------------+-----------------+-----------+
Run Code Online (Sandbox Code Playgroud)
现在,要多一点的浏览器,supportig我既可以使用填充工具或切换到Flexbox的布局(在大多数现代浏览器都支持).上面的布局是否可以使用flexbox?
在 hbm 映射中,我可以
<composite-id>
[..]
<key-property name="someStringProperty"
column="somefield"
type="AnsiString"
lenght="8"/>
</composite-id>
Run Code Online (Sandbox Code Playgroud)
我如何在 Fluent 中做到这一点(设置类型和长度)?
编辑:
我在support.fluentnhibernate.org上发布了这个。我包括了一些修改以支持将类型设置为例如 AnsiString 那里。
编辑 2:
今天 Paul Batum 在他的开发分支中添加了对文本类型和长度的支持。(有关更改,请参阅github。)
这使得编写
CompositeId()
.KeyProperty(
p => p.SomeProp,
k => k.ColumnName("someField").Type("AnsiString").Length(8))
Run Code Online (Sandbox Code Playgroud) c# ×2
css ×2
css3 ×2
wpf ×2
.net ×1
asp.net-mvc ×1
browser ×1
dom ×1
flexbox ×1
fonts ×1
grid-layout ×1
html ×1
html5 ×1
javascript ×1
large-files ×1
mercurial ×1
printing ×1
razor ×1
regex ×1
screen ×1
size ×1
unit-testing ×1
window ×1
xaml ×1