summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-11-23 19:09:09 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2016-11-23 19:09:09 +0900
commit4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (patch)
tree98110734c91668dfdbb126fcc0e15ddbd93738ca /src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs
parentfa45f57ed55137c75ac870356a1b8f76c84b229c (diff)
downloadcoreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.gz
coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.bz2
coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.zip
Imported Upstream version 1.1.0upstream/1.1.0
Diffstat (limited to 'src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs')
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs113
1 files changed, 113 insertions, 0 deletions
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs
new file mode 100644
index 0000000000..a77ff005b9
--- /dev/null
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs
@@ -0,0 +1,113 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+//
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.Contracts;
+
+// Windows.Foundation.Collections.IVector`1 and IVectorView`1 cannot be referenced from managed
+// code because they're hidden by the metadata adapter. We redeclare the interfaces manually
+// to be able to talk to native WinRT objects.
+namespace System.Runtime.InteropServices.WindowsRuntime
+{
+ [ComImport]
+ [Guid("913337e9-11a1-4345-a3a2-4e7f956e222d")]
+ [WindowsRuntimeImport]
+ internal interface IVector<T> : IIterable<T>
+ {
+ [Pure]
+ T GetAt(uint index);
+ [Pure]
+ uint Size { get; }
+ [Pure]
+ IReadOnlyList<T> GetView(); // Really an IVectorView<T>.
+ [Pure]
+ bool IndexOf(T value, out uint index);
+ void SetAt(uint index, T value);
+ void InsertAt(uint index, T value);
+ void RemoveAt(uint index);
+ void Append(T value);
+ void RemoveAtEnd();
+ void Clear();
+ [Pure]
+ uint GetMany(uint startIndex, [Out] T[] items);
+ void ReplaceAll(T[] items);
+ }
+
+ // Same as IVector - the only difference is that GetView returns IVectorView<T>
+ [ComImport]
+ [Guid("913337e9-11a1-4345-a3a2-4e7f956e222d")]
+ [WindowsRuntimeImport]
+ internal interface IVector_Raw<T> : IIterable<T>
+ {
+ [Pure]
+ T GetAt(uint index);
+ [Pure]
+ uint Size { get; }
+ [Pure]
+ IVectorView<T> GetView();
+ [Pure]
+ bool IndexOf(T value, out uint index);
+ void SetAt(uint index, T value);
+ void InsertAt(uint index, T value);
+ void RemoveAt(uint index);
+ void Append(T value);
+ void RemoveAtEnd();
+ void Clear();
+ [Pure]
+ uint GetMany(uint startIndex, [Out] T[] items);
+ void ReplaceAll(T[] items);
+ }
+
+ [ComImport]
+ [Guid("bbe1fa4c-b0e3-4583-baef-1f1b2e483e56")]
+ [WindowsRuntimeImport]
+ internal interface IVectorView<T> : IIterable<T>
+ {
+ [Pure]
+ T GetAt(uint index);
+ [Pure]
+ uint Size { get; }
+ [Pure]
+ bool IndexOf(T value, out uint index);
+ [Pure]
+ uint GetMany(uint startIndex, [Out] T[] items);
+ }
+
+ [ComImport]
+ [Guid("393de7de-6fd0-4c0d-bb71-47244a113e93")]
+ [WindowsRuntimeImport]
+ internal interface IBindableVector : IBindableIterable
+ {
+ [Pure]
+ object GetAt(uint index);
+ [Pure]
+ uint Size { get; }
+ [Pure]
+ IBindableVectorView GetView();
+ [Pure]
+ bool IndexOf(object value, out uint index);
+ void SetAt(uint index, object value);
+ void InsertAt(uint index, object value);
+ void RemoveAt(uint index);
+ void Append(object value);
+ void RemoveAtEnd();
+ void Clear();
+ }
+
+ [ComImport]
+ [Guid("346dd6e7-976e-4bc3-815d-ece243bc0f33")]
+ [WindowsRuntimeImport]
+ internal interface IBindableVectorView : IBindableIterable
+ {
+ [Pure]
+ object GetAt(uint index);
+ [Pure]
+ uint Size { get; }
+ [Pure]
+ bool IndexOf(object value, out uint index);
+ }
+}