internal static partial class Interop
{
- internal static partial class Libraries
- {
- public const string Base = "libcapi-base-common.so.0";
- }
-
internal static partial class CommonError
{
[DllImport(Libraries.Base, EntryPoint = "get_last_result")]
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class DotnetUtil
+ {
+ [DllImport(Libraries.Vconf, EntryPoint = "vconf_get_int")]
+ internal static extern int GetVconfInt(string key, out int value);
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+internal static partial class Interop
+{
+ internal static partial class Libraries
+ {
+ public const string Base = "libcapi-base-common.so.0";
+ public const string Vconf = "libvconf.so.0";
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Tizen.Common
+{
+ /// <summary>
+ /// The DotnetAPIs class provides the .NET api version.
+ /// </summary>
+ public static class DotnetUtil
+ {
+ /// <summary>
+ /// Gets the version of Tizen .NET API.
+ /// </summary>
+ /// <returns>The Tizen .NET API version</returns>
+ public static int TizenAPIVersion
+ {
+ get
+ {
+ int version = 0;
+ DotnetUtilError ret = (DotnetUtilError)Interop.DotnetUtil.GetVconfInt("db/dotnet/tizen_api_version", out version);
+ if (ret != DotnetUtilError.None)
+ {
+ Log.Warn(DotnetUtilErrorFactory.LogTag, "unable to get Tizen .NET API version.");
+ }
+ return version;
+ }
+ }
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an AS IS BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+using System;
+using Tizen.Internals.Errors;
+
+namespace Tizen.Common
+{
+ internal enum DotnetUtilError
+ {
+ None = ErrorCode.None,
+ }
+
+ internal static class DotnetUtilErrorFactory
+ {
+ internal const string LogTag = "Tizen.Common.DotnetUtil";
+
+ internal static void ThrowException(DotnetUtilError err)
+ {
+ DotnetUtilError error = err;
+ if (error != DotnetUtilError.None)
+ {
+ throw new ArgumentException("Vconf error");
+ }
+ }
+ }
+}
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Tizen.Log\Tizen.Log.csproj" />
+ </ItemGroup>
+
</Project>