The information a TssHookup needs in order to hook to a particular string property of a particular object. This is intended to support one style of view construction with SharpViews. The idea is that, given a class like StTxtPara and a property like Contents, we could generate a helper class StTxtParaProps, with static methods like this: class StTxtParaProps { public static TssHookupAdapter Contents(StTxtPara target) { return new TssHookupAdapter(target, () => target.Contents, hookup => target.Contents += hookup.TssPropChanged, hookup => target.Contents -= hookup.TssPropChanged); } } This then allows us to do something (as yet not fully designed or implemented) like aView.Add(StTxtParaProps.Contents(aPara)); Problems: (1) the above doesn't look particularly fluent; (2) we have a dependency problem between SharpViews (which defines TssHookupAdapter) and FDO (where we'd like to keep the model-specific code generation). SharpViews already references FDO, and it's unlikely we can change that. The approach used in ExpressionDemo may be more promising.
Inheritance: HookupAdapter
Exemple #1
0
		public TssHookup(TssHookupAdapter propAdapter, IStringParaNotification para)
			: base(propAdapter.Target, para)
		{
			Reader = propAdapter.Reader;
			AddHook = propAdapter.AddHook;
			RemoveHook = propAdapter.RemoveHook;
			AddHook(this);
		}
Exemple #2
0
 public TssHookup(TssHookupAdapter propAdapter, IStringParaNotification para)
     : base(propAdapter.Target, para)
 {
     Reader     = propAdapter.Reader;
     AddHook    = propAdapter.AddHook;
     RemoveHook = propAdapter.RemoveHook;
     AddHook(this);
 }