Ejemplo n.º 1
0
 private void GetAudioVolumeLevel()
 {
     _Part.Activate(CLSCTX.ALL, ref IIDs.IID_IAudioVolumeLevel, out object result);
     if (result != null)
     {
         _AudioVolumeLevel = new AudioVolumeLevel(result as IAudioVolumeLevel);
         _AudioVolumeLevelChangeNotification = new ControlChangeNotify(this);
         Marshal.ThrowExceptionForHR(_Part.RegisterControlChangeCallback(ref IIDs.IID_IAudioVolumeLevel, _AudioVolumeLevelChangeNotification));
     }
 }
Ejemplo n.º 2
0
 public void ActivatePart(GameObject part)
 {
     if (CurrentActivePart != null)
     {
         CurrentActivePart.Diactiviate();
     }
     CurrentActivePart = part.GetComponent <IPart>();
     CurrentActivePart.Activate();
 }
Ejemplo n.º 3
0
        public static IKsJackDescription KsJackDescription(this IPart part)
        {
            var attribute = typeof(IKsJackDescription).GetCustomAttributes(typeof(GuidAttribute), true).Cast <GuidAttribute>().FirstOrDefault();

            if (attribute == null)
            {
                return(null);
            }

            var iidKsJackDescription = new Guid(attribute.Value);

            part.Activate((uint)CLSCTX.CLSCTX_INPROC_SERVER, ref iidKsJackDescription, out var instancePtr);

            return(instancePtr as IKsJackDescription);
        }