agrobot_base/Exemplos/SharpDX-master/Source/SharpDX.DirectManipulation/Manager2.cs

29 lines
830 B
C#
Raw Permalink Normal View History

2023-08-31 11:50:53 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SharpDX.DirectManipulation
{
partial class Manager2
{
public Manager2() : base(IntPtr.Zero)
{
Utilities.CreateComInstance(ManagerClassId, Utilities.CLSCTX.ClsctxInprocServer, Utilities.GetGuidFromType(typeof(Manager2)), this);
}
/// <summary>
/// Factory method to create a behavior.
/// </summary>
/// <typeparam name="T">The type of the COM object to create.</typeparam>
/// <param name="classId">CLSID of the behavior. The CLSID specifies the type of behavior.</param>
/// <returns></returns>
public T CreateBehavior<T>(Guid classId) where T : ComObject
{
IntPtr temp;
CreateBehavior(classId, Utilities.GetGuidFromType(typeof(T)), out temp);
return ComObject.FromPointer<T>(temp);
}
}
}