acess
This commit is contained in:
parent
492ca38839
commit
4d7222e931
@ -125,13 +125,14 @@ public record class Versioned<T> : Imm
|
||||
|
||||
[lib.Dont]
|
||||
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
||||
internal ChangeDelegate OnChange = (old, cur) => {};
|
||||
public ChangeDelegate OnChange = (old, cur) => {};
|
||||
|
||||
/*
|
||||
public void AddOnChange( ChangeDelegate fn,
|
||||
string reason,
|
||||
[CallerMemberName] string dbgName = "",
|
||||
[CallerFilePath] string dbgPath = "",
|
||||
[CallerLineNumber] int dbgLine = 0
|
||||
[CallerLineNumber] int dbgLine = 0`
|
||||
)
|
||||
{
|
||||
log.debug( $"ADD {log.whatFile(dbgPath)}({dbgLine}): {dbgName} added OnChange bcs {reason}" );
|
||||
@ -147,6 +148,7 @@ public record class Versioned<T> : Imm
|
||||
log.debug( $"REM {log.whatFile(dbgPath)}({dbgLine}): {dbgName} removing OnChange" );
|
||||
OnChange -= fn;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
public T Process( Func<T, T> fn, string reason = "" )
|
||||
|
||||
@ -28,6 +28,8 @@ public class Ref : lib.I_Serialize
|
||||
|
||||
public string Filename =>path;
|
||||
|
||||
|
||||
|
||||
//For construction
|
||||
public Ref()
|
||||
{
|
||||
@ -41,6 +43,8 @@ public class Ref : lib.I_Serialize
|
||||
if( s_verboseLogging ) log.info( $"Ref: {GetType().Name} {path}" );
|
||||
}
|
||||
|
||||
virtual public object lookup() => default;
|
||||
|
||||
virtual public void OnChange()
|
||||
{
|
||||
}
|
||||
@ -60,7 +64,7 @@ public class Ref<T> : Ref where T : class
|
||||
public T? res => m_res != null ? m_res : lookup();
|
||||
|
||||
|
||||
public T? lookup()
|
||||
override public T? lookup()
|
||||
{
|
||||
m_res = Mgr.load<T>( Filename );
|
||||
if( s_verboseLogging ) log.info( $"Ref.lookup {GetType().Name} {GetType().GenericTypeArguments[0]} path {Filename}" );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user