我有一个类型为T的变量x和一个字符串中的值.例如,我有:
bool x, value = "True"
int x, value = "1"
Run Code Online (Sandbox Code Playgroud)
注意T可以引用或原始类型!
我正在使用基于多层SOA的企业应用程序来处理所有复杂的业务逻辑.许多业务验证需要来自数据库的大量支持数据,这会降低性能.并发用户的数量大约是1000.客户端是多层的WinForms.
我们正在考虑几乎所有的企业库块.
验证应用程序块
是否可以使用C#查询文件索引服务?文件索引服务是否公开数据库?如果是这样,这个数据库的方案是什么?
有没有创建无限地形/风景/表面的算法?
约束
这里没有其他相关问题回答这个问题.如果有什么不清楚请告诉我!
public static void Apply<T>(this IList<T> source, Func<T, T> func)
{
for (int i = 0; i < source.Count; i++)
{
source[i] = func.Invoke(source[i]);
}
}
Run Code Online (Sandbox Code Playgroud)
样品:
List<string> fruits = new List<string> { "ApPel", "BANana", "oRANGE" };
fruits.Apply((x) => x.ToUpper());
Run Code Online (Sandbox Code Playgroud)
结果:APPLE BANANA ORANGE
<UserControl x:Class="WpfApplication2.ProgressBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<ProgressBar Minimum="0" Maximum="1" Value="0.5" LargeChange="0.1" SmallChange="0.01" Margin="2,2,12,2" Height="22">
<ProgressBar.Template>
<ControlTemplate>
<Border BorderThickness="2" BorderBrush="Black">
<Rectangle>
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0">
<LinearGradientBrush.EndPoint>
<Point Y="0" X="{Binding RelativeSource={RelativeSource AncestorType={x:Type ProgressBar}}, Path=ProgressBar.Value}"/>
</LinearGradientBrush.EndPoint>
<GradientStop Color="Transparent" Offset="1.01"/>
<GradientStop Color="#FF0000" Offset="1.0"/>
<GradientStop Color="#FFFF00" Offset="0.50"/>
<GradientStop Color="#00FF00" Offset="0.0"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</Border>
</ControlTemplate>
</ProgressBar.Template>
</ProgressBar>
<TextBlock Text="50%" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
</UserControl>
Run Code Online (Sandbox Code Playgroud)
我得到错误:"无法在'Point'类型的'X'属性上设置'绑定'.'绑定'只能在DependencyObject的DependencyProperty上设置."
c# ×3
algorithm ×1
architecture ×1
frameworks ×1
reflection ×1
soa ×1
soap-client ×1
wpf ×1
xaml ×1
xna ×1