private Func <object> Prepare(IEnumerable <Parameter> parameters) { if (_componentRegistration.Sharing == InstanceSharing.None || parameters.Any()) { return(Activate(_scope, parameters, true)); } bool firstInstance = false; var instance = _activationScope.GetOrCreateAndShare( _componentRegistration.Id, () => { firstInstance = true; return(Activate(_activationScope, parameters, false)()); }); if (firstInstance) { _componentRegistration.RaiseActivated(_service, _scope, parameters, instance); var ev = SharedInstanceActivation; if (ev != null) { ev(instance, EventArgs.Empty); } } return(() => instance); }
public Result ActivateFirmware(DateTime dtActivationTime) { Activate.ActivationTime = dtActivationTime; Activate.Execute(); return(Activate.JobResult); }
private void Start() { spriteRenderer = GetComponent <SpriteRenderer>(); levelTextPopulater = FindObjectOfType <LevelTextPopulater>(); if (spriteRenderer.sprite == null) { spriteRenderer.sprite = inactiveSprite; } changeSprite = false; activateScript = FindObjectOfType <Activate>(); gameSaverScript = FindObjectOfType <GameSaver>(); //print("Point Stars earned: " + PlayerPrefs.GetInt(activateScript.activeCityName + gameSaverScript.keyPointsStarEarnedPerLevel)); //print("Coin Stars earned: " + PlayerPrefs.GetInt(activateScript.activeCityName + gameSaverScript.keyCoinsStarEarnedPerLevel)); //print("Match Stars earned: " + PlayerPrefs.GetInt(activateScript.activeCityName + gameSaverScript.keyMatchesStarEarnedPerLevel)); starCityName = levelTextPopulater.cityName.text; FillStars(); //else //{ // starFilled = false; //} }
private void initStates() { takeState = Take.Start; activateState = Activate.Start; deactivateState = Deactivate.Start; releaseState = Release.Start; tasteState = Taste.Start; smellState = Smell.Start; /*openDoorState = OpenDoor.Start; closeDoorState = CloseDoor.Start;*/ moveState = Move.Start; rotateState = Rotate.Start; turnState = Turn.Start; commandStatus = CommandStatus.Running; headFocusState = HeadFocus.Start; headResetState = HeadReset.Start; lookForState = LookFor.Start; speakState = Speak.Start; cancelState = Cancel.Start; getSensesState = GetSenses.Start; reset = true; }
public GameBonus(Activate activate, Action action, Update update, Deactivate deactivate) { this.activate = activate; this.action = action; this.update = update; this.deactivate = deactivate; }
/// <summary> /// Setup List or Array, takes either one <see cref="Activate" /> or a list of constructor args that will use objects Type /// </summary> /// <param name="constructorArgs">The constructor args.</param> /// <returns></returns> public dynamic ListSetup(params dynamic[] constructorArgs) { var tActivate = constructorArgs.OfType <Activate>().SingleOrDefault(); if (tActivate == null) { if (!this._buildType.TryGetValue("Object", out tActivate)) { tActivate = null; } if (tActivate != null) { tActivate = new Activate(tActivate.Type, constructorArgs); } if (tActivate == null) { tActivate = new Activate <List>(constructorArgs); } } this._buildType["List"] = tActivate; this._buildType["Array"] = tActivate; return(this); }
public ApiWrapper(IntPtr hModule) { if (hModule == IntPtr.Zero) { throw new ArgumentOutOfRangeException(nameof(hModule), hModule, "无法初始化Win32插件,因为使用了空指针。"); } this.hModule = hModule; this.f_GetAllPlugins = Marshal.GetDelegateForFunctionPointer <GetAllPlugins>(GetProcAddress(hModule, "GetAllPlugins")); this.f_GetCompatibleHosts = Marshal.GetDelegateForFunctionPointer <GetCompatibleHosts>(GetProcAddress(hModule, "GetCompatibleHosts")); this.f_Activate = Marshal.GetDelegateForFunctionPointer <Activate>(GetProcAddress(hModule, "Activate")); this.f_Deactivate = Marshal.GetDelegateForFunctionPointer <Deactivate>(GetProcAddress(hModule, "Deactivate")); this.f_Book_GetTitle = Marshal.GetDelegateForFunctionPointer <ApiGetString>(GetProcAddress(hModule, "Book_GetTitle")); this.f_Book_GetAuthor = Marshal.GetDelegateForFunctionPointer <ApiGetString>(GetProcAddress(hModule, "Book_GetAuthor")); this.f_Book_GetTags = Marshal.GetDelegateForFunctionPointer <ApiGetArray>(GetProcAddress(hModule, "Book_GetTags")); this.f_Book_GetDescription = Marshal.GetDelegateForFunctionPointer <ApiGetString>(GetProcAddress(hModule, "Book_GetDescription")); this.f_Book_GetVolumes = Marshal.GetDelegateForFunctionPointer <ApiGetArray>(GetProcAddress(hModule, "Book_GetVolumes")); this.f_Volume_GetTitle = Marshal.GetDelegateForFunctionPointer <ApiGetString>(GetProcAddress(hModule, "Volume_GetTitle")); this.f_Volume_GetChapters = Marshal.GetDelegateForFunctionPointer <ApiGetArray>(GetProcAddress(hModule, "Volume_GetChapters")); this.f_Chapter_GetTitle = Marshal.GetDelegateForFunctionPointer <ApiGetString>(GetProcAddress(hModule, "Chapter_GetTitle")); this.f_Chapter_GetUpdatedAt = Marshal.GetDelegateForFunctionPointer <ApiGetInt64>(GetProcAddress(hModule, "Chapter_GetUpdatedAt")); }
void Start() { levelTextPopulater = FindObjectOfType <LevelTextPopulater>(); cityName = levelTextPopulater.cityName.text; cityName = cityName.Replace(" ", ""); spriteRenderer = GetComponent <SpriteRenderer>(); if (spriteRenderer.sprite == null) { spriteRenderer.sprite = buttonIn; } sceneName = SceneManager.GetActiveScene().name; globalControlScript = FindObjectOfType <GlobalControl>(); //print("Marker name: " + cityName + "Marker"); activeMarker = GameObject.Find(cityName.Replace(" ", "") + "Marker"); activeActivateScript = activeMarker.GetComponent <Activate>(); audioSource = GetComponent <AudioSource>(); soundPlayed = false; gameSaverScript = FindObjectOfType <GameSaver>(); }
private void SetPower() { activated = true; timer = powerUpTime; Debug.Log(timer); rand = Random.Range(0, 4); if (rand <= 1) { activate = LongPaddle; deactivate = ResetPaddle; } else if (rand <= 2) { activate = BigBall; deactivate = ResetBall; } else if (rand <= 3) { activate = ShortPaddle; deactivate = ResetPaddle; } else { activate = SwapControls; deactivate = RestoreControls; } }
public void AType(Type type) { var result = Activate.New(type); // type.ShouldBe(result.GetType()); }
//init void Start() { //get game objects from scene globalObj = GameObject.FindWithTag(TAG_GLOBAL); //global game object globalScript = globalObj.GetComponent<Global>(); //global script setupObj = GameObject.FindWithTag(TAG_SETUP); //setup game object connectScript = setupObj.GetComponent<Connect>(); //connect script activateScript = setupObj.GetComponent<Activate>(); //activate script //disable scripts to start //note: disable/uncheck scripts in the Unity interface connectScript.enabled = false; activateScript.enabled = false; //state manager //transition into scene //initialize since this is the first scene if (StateManager.Instance != null) { //set the transition effects for the state manager StateManager.Instance.gameObject.GetComponent<TransitionFade>().isFadingIn = true; StateManager.Instance.gameObject.GetComponent<TransitionFade>().isHoldFade = false; } //audio manager //initialize since this is the first scene if (AudioManager.Instance != null) { //set the transition effects for the audio manager //bgm AudioManager.Instance.switchBgmAfterDelay(AudioManager.Instance.bgmMenu, 0.0f); AudioManager.Instance.bgmIsFadingIn = true; AudioManager.Instance.bgmIsHoldFade = false; } } //end function
public void UseGivenInstance() { var rule = new ActivateUsingInstance( typeof(IWrappable), typeof(ActivateUsingInstanceUsesTheInstance), nameof(UseMe)); Activate.FromDefaultRulesAnd <IWrappable>(this, rule); }
private void ShowExercisesWindow() { Activate?.Invoke(); List <CheckedListExerciseItem> exercises = Sections.Where(checkBox => checkBox.IsChecked == true).OrderBy(x => x.LastUsedTime).Take(5).ToList(); ExercisesWindow window = new ExercisesWindow(exercises); window.ShowDialog(); UpdateInfo(); }
async Task On(Activate _) { var streamProvider = GetStreamProvider("sms"); var guid = this.GetPrimaryKey(out var extension); var stream = streamProvider.GetStream <IEventEnvelope>(guid, extension); await stream.SubscribeAsync((envelope, token) => Receive(envelope)); }
public async Task <IActionResult> Activate(Guid activationUrl) { var command = new Activate { ActivationUrl = activationUrl }; await _commandDispatcher.DispatchAsync(command); return(NoContent()); }
private SourceReader CreateSourceReader(Activate activate) { SourceReader reader = null; using (var source = activate.ActivateObject <MediaSource>()) { using (var mediaAttributes = new MediaAttributes()) { if (asyncMode) { sourceReaderCallback = new SourceReaderCallback(); sourceReaderCallback.OnReadSample += SourceReaderCallback_OnReadSample; sourceReaderCallback.OnFlush += SourceReaderCallback_OnFlush; //sourceReaderCallback.OnEvent += SourceReaderCallback_OnEvent; var pUnk = Marshal.GetIUnknownForObject(sourceReaderCallback); try { using (var comObj = new SharpDX.ComObject(pUnk)) { mediaAttributes.Set(SourceReaderAttributeKeys.AsyncCallback, comObj); } } finally { if (pUnk != IntPtr.Zero) { Marshal.Release(pUnk); } } } //mediaAttributes.Set(SourceReaderAttributeKeys.EnableVideoProcessing, 1); /* //Не все камеры поддерживают! * mediaAttributes.Set(SinkWriterAttributeKeys.LowLatency, true); * * mediaAttributes.Set(SourceReaderAttributeKeys.EnableAdvancedVideoProcessing, true); * mediaAttributes.Set(SinkWriterAttributeKeys.ReadwriteDisableConverters, 0); * * mediaAttributes.Set(SinkWriterAttributeKeys.ReadwriteEnableHardwareTransforms, 1); * using (var devMan = new DXGIDeviceManager()) * { * devMan.ResetDevice(device); * mediaAttributes.Set(SourceReaderAttributeKeys.D3DManager, devMan); * } */ reader = new SourceReader(source, mediaAttributes); } } return(reader); }
private void Awake() { m_activate = GetComponent <Activate>(); m_moveGroup = transform.Find("MoveGroup"); m_worldObejct = GetComponent <WorldObject>(); StartCoroutine(CheckActivate()); }
/// <summary> /// Disposes this resampler /// </summary> protected override void Dispose(bool disposing) { if (activate != null) { activate.ShutdownObject(); activate = null; } base.Dispose(disposing); }
public bool Activestate() { Connect c = new Connect("spd_GetActivestate"); DataSet ds = c.query("statusflag"); Activate a = new Activate(); bool rr = Convert.ToBoolean(ds.Tables[0].Rows[0]["statusflag"].ToString()); return(rr); }
protected virtual void Effect(Collision2D collision) { Player = collision.gameObject.GetComponent <PlayerShoot>(); Player.upgraded = true; GameObject turret = GameObject.Find("Turret"); Activate script = turret.GetComponent <Activate>(); script.ActivateSelf(); }
private void Awake() { m_activate = GetComponent <Activate>(); m_worldObject = GetComponent <WorldObject>(); InitDoor(); StartCoroutine(CheckActivate()); }
public void ActivationTest() { var res0 = Activate.Logistic(0); var res1 = Activate.ReLU(0); var res2 = Activate.Tanh(0); Assert.AreEqual(0.5, res0, 1E-4); Assert.AreEqual(0, res1, 1E-4); Assert.AreEqual(0, res2, 1E-4); }
void ToolbarButton_MouseEnter(object sender, MouseEventArgs e) { if (!isSelected) { Activate.Begin(); buttonBorder.BorderThickness = new Thickness(1, 0, 1, 1); buttonBorder.Background = new SolidColorBrush(Colors.Orange); buttonBorderRight.BorderThickness = new Thickness(0, 1, 0, 0); ButtonTextBlock.Foreground = new SolidColorBrush(Colors.White); } }
/// <summary> /// Select this button /// </summary> public void SelectButton() { this.isSelected = true; Activate.Begin(); buttonBorder.BorderThickness = new Thickness(2, 0, 2, 2); buttonBorder.Background = new SolidColorBrush(Colors.Magenta); buttonBorder.BorderBrush = new SolidColorBrush(Colors.White); buttonBorderRight.BorderThickness = new Thickness(0, 2, 0, 0); buttonBorderRight.BorderBrush = new SolidColorBrush(Colors.Gray); ButtonTextBlock.Foreground = new SolidColorBrush(Colors.White); }
public WINDOW() { InitializeComponent(); textBox1.CharacterCasing = CharacterCasing.Upper; textBox2.CharacterCasing = CharacterCasing.Upper; textBox3.CharacterCasing = CharacterCasing.Upper; textBox4.CharacterCasing = CharacterCasing.Upper; textBox5.CharacterCasing = CharacterCasing.Upper; controller = new Activate(); window = new WINDOW_MAIN(); }
private void end() { switch (action) { case Action.Take: takeState = Take.End; break; case Action.Activate: activateState = Activate.End; break; case Action.Deactivate: deactivateState = Deactivate.End; break; case Action.Release: releaseState = Release.End; break; case Action.Taste: tasteState = Taste.End; break; case Action.Smell: smellState = Smell.End; break; case Action.Move: moveState = Move.End; break; case Action.Rotate: rotateState = Rotate.End; break; case Action.Turn: turnState = Turn.End; break; case Action.HeadFocus: headFocusState = HeadFocus.End; break; case Action.HeadReset: headResetState = HeadReset.End; break; case Action.LookFor: lookForState = LookFor.End; break; case Action.Speak: speakState = Speak.End; break; case Action.Cancel: cancelState = Cancel.End; break; case Action.GetSenses: getSensesState = GetSenses.End; break; default: break; ; } }
public void AndToGetConstructorDependenciesRight() { var result = Activate.New <ClassWith3ConstructorParams <INterfaceWithClassInSameAssembly, INterfaceWithFakeInTestAssembly, INterfaceWithClassInNotReferencedAssembly> >(); result.ShouldNotBeNull(); result.Param1.ShouldNotBeNull(); result.Param2.ShouldNotBeNull(); result.Param3.ShouldNotBeNull(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { updateUser = new Update(this); activateUser = new Activate(this); if (winUser != null) { Embed.Children.Add(updateUser); } else { Embed.Children.Add(activateUser); } }
public void Switch() { if (activeTurn) { Activate?.Invoke(); } else { Deactivate?.Invoke(); } activeTurn = !activeTurn; }
private int _Uds8LACABRKlO8SErTdqBEBcjyA(Activate activate, ref AutoNexus._NgEaTpjfBI3veqdBfggv7SjSaRU _NgEaTpjfBI3veqdBfggv7SjSaRU_0) { double num = this._W6Ov6AArxzTTDnCyBtZPqkqNaKf._50Ms1zsqax9Ua48PaWMPQfIENYb._Z5Ka0qxWyONdxRmDe3dCDBoiFMw._lEH5A8k6GZhNzOJciwld9Bb4RqP(_NgEaTpjfBI3veqdBfggv7SjSaRU_0._OWPal6UeunpGQX6SceuuADJxQ4k._Z5Ka0qxWyONdxRmDe3dCDBoiFMw); this._oyoi7MZ00uEXn3wJhjCw1K4UBTJ((double)activate.Range, _NgEaTpjfBI3veqdBfggv7SjSaRU_0._OWPal6UeunpGQX6SceuuADJxQ4k._WHCAkdeYqXMbNsGZ6LrBhVGy9y4, 1.0); int result = (int)this._oyoi7MZ00uEXn3wJhjCw1K4UBTJ((double)activate.Amount, _NgEaTpjfBI3veqdBfggv7SjSaRU_0._OWPal6UeunpGQX6SceuuADJxQ4k._WHCAkdeYqXMbNsGZ6LrBhVGy9y4, 0.0); if (num >= _NgEaTpjfBI3veqdBfggv7SjSaRU_0._a8AkCF855MfIlZCpL3R4tVhzRug) { return(0); } return(result); }
/// <summary> /// Gets a list of Microsoft Media Foundation transforms (MFTs) that match specified search criteria. This function extends the <strong><see cref="SharpDX.MediaFoundation.MediaFactory.TEnum"/></strong> function. /// </summary> /// <param name="guidCategory">A GUID that specifies the category of MFTs to enumerate. For a list of MFT categories, see <strong><see cref="SharpDX.MediaFoundation.TransformCategoryGuids"/></strong>.</param> /// <param name="enumFlags">The bitwise OR of zero or more flags from the <strong><see cref="SharpDX.MediaFoundation.TransformEnumFlag"/></strong> enumeration.</param> /// <param name="inputTypeRef">A pointer to an <strong><see cref="SharpDX.MediaFoundation.TRegisterTypeInformation"/></strong> structure that specifies an input media type to match.<para>This parameter can be NULL. If NULL, all input types are matched.</para></param> /// <param name="outputTypeRef">A pointer to an <strong><see cref="SharpDX.MediaFoundation.TRegisterTypeInformation"/></strong> structure that specifies an output media type to match.<para>This parameter can be NULL. If NULL, all output types are matched.</para></param> /// <returns>Returnss an array of <strong><see cref="SharpDX.MediaFoundation.Activate"/></strong> objects. Each object represents an activation object for an MFT that matches the search criteria. The function allocates the memory for the array. The caller must release the pointers and call the Dispose for each element in the array.</returns> /// <msdn-id>dd388652</msdn-id> /// <unmanaged>HRESULT MFTEnumEx([In] GUID guidCategory,[In] unsigned int Flags,[In, Optional] const MFT_REGISTER_TYPE_INFO* pInputType,[In, Optional] const MFT_REGISTER_TYPE_INFO* pOutputType,[Out, Buffer] IMFActivate*** pppMFTActivate,[Out] unsigned int* pnumMFTActivate)</unmanaged> /// <unmanaged-short>MFTEnumEx</unmanaged-short> public static Activate[] FindTransform(Guid guidCategory, TransformEnumFlag enumFlags, TRegisterTypeInformation? inputTypeRef = null, TRegisterTypeInformation? outputTypeRef = null) { IntPtr pActivatesArr; int pNumActivates; TEnumEx(guidCategory, (int)enumFlags, inputTypeRef, outputTypeRef, out pActivatesArr, out pNumActivates); var activates = new Activate[pNumActivates]; unsafe { var ptr = (IntPtr*)(pActivatesArr); for (int i = 0; i < pNumActivates; i++) { activates[i] = new Activate(ptr[i]); } } Marshal.FreeCoTaskMem(pActivatesArr); return activates; }
/// <summary> /// <p>Enumerates a list of audio or video capture devices.</p> /// </summary> /// <param name="attributesRef"><dd> <p>Pointer to an attribute store that contains search criteria. To create the attribute store, call <strong><see cref="SharpDX.MediaFoundation.MediaFactory.CreateAttributes"/></strong>. Set one or more of the following attributes on the attribute store:</p> <table> <tr><th>Value</th><th>Meaning</th></tr> <tr><td><dl> <dt><strong><see cref="SharpDX.MediaFoundation.CaptureDeviceAttributeKeys.SourceType"/></strong></dt> </dl> </td><td> <p>Specifies whether to enumerate audio or video devices. (Required.)</p> </td></tr> <tr><td><dl> <dt><strong><see cref="SharpDX.MediaFoundation.CaptureDeviceAttributeKeys.SourceTypeAudcapRole"/></strong></dt> </dl> </td><td> <p>For audio capture devices, specifies the device role. (Optional.)</p> </td></tr> <tr><td><dl> <dt><strong><see cref="SharpDX.MediaFoundation.CaptureDeviceAttributeKeys.SourceTypeVidcapCategory"/></strong></dt> </dl> </td><td> <p>For video capture devices, specifies the device category. (Optional.)</p> </td></tr> </table> <p>?</p> </dd></param> /// <param name="pSourceActivateOut"><dd> <p>Receives an array of <strong><see cref="SharpDX.MediaFoundation.Activate"/></strong> interface references. Each reference represents an activation object for a media source. The function allocates the memory for the array. The caller must release the references in the array and call <strong>CoTaskMemFree</strong> to free the memory for the array.</p> </dd></param> /// <param name="cSourceActivateRef"><dd> <p>Receives the number of elements in the <em>pppSourceActivate</em> array. If no capture devices match the search criteria, this parameter receives the value 0.</p> </dd></param> /// <returns><p>If this function succeeds, it returns <strong><see cref="SharpDX.Result.Ok"/></strong>. Otherwise, it returns an <strong><see cref="SharpDX.Result"/></strong> error code.</p></returns> /// <remarks> /// <p>Each returned <strong><see cref="SharpDX.MediaFoundation.Activate"/></strong> reference represents a capture device, and can be used to create a media source for that device. You can also use the <strong><see cref="SharpDX.MediaFoundation.Activate"/></strong> reference to query for attributes that describe the device. The following attributes might be set:</p><table> <tr><th>Attribute</th><th>Description</th></tr> <tr><td> <see cref="SharpDX.MediaFoundation.CaptureDeviceAttributeKeys.FriendlyName"/> </td><td>The display name of the device.</td></tr> <tr><td> <see cref="SharpDX.MediaFoundation.CaptureDeviceAttributeKeys.MediaType"/> </td><td>The major type and subtype GUIDs that describe the device's output format.</td></tr> <tr><td> <see cref="SharpDX.MediaFoundation.CaptureDeviceAttributeKeys.SourceType"/> </td><td>The type of capture device (audio or video).</td></tr> <tr><td> <see cref="SharpDX.MediaFoundation.CaptureDeviceAttributeKeys.SourceTypeAudcapEndpointId"/> </td><td>The audio endpoint ID string. (Audio devices only.)</td></tr> <tr><td> <see cref="SharpDX.MediaFoundation.CaptureDeviceAttributeKeys.SourceTypeVidcapCategory"/> </td><td>The device category. (Video devices only.)</td></tr> <tr><td> <see cref="SharpDX.MediaFoundation.CaptureDeviceAttributeKeys.SourceTypeVidcapHwSource"/> </td><td> Whether a device is a hardware or software device. (Video devices only.)</td></tr> <tr><td> <see cref="SharpDX.MediaFoundation.CaptureDeviceAttributeKeys.SourceTypeVidcapSymbolicLink"/> </td><td>The symbolic link for the device driver. (Video devices only.)</td></tr> </table><p>?</p><p>To create a media source from an <strong><see cref="SharpDX.MediaFoundation.Activate"/></strong> reference, call the <strong><see cref="SharpDX.MediaFoundation.Activate.ActivateObject"/></strong> method.</p> /// </remarks> /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='MFEnumDeviceSources']/*"/> /// <msdn-id>dd388503</msdn-id> /// <unmanaged>HRESULT MFEnumDeviceSources([In] IMFAttributes* pAttributes,[Out, Buffer] IMFActivate*** pppSourceActivate,[Out] unsigned int* pcSourceActivate)</unmanaged> /// <unmanaged-short>MFEnumDeviceSources</unmanaged-short> public static Activate[] EnumDeviceSources(MediaAttributes attributesRef) { IntPtr devicePtr; int devicesCount; EnumDeviceSources(attributesRef, out devicePtr, out devicesCount); var result = new Activate[devicesCount]; unsafe { var address = (void**)devicePtr; for (var i = 0; i < devicesCount; i++) result[i] = new Activate(new IntPtr(address[i])); } return result; }
public async Task<IHttpActionResult> Activite(ActivateVM vm) { var userSecruity = _userSecurityService.Get(UserId.Value); if (!userSecruity.EnsoureState(Users.Contract.UserSecurityCommand.RequestActivateToken)) { return Conflict(); } if (!userSecruity.EnsoureState(Users.Contract.UserSecurityCommand.RequestActivateToken)) { return Conflict(); } Activate action = new Activate(userSecruity.UserId, DateTime.Now, userSecruity.UserId, vm.Token); ActionResponse actionResponse = await ActionBus.SendAsync<UserActionBase, Activate>(action); return Ok(ActionResponseVM.ToVM(actionResponse)); }
public MenuIcon(string image, string imageActive, Activate activate) { Image = image; ImageActive = imageActive; OnActivate = activate; }
/// <summary> /// <p><strong>Applies to: </strong>desktop apps only</p><p> </p><p>Creates an activation object for the sample grabber media sink.</p> /// </summary> /// <param name="iMFMediaTypeRef"><dd> <p> Pointer to the <strong><see cref="SharpDX.MediaFoundation.MediaType"/></strong> interface, defining the media type for the sample grabber's input stream. </p> </dd></param> /// <param name="iMFSampleGrabberSinkCallbackRef"><dd> <p> Pointer to the <strong><see cref="SharpDX.MediaFoundation.SampleGrabberSinkCallback"/></strong> interface of a callback object. The caller must implement this interface. </p> </dd></param> /// <param name="iActivateOut"><dd> <p> Receives a reference to the <strong><see cref="SharpDX.MediaFoundation.Activate"/></strong> interface. Use this interface to complete the creation of the sample grabber. The caller must release the interface. </p> </dd></param> /// <returns><p>If this function succeeds, it returns <strong><see cref="SharpDX.Result.Ok"/></strong>. Otherwise, it returns an <strong><see cref="SharpDX.Result"/></strong> error code.</p></returns> /// <remarks> /// <p>To create the sample grabber sink, call <strong><see cref="SharpDX.MediaFoundation.Activate.ActivateObject"/></strong> on the reference received in the <em>ppIActivate</em> parameter.</p><p>Before calling <strong>ActivateObject</strong>, you can configure the sample grabber by setting any of the following attributes on the <em>ppIActivate</em> reference:</p><ul> <li> <see cref="SharpDX.MediaFoundation.SampleGrabberSinkAttributeKeys.IgnoreClock"/> </li> <li> <strong><see cref="SharpDX.MediaFoundation.SampleGrabberSinkAttributeKeys.SampleTimeOffset"/></strong> </li> </ul> /// </remarks> /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='MFCreateSampleGrabberSinkActivate']/*"/> /// <msdn-id>ms702068</msdn-id> /// <unmanaged>HRESULT MFCreateSampleGrabberSinkActivate([In] IMFMediaType* pIMFMediaType,[In] IMFSampleGrabberSinkCallback* pIMFSampleGrabberSinkCallback,[Out] IMFActivate** ppIActivate)</unmanaged> /// <unmanaged-short>MFCreateSampleGrabberSinkActivate</unmanaged-short> public static void CreateSampleGrabberSinkActivate(MediaType mediaType, SampleGrabberSinkCallback callback, out Activate activate) { MediaFactory.CreateSampleGrabberSinkActivate(mediaType, SampleGrabberSinkCallbackShadow.ToIntPtr(callback), out activate); }