代码怎么贴

tengfeipang 2011-07-13 09:56:40

public class AttachedPropertyHelper
{
public static DependencyProperty IsLeafProperty = DependencyProperty.RegisterAttached(
"IsLeaf",
typeof(bool),
typeof(AttachedPropertyHelper),
new FrameworkPropertyMetadata(null)
);
public static void SetIsLeaf(DependencyObject obj, bool value)
{
obj.SetValue(AttachedPropertyHelper.IsLeafProperty, value);
}
public static bool GetIsLeaf(DependencyObject obj)
{
return (bool)obj.GetValue(AttachedPropertyHelper.IsLeafProperty);
}

public static DependencyProperty MouseDoubleClickProperty = DependencyProperty.RegisterAttached(
"MouseDoubleClick",
typeof(ICommand),
typeof(AttachedPropertyHelper),
new FrameworkPropertyMetadata(null, new PropertyChangedCallback(MouseDoubleChanged))
);
public static void SetMouseDoubleClick(DependencyObject obj, ICommand value)
{
obj.SetValue(AttachedPropertyHelper.MouseDoubleClickProperty, value);
}
public static ICommand GetMouseDoubleClick(DependencyObject obj)
{
return (ICommand)obj.GetValue(AttachedPropertyHelper.MouseDoubleClickProperty);
}
public static void MouseDoubleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Control control = d as ContentControl;
if (control != null)
{
if (e.NewValue != null && e.OldValue == null)
{
control.MouseDoubleClick += new MouseButtonEventHandler(control_MouseDoubleClick);
}
else if (e.NewValue == null && e.OldValue != null)
{
control.MouseDoubleClick -= new MouseButtonEventHandler(control_MouseDoubleClick);
}
}
}
public static void control_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
Control control = sender as Control;
ICommand command = (ICommand)control.GetValue(AttachedPropertyHelper.MouseDoubleClickProperty);
if (command.CanExecute(control.GetValue(AttachedPropertyHelper.IsLeafProperty)))
{
command.Execute(control);
}
}
}
...全文
172 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
  • 打赏
  • 举报
回复
我也会了,呵呵,请斑竹见谅,第一次没成功
  • 打赏
  • 举报
回复
#include <stdio.h>

void main()
{
double a,b ,c,d;
    d=18.0;
    c=(a+b+d)*9/26;
b=(a+c+d)*6/9;	
a=(b+c+d)*3/11;




   a=((a+c+d)*6/9+(a+b+d)*9/26+d)*3/11;


   printf("%lf\n",a);
}
  • 打赏
  • 举报
回复
#include <stdio.h> void main() { double a,b ,c,d; d=18.0; c=(a+b+d)*9/26; b=(a+c+d)*6/9; a=(b+c+d)*3/11; a=((a+c+d)*6/9+(a+b+d)*9/26+d)*3/11; printf("%lf\n",a); }
tengfeipang 2011-07-13
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 taolaomeng 的回复:]

会了吗
[/Quote]
哇,这么难啊
taolaomeng 2011-07-13
  • 打赏
  • 举报
回复
会了吗
javaoraspx 2011-07-13
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 javaoraspx 的回复:]
点击 下面的 引用,在...里面写
[/Quote]
哈哈
javaoraspx 2011-07-13
  • 打赏
  • 举报
回复
点击 下面的 引用,在...里面写
tengfeipang 2011-07-13
  • 打赏
  • 举报
回复
主要是来试下,竟然成功了,怎样引用呢?
全局变量 2011-07-13
  • 打赏
  • 举报
回复
最近老看到一些让人摸不着头脑的贴呢。
fantasy_song 2011-07-13
  • 打赏
  • 举报
回复
就是这样贴
qq158999216 2011-07-13
  • 打赏
  • 举报
回复


public static void control_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
Control control = sender as Control;
ICommand command = (ICommand)control.GetValue(AttachedPropertyHelper.MouseDoubleClickProperty);
if (command.CanExecute(control.GetValue(AttachedPropertyHelper.IsLeafProperty)))
{
command.Execute(control);
}
}

程先森 2011-07-13
  • 打赏
  • 举报
回复
你现在应该问怎么把贴上的代码给去掉。
Ny-6000 2011-07-13
  • 打赏
  • 举报
回复
已经贴了,还问什么呢?
  • 打赏
  • 举报
回复
暖枫无敌 2011-07-13
  • 打赏
  • 举报
回复
liuwei2500 2011-07-13
  • 打赏
  • 举报
回复
就是这样贴

110,532

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧