Sha256: a3b5199e76fbbb61bd4c0ccc51d2ec31f7ecbdc946edfe4d7200bb3afa2345f5

Contents?: true

Size: 553 Bytes

Versions: 35

Compression:

Stored size: 553 Bytes

Contents

#pragma once
ref class ArrayHelper
{
public:
  static array<int>^ ToArray(const int items[], const int length)
  {
    auto managedItems = gcnew array<int>(length);
    for(auto index = 0; index < length; ++index) {
      managedItems[index] = items[index];
    }
    return managedItems;
  }

  static int* FromArray(array<int>^ items)
  {
    auto unmanagedArray = new int[items->Length];

    auto index = 0;
    for each(auto item in items) {
      unmanagedArray[index++] = item;
    }

    return unmanagedArray;
  }
};

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
uia-1.0 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.8 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.7 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.7.alpha.1 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.6 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.5 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.4.4 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.4.3 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.4.2 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.4.1 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.4 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.3.3 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.3.2 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.3.1 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.3 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.2.1 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.2 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.1.3.1 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.1.3 ext/UiaDll/UiaDll/ArrayHelper.h
uia-0.1.2.3 ext/UiaDll/UiaDll/ArrayHelper.h