Example #1
0
 private void OnAccessoryTransferred(object sender, AccessoryTransferEventArgs e)
 {
     if (CheckDisposed())
     {
         return;
     }
     AccessoryTransferred?.Invoke(sender, e);
 }
Example #2
0
        private static void OnChangeAcs(object instance, int selSrc, int selDst)
        {
            if (KoikatuAPI.EnableDebugLogging)
            {
                KoikatuAPI.Logger.LogMessage($"AccessoryTransferred - srcId:{selSrc}, dstId:{selDst}");
            }

            if (AccessoryTransferred == null)
            {
                return;
            }
            try
            {
                var args = new AccessoryTransferEventArgs(selSrc, selDst);

                AccessoryTransferred(instance, args);
            }
            catch (Exception ex)
            {
                KoikatuAPI.Logger.LogError("Crash in AccessoryTransferred event: " + ex);
            }
        }
Example #3
0
        private static void OnChangeAcs(CvsAccessoryChange instance)
        {
            if (AccessoryTransferred == null)
            {
                return;
            }

            try
            {
                var traverse = Traverse.Create(instance);
                var selSrc   = traverse.Field("selSrc").GetValue <int>();
                var selDst   = traverse.Field("selDst").GetValue <int>();

                var args = new AccessoryTransferEventArgs(selSrc, selDst);

                AccessoryTransferred(instance, args);
            }
            catch (Exception ex)
            {
                KoikatuAPI.Log(LogLevel.Error, "Crash in AccessoryTransferred event: " + ex);
            }
        }