Browse Source

Revert MakeCreator.cs

pull/101/head
Arimodu 1 year ago
parent
commit
de70afe509
1 changed files with 3 additions and 17 deletions
  1. +3
    -17
      IPA.Loader/Config/Stores/GeneratedStoreImpl/MakeCreator.cs

+ 3
- 17
IPA.Loader/Config/Stores/GeneratedStoreImpl/MakeCreator.cs View File

@ -430,18 +430,15 @@ namespace IPA.Config.Stores
typeBuilder.AddInterfaceImplementation(typeof(IConfigStore)); typeBuilder.AddInterfaceImplementation(typeof(IConfigStore));
var IConfigStore_t = typeof(IConfigStore); var IConfigStore_t = typeof(IConfigStore);
var IConfigStore_GetSyncObject = IConfigStore_t.GetProperty(nameof(IConfigStore.SyncAction)).GetGetMethod();
var IConfigStore_SetSyncAction = IConfigStore_t.GetProperty(nameof(IConfigStore.SyncAction)).GetSetMethod();
var IConfigStore_GetSyncObject = IConfigStore_t.GetProperty(nameof(IConfigStore.SyncObject)).GetGetMethod();
var IConfigStore_GetWriteSyncObject = IConfigStore_t.GetProperty(nameof(IConfigStore.WriteSyncObject)).GetGetMethod(); var IConfigStore_GetWriteSyncObject = IConfigStore_t.GetProperty(nameof(IConfigStore.WriteSyncObject)).GetGetMethod();
var IConfigStore_WriteTo = IConfigStore_t.GetMethod(nameof(IConfigStore.WriteTo)); var IConfigStore_WriteTo = IConfigStore_t.GetMethod(nameof(IConfigStore.WriteTo));
var IConfigStore_ReadFrom = IConfigStore_t.GetMethod(nameof(IConfigStore.ReadFrom)); var IConfigStore_ReadFrom = IConfigStore_t.GetMethod(nameof(IConfigStore.ReadFrom));
#region IConfigStore.SyncObject #region IConfigStore.SyncObject
var syncObjProp = typeBuilder.DefineProperty(nameof(IConfigStore.SyncAction), PropertyAttributes.None, IConfigStore_GetSyncObject.ReturnType, null);
var syncObjPropGet = typeBuilder.DefineMethod($"get_{nameof(IConfigStore.SyncAction)}", virtualPropertyMethodAttr, syncObjProp.PropertyType, Type.EmptyTypes);
var syncObjPropSet = typeBuilder.DefineMethod($"set_{nameof(IConfigStore.SyncAction)}", virtualPropertyMethodAttr, null, new[] { syncObjProp.PropertyType });
var syncObjProp = typeBuilder.DefineProperty(nameof(IConfigStore.SyncObject), PropertyAttributes.None, IConfigStore_GetSyncObject.ReturnType, null);
var syncObjPropGet = typeBuilder.DefineMethod($"<g>{nameof(IConfigStore.SyncObject)}", virtualPropertyMethodAttr, syncObjProp.PropertyType, Type.EmptyTypes);
syncObjProp.SetGetMethod(syncObjPropGet); syncObjProp.SetGetMethod(syncObjPropGet);
syncObjProp.SetSetMethod(syncObjPropSet);
typeBuilder.DefineMethodOverride(syncObjPropGet, IConfigStore_GetSyncObject); typeBuilder.DefineMethodOverride(syncObjPropGet, IConfigStore_GetSyncObject);
{ {
@ -452,18 +449,7 @@ namespace IPA.Config.Stores
il.Emit(OpCodes.Call, Impl.ImplGetSyncObjectMethod); il.Emit(OpCodes.Call, Impl.ImplGetSyncObjectMethod);
il.Emit(OpCodes.Ret); il.Emit(OpCodes.Ret);
} }
{
var il = syncObjPropSet.GetILGenerator();
il.Emit(OpCodes.Ldarg_0);
il.Emit(OpCodes.Ldarg_1);
il.Emit(OpCodes.Tailcall);
il.Emit(OpCodes.Call, Impl.ImplSetSyncActionMethod);
il.Emit(OpCodes.Ret);
}
#endregion #endregion
#region IConfigStore.WriteSyncObject #region IConfigStore.WriteSyncObject
var writeSyncObjProp = typeBuilder.DefineProperty(nameof(IConfigStore.WriteSyncObject), PropertyAttributes.None, IConfigStore_GetWriteSyncObject.ReturnType, null); var writeSyncObjProp = typeBuilder.DefineProperty(nameof(IConfigStore.WriteSyncObject), PropertyAttributes.None, IConfigStore_GetWriteSyncObject.ReturnType, null);
var writeSyncObjPropGet = typeBuilder.DefineMethod($"<g>{nameof(IConfigStore.WriteSyncObject)}", virtualPropertyMethodAttr, writeSyncObjProp.PropertyType, Type.EmptyTypes); var writeSyncObjPropGet = typeBuilder.DefineMethod($"<g>{nameof(IConfigStore.WriteSyncObject)}", virtualPropertyMethodAttr, writeSyncObjProp.PropertyType, Type.EmptyTypes);


Loading…
Cancel
Save