在WPF中,我可以像Designer.cs一样使用.NET 2.0样式制作我的UI,我的问题是使用XAML进行UI设计而不是代码的优点是什么.
我不知道如何做一个简单的十进制值的总和。
Table<StaffTime> times = ctx.GetTable<StaffTime>();
var query = from t in times
select new
{
t.Hours.Sum()
}
Run Code Online (Sandbox Code Playgroud)
Sum 不是扩展方法吗?我错过了什么?
鲍勃
这只发生在一些IE中.这里:http://animactions.ca/Animactions/volet_entreprise.php
您可能会注意到,当你点击和圆的一个阻力,你会得到一些与此类似:http://img534.imageshack.us/img534/7578/errorra.png
我想不明白.这是我的图像地图:
<p class="style2">
<map id="FPMap0" name="FPMap0">
<area coords="405, 8, 375, 10, 353, 13, 322, 30, 317, 48, 327, 69, 344, 75, 370, 84, 401, 86, 428, 81, 454, 69, 466, 56, 468, 37, 452, 19, 419, 9" href="le_developpement_des_equipes_de_travail.php" shape="poly" style="outline:0" target="_blank" />
<area coords="95, 164, 65, 166, 43, 174, 21, 186, 16, 206, 27, 225, 48, 237, 76, 241, 99, 241, 129, 236, 151, 228, 165, 214, 167, 194, 154, 177, 130, 168, 105, …Run Code Online (Sandbox Code Playgroud) 只是出于好奇,问这个
就像下面的表达一样
a = (condition) ? x : y; // two outputs
Run Code Online (Sandbox Code Playgroud)
为什么我们不能为枚举操作?
说,
myValue = f ??? fnApple() : fnMango() : fnOrange(); // no. of outputs specified in the enum definition
Run Code Online (Sandbox Code Playgroud)
而不是switch语句(即使可以进行重构)
enum Fruit
{
apple,
mango,
orange
};
Fruit f = Fruit.apple;
Run Code Online (Sandbox Code Playgroud)
或者它是某种无用的运营商?
我很难让SetSystemTime在我的C#代码中工作.SetSystemtime是一个kernel32.dll函数.我正在使用P/invoke(interop)来调用它.SetSystemtime返回false,错误为"Invalid Parameter".我已经发布了以下代码.我强调GetSystemTime工作得很好.我已经在Vista和Windows 7上对此进行了测试.根据我发现的一些新闻组帖子,我已经关闭了UAC.没有不同.我已经做了一些搜索这个问题.我找到了这个链接:http: //groups.google.com.tw/group/microsoft.public.dotnet.framework.interop/browse_thread/thread/805fa8603b00c267
报告问题但似乎没有找到解决方案.请注意,还提到了UAC,但我不确定这是不是问题.还要注意这个绅士没有得到实际的Win32Error.
非常感谢您的任何帮助或想法.安德鲁
码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace SystemTimeInteropTest
{
class Program
{
#region ClockDriftSetup
[StructLayout(LayoutKind.Sequential)]
public struct SystemTime
{
[MarshalAs(UnmanagedType.U2)]
public short Year;
[MarshalAs(UnmanagedType.U2)]
public short Month;
[MarshalAs(UnmanagedType.U2)]
public short DayOfWeek;
[MarshalAs(UnmanagedType.U2)]
public short Day;
[MarshalAs(UnmanagedType.U2)]
public short Hour;
[MarshalAs(UnmanagedType.U2)]
public short Minute;
[MarshalAs(UnmanagedType.U2)]
public short Second;
[MarshalAs(UnmanagedType.U2)]
public short Milliseconds;
}
[DllImport("kernel32.dll")]
public static extern void GetLocalTime(
out SystemTime systemTime);
[DllImport("kernel32.dll")]
public static …Run Code Online (Sandbox Code Playgroud)