一个很简单的属性继承问题(100分不够在加)

shuiwenyu 2009-04-09 10:06:25
public class ShapeNode : DiagramNode, IPersists, InplaceEditable
{
public ShapeNode();
public ShapeNode(Diagram parent);
public ShapeNode(ShapeNode prototype);

public CustomDraw CustomDraw { get; set; }
public bool EnableStyledText { get; set; }
public override Font Font { get; set; }
public Image Image { get; set; }
public ImageAlign ImageAlign { get; set; }
public string PlainText { get; }
public bool PolygonalTextLayout { get; set; }
public bool RotateImage { get; set; }
public bool RotateText { get; set; }
public float RotationAngle { get; set; }
[Editor("MindFusion.Diagramming.WinForms.Design.ShapeEditor, MindFusion.Diagramming.Design, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a0d18338041985ba", typeof(UITypeEditor))]
public Shape Shape { get; set; }
public float ShapeOrientation { get; set; }
public string Text { get; set; }


protected internal override void CompleteModify(PointF end, InteractionState ist);
public override bool ContainsPoint(PointF point);
public override bool ContainsPoint(PointF point, float threshold);
} 这是一个别人写的控件的类里面的一个元数据类,这些元数据定义的属性不够我用,我现在还想自己在添加一些属性改怎么做,请高手赐教
...全文
193 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangzhe1945 2009-04-11
  • 打赏
  • 举报
回复
[Quote=引用 17 楼 shuiwenyu 的回复:]
没人来啊
期待高手啊
[/Quote]

以上那么多人给答案了,还没人,还要高手
shuiwenyu 2009-04-10
  • 打赏
  • 举报
回复
没人来啊
期待高手啊
ojekleen 2009-04-09
  • 打赏
  • 举报
回复
你通过对象浏览或者转自定义浏览是看不到实现的,你添加属性,得自己实现,因为你的Ashapenode 并不 是结构也不是虚类。。。
ojekleen 2009-04-09
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 shuiwenyu 的回复:]
谁能给我举个例子啊
比如我现在加一个action的属性
public class Ashapenode : ShapeNode, IPersists, InplaceEditable
{

public bool play { get;set;}


}
可是有错误错误 1 “Ashapenode.play.get”必须声明主体,因为它未标记为 abstract 或 extern
[/Quote]

public class Ashapenode : ShapeNode, IPersists, InplaceEditable
{

private bool p;
public bool play{get{return this.p;}set{this.p=value;}}
}
bdmh 2009-04-09
  • 打赏
  • 举报
回复
不能从元数据修改,根据元数据的结构,自己重写一个类,来实现它的功能
ztenv 2009-04-09
  • 打赏
  • 举报
回复
public class Ashapenode:ShapeNode
{
public bool play{get;set;}//vs2008可以这样写的;
}
ztenv 2009-04-09
  • 打赏
  • 举报
回复
从ShapeNode继承,并添加自己需要的属性,
shuiwenyu 2009-04-09
  • 打赏
  • 举报
回复
谁能给我举个例子啊
比如我现在加一个action的属性
public class Ashapenode : ShapeNode, IPersists, InplaceEditable
{

public bool play { get;set;}


}
可是有错误错误 1 “Ashapenode.play.get”必须声明主体,因为它未标记为 abstract 或 extern
huangjinhu1 2009-04-09
  • 打赏
  • 举报
回复
特性 反射
cja03 2009-04-09
  • 打赏
  • 举报
回复
写一个类继承于ShapeNode,然后在类里实现你自己想要的功能。
zcandyly20211 2009-04-09
  • 打赏
  • 举报
回复
友情up!
wangzhe1945 2009-04-09
  • 打赏
  • 举报
回复
public class yourclass:ShapeNode
{
public string yourattribute;
}
「已注销」 2009-04-09
  • 打赏
  • 举报
回复
用partial继承
shuiwenyu 2009-04-09
  • 打赏
  • 举报
回复
元数据类是可读的
不能写的
chenwenyu05 2009-04-09
  • 打赏
  • 举报
回复
自己再写一个类,继承ShapeNode。再写自己想写的属性就可以了。
PandaIT 2009-04-09
  • 打赏
  • 举报
回复
直接在上面加就行了!

元数据类?
jdbcodbc 2009-04-09
  • 打赏
  • 举报
回复
自己重写一个数据的结构一样类
wuyq11 2009-04-09
  • 打赏
  • 举报
回复
重写一个类实现相似功能

111,126

社区成员

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

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

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