public void Venue_VenueServiceApi_UpsertStandardAttributeByTitle_IfNotSuccess_ThrowsApiException() { var attribute = new StandardAttribute { description = "desc", title = "title", intention = "" }; executorMock .Setup(x => x.ExecuteApiWithWrappedResponse <StandardAttribute>( It.IsAny <string>(), It.IsAny <RequestMethod>(), It.IsAny <object>(), null, null, true)) .Returns(() => new ApiResult <StandardAttribute>( attribute, TestHelper.GetFailedResponse(), It.IsAny <ApiContext>(), It.IsAny <Context>(), It.IsAny <Request>())); Assert.Catch <ApiException>(() => { var result = UpsertStandardAttributeByTitle(attribute); }); executorMock.Verify(mock => mock.ExecuteApiWithWrappedResponse <StandardAttribute>( It.IsAny <string>(), It.IsAny <RequestMethod>(), It.IsAny <object>(), null, null, true), Times.Once); }
public BufferObject SetAttributeData(StandardAttribute attribute, AttributeBuffer data, bool normalize) { var attrIndex = (uint)attribute; Bind(); if (data == null) { Context.DisableVertexAttribArray(attrIndex); Disposer.Dispose(ref _attributeBuffers[attrIndex]); return(null); } BufferObject buffer; if (_attributeBuffers[attrIndex] == null) { buffer = new BufferObject(BufferObjectTypes.Vertex); _attributeBuffers[attrIndex] = buffer; } else { buffer = _attributeBuffers[attrIndex]; } Context.EnableVertexAttribArray((uint)attribute); buffer.BufferData(data); Context.VertexAttribPointer(attrIndex, data.StructInLine, data.DataType, normalize, 0, 0); return(buffer); }
public void Venue_VenueServiceApi_UpsertStandardAttributeByTitle_IfSuccess_ReturnsUpdated() { var attribute = new StandardAttribute { description = "desc", title = "title", intention = "" }; executorMock .Setup(x => x.ExecuteApiWithWrappedResponse <StandardAttribute>( It.IsAny <string>(), It.IsAny <RequestMethod>(), It.IsAny <object>(), null, null, true)) .Returns(() => new ApiResult <StandardAttribute>( attribute, TestHelper.GetSuccessResponse(), It.IsAny <ApiContext>(), It.IsAny <Context>(), It.IsAny <Request>())); var result = UpsertStandardAttributeByTitle(attribute); executorMock.Verify(mock => mock.ExecuteApiWithWrappedResponse <StandardAttribute>( It.IsAny <string>(), It.IsAny <RequestMethod>(), It.IsAny <object>(), null, null, true), Times.Once); AssertExtension.SimplePropertyValuesAreEquals(attribute, result); }
int GetStandardOffset(StandardAttribute attribute) { IntPtr pOffset = new IntPtr(); vdkAttributeSet_GetOffsetOfStandardAttribute(ref set, attribute, pOffset); unsafe { return(*((int *)pOffset.ToPointer())); } }
/// <summary> /// Upsert a standard attribute by its title. /// </summary> /// <returns>The updated standard attribute.</returns> public StandardAttribute UpsertStandardAttributeByTitle(StandardAttribute attribute) { var result = Executor.ExecuteApiWithWrappedResponse <StandardAttribute>( "v1/admin/attributes", RequestMethod.Patch, attribute); return(result.DataOrException); }
public UInt32 ByteOffsetOf(StandardAttribute i) { IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(UInt32))); IntPtr selfPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(udAttributeSetInternal))); Marshal.StructureToPtr(this, selfPtr, false); udError code = udAttributeSet_GetOffsetOfStandardAttribute(selfPtr, i, intPtr); if (code != udError.udE_Success) { throw new UDException(code); } UInt32 offset = Marshal.PtrToStructure <UInt32>(intPtr); Marshal.FreeHGlobal(intPtr); Marshal.FreeHGlobal(selfPtr); return(offset); }
private static extern udError udAttribute_GetDescriptorOfStandardAttribute(StandardAttribute attribute, IntPtr /*udAttributeDescriptor * */ pDescriptor);
private static extern udError udAttributeSet_GetOffsetOfStandardAttribute(IntPtr /*udAttributeSet * */ pAttributeSet, StandardAttribute attribute, IntPtr pOffset);
private static extern udError vdkAttributeSet_GetOffsetOfStandardAttribute(ref udAttributeSet pAttributeSet, StandardAttribute attribute, IntPtr pOffset);
private void BindAttributeLocation(StandardAttribute standardAttributeLocation, string attributeName) { Context.BindAttributeLocation(Handle, (int)standardAttributeLocation, attributeName); }