C# Class Com.Aote.ObjectTools.GeneralObject

表示一个普通对象,普通对象可以到后台加载自己的属性数据。实现了动态属性机制。
Inheritance: CustomTypeHelper, IAsyncObject, ILoadable, IFromJson
ファイルを表示 Open project: DuBin1988/restv2 Class Usage Examples

Public Properties

Property Type Description
CanSaveExProperty System.Windows.DependencyProperty
CanSaveProperty System.Windows.DependencyProperty
CustomePathProperty System.Windows.DependencyProperty
ErrorProperty System.Windows.DependencyProperty
IsInitProperty System.Windows.DependencyProperty
IsOpenedProperty System.Windows.DependencyProperty
LevelProperty System.Windows.DependencyProperty
NotSaveProperty System.Windows.DependencyProperty
OpenedListProperty System.Windows.DependencyProperty
PathProperty System.Windows.DependencyProperty
SourceProperty System.Windows.DependencyProperty
isBusy bool

Public Methods

Method Description
ClearIsModified ( ) : void
Clone ( ) : GeneralObject

复制自己

CompAttrsChanged ( GeneralObject other ) : bool
CopyDataFrom ( GeneralObject go ) : void
CopyFrom ( GeneralObject go ) : void
CopyFromTemple ( GeneralObject tobj, GeneralObject source ) : void

根据模板复制对象

Delete ( ) : void
DeleteToJson ( ) : System.Json.JsonObject

删除对象,返回删除操作的Json格式指令。不执行实际的删除操作。把操作指令交给批处理动作完成。

Equals ( object obj ) : bool

重载对象相等方法,两个对象只要id号相同则相等。如果其中一个没有id号,则不相等。如果都没有id号,那么 只有引用相等时才相等。

FromJson ( System.Json.JsonObject item ) : void

由Json串给对象赋值,将递归进行调用,碰到JsonArray自动把JsonArray转换成ObjectList。 碰到JsonObject,自动转换成GeneralOject。

GeneralObject ( ) : System
GetHashCode ( ) : int

重载获取hash值的方法,返回id的hash值,如果没有,调用基本hash值计算方法

IndexOf ( BaseObjectList list ) : int
Load ( ) : void

开始加载数据

MakeID ( ) : void
MonityList ( ) : void
New ( ) : void

新建对象,把对象的属性清空。调用NewPropertyValue方法,在清空对象属性时,可以根据 配置内容给对象赋默认值。

NewPropertyValue ( string propertyName ) : void
OnCompleted ( AsyncCompletedEventArgs args ) : void
OnDataLoaded ( AsyncCompletedEventArgs args ) : void
OnLoading ( ) : void
OnSourceChanged ( DependencyObject dp, System.Windows.DependencyPropertyChangedEventArgs args ) : void

当数据源发生变化时,复制数据源中的属性到本对象。

Opened ( ) : void
Remove ( ) : void
Save ( ) : void
SaveToJson ( ) : System.Json.JsonObject

保存对象,返回保存对象的Json格式的指令,不执行实际的后台保存工作。统一由BatchExcuteAction 把要执行的数据库操作数据发送给后台服务。

TipError ( ) : void
ToJson ( ) : System.Json.JsonObject
ToSource ( ) : void
ToString ( ) : string

Private Methods

Method Description
Closed ( ObjectList openedList, string childName ) : void
Extend ( ObjectList openedList, string childName ) : int
OnCanSaveChanged ( DependencyObject dp, System.Windows.DependencyPropertyChangedEventArgs args ) : void
OnCanSaveExChanged ( DependencyObject dp, System.Windows.DependencyPropertyChangedEventArgs args ) : void
OnCustomePathChanged ( DependencyObject dp, System.Windows.DependencyPropertyChangedEventArgs args ) : void
OnIsInitChanged ( DependencyObject dp, System.Windows.DependencyPropertyChangedEventArgs args ) : void
OnIsOpenedChanged ( DependencyObject dp, System.Windows.DependencyPropertyChangedEventArgs args ) : void
OnPathChanged ( DependencyObject dp, System.Windows.DependencyPropertyChangedEventArgs args ) : void
SetCollectionProperty ( string key, BaseObjectList ol ) : void
ol_PropertyChanged ( object sender, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Method Details

ClearIsModified() public method

public ClearIsModified ( ) : void
return void

Clone() public method

复制自己
public Clone ( ) : GeneralObject
return GeneralObject

CompAttrsChanged() public method

public CompAttrsChanged ( GeneralObject other ) : bool
other GeneralObject
return bool

CopyDataFrom() public method

public CopyDataFrom ( GeneralObject go ) : void
go GeneralObject
return void

CopyFrom() public method

public CopyFrom ( GeneralObject go ) : void
go GeneralObject
return void

CopyFromTemple() public method

根据模板复制对象
public CopyFromTemple ( GeneralObject tobj, GeneralObject source ) : void
tobj GeneralObject 模板对象
source GeneralObject 数据源对象
return void

Delete() public method

public Delete ( ) : void
return void

DeleteToJson() public method

删除对象,返回删除操作的Json格式指令。不执行实际的删除操作。把操作指令交给批处理动作完成。
public DeleteToJson ( ) : System.Json.JsonObject
return System.Json.JsonObject

Equals() public method

重载对象相等方法,两个对象只要id号相同则相等。如果其中一个没有id号,则不相等。如果都没有id号,那么 只有引用相等时才相等。
public Equals ( object obj ) : bool
obj object 要比较的对象
return bool

FromJson() public method

由Json串给对象赋值,将递归进行调用,碰到JsonArray自动把JsonArray转换成ObjectList。 碰到JsonObject,自动转换成GeneralOject。
public FromJson ( System.Json.JsonObject item ) : void
item System.Json.JsonObject 从这个json对象给对象属性赋值
return void

GeneralObject() public method

public GeneralObject ( ) : System
return System

GetHashCode() public method

重载获取hash值的方法,返回id的hash值,如果没有,调用基本hash值计算方法
public GetHashCode ( ) : int
return int

IndexOf() public method

public IndexOf ( BaseObjectList list ) : int
list BaseObjectList
return int

Load() public method

开始加载数据
public Load ( ) : void
return void

MakeID() public method

public MakeID ( ) : void
return void

MonityList() public method

public MonityList ( ) : void
return void

New() public method

新建对象,把对象的属性清空。调用NewPropertyValue方法,在清空对象属性时,可以根据 配置内容给对象赋默认值。
public New ( ) : void
return void

NewPropertyValue() public method

public NewPropertyValue ( string propertyName ) : void
propertyName string
return void

OnCompleted() public method

public OnCompleted ( AsyncCompletedEventArgs args ) : void
args System.ComponentModel.AsyncCompletedEventArgs
return void

OnDataLoaded() public method

public OnDataLoaded ( AsyncCompletedEventArgs args ) : void
args System.ComponentModel.AsyncCompletedEventArgs
return void

OnLoading() public method

public OnLoading ( ) : void
return void

OnSourceChanged() public static method

当数据源发生变化时,复制数据源中的属性到本对象。
public static OnSourceChanged ( DependencyObject dp, System.Windows.DependencyPropertyChangedEventArgs args ) : void
dp System.Windows.DependencyObject 代表对象自身
args System.Windows.DependencyPropertyChangedEventArgs 改变的新值为获取数据的源
return void

Opened() public method

public Opened ( ) : void
return void

Remove() public method

public Remove ( ) : void
return void

Save() public method

public Save ( ) : void
return void

SaveToJson() public method

保存对象,返回保存对象的Json格式的指令,不执行实际的后台保存工作。统一由BatchExcuteAction 把要执行的数据库操作数据发送给后台服务。
public SaveToJson ( ) : System.Json.JsonObject
return System.Json.JsonObject

TipError() public method

public TipError ( ) : void
return void

ToJson() public method

public ToJson ( ) : System.Json.JsonObject
return System.Json.JsonObject

ToSource() public method

public ToSource ( ) : void
return void

ToString() public method

public ToString ( ) : string
return string

Property Details

CanSaveExProperty public_oe static_oe property

public static DependencyProperty,System.Windows CanSaveExProperty
return System.Windows.DependencyProperty

CanSaveProperty public_oe static_oe property

public static DependencyProperty,System.Windows CanSaveProperty
return System.Windows.DependencyProperty

CustomePathProperty public_oe static_oe property

public static DependencyProperty,System.Windows CustomePathProperty
return System.Windows.DependencyProperty

ErrorProperty public_oe static_oe property

public static DependencyProperty,System.Windows ErrorProperty
return System.Windows.DependencyProperty

IsInitProperty public_oe static_oe property

public static DependencyProperty,System.Windows IsInitProperty
return System.Windows.DependencyProperty

IsOpenedProperty public_oe static_oe property

public static DependencyProperty,System.Windows IsOpenedProperty
return System.Windows.DependencyProperty

LevelProperty public_oe static_oe property

public static DependencyProperty,System.Windows LevelProperty
return System.Windows.DependencyProperty

NotSaveProperty public_oe static_oe property

public static DependencyProperty,System.Windows NotSaveProperty
return System.Windows.DependencyProperty

OpenedListProperty public_oe static_oe property

public static DependencyProperty,System.Windows OpenedListProperty
return System.Windows.DependencyProperty

PathProperty public_oe static_oe property

public static DependencyProperty,System.Windows PathProperty
return System.Windows.DependencyProperty

SourceProperty public_oe static_oe property

public static DependencyProperty,System.Windows SourceProperty
return System.Windows.DependencyProperty

isBusy public_oe property

是否正忙于工作
public bool isBusy
return bool