-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expand file tree
/
Copy pathTypeUtils.h
More file actions
47 lines (40 loc) · 1.8 KB
/
TypeUtils.h
File metadata and controls
47 lines (40 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright © 2010-2016 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
#include "include/cef_v8.h"
using namespace System;
namespace CefSharp
{
private class TypeUtils
{
public:
/// <summary>
/// Converts a .NET object to an (unmanaged) Chromium V8 object.
/// </summary>
/// <param name="obj">The .NET object that should be converted.</param>
/// <param name="type">The type of the source object. If this parameter is a null reference, the type will be determined
/// automatically.</param>
/// <returns>A corresponding V8 value.</returns>
static CefRefPtr<CefV8Value> ConvertToCef(Object^ obj, Type^ type);
/// <summary>
/// Converts a Chromium V8 value to a (managed) .NET object.
/// </summary>
/// <param name="obj">The V8 value that should be converted.</param>
/// <returns>A corresponding .NET object.</returns>
static Object^ ConvertFromCef(CefRefPtr<CefV8Value> obj);
/// <summary>
/// Converts a Chromium V8 CefTime (Date) to a (managed) .NET DateTime.
/// </summary>
/// <param name="obj">The CefTime value that should be converted.</param>
/// <returns>A corresponding .NET DateTime.</returns>
static DateTime ConvertCefTimeToDateTime(CefTime time);
/// <summary>
/// Converts a a (managed) .NET DateTime to Chromium V8 CefTime (Date).
/// </summary>
/// <param name="obj">The DateTime value that should be converted.</param>
/// <returns>A corresponding CefTime (epoch).</returns>
static CefTime ConvertDateTimeToCefTime(DateTime dateTime);
};
}