#include "Stdafx.h"
#pragma once

#include "LKFException.h"

namespace lkfxdok {
	namespace c {
		LKFException::LKFException(int errorCode, String ^errorText) : System::Exception(errorText)
		{
		}

		LKFMemoryException::LKFMemoryException(String^ errorText, String^ key) : LKFException(-99999999, errorText + ": " + key)
		{

		}

		LKFMemoryException::LKFMemoryException(String^ errorText) : LKFException(-99999999, errorText)
		{

		}

		String^ LKFMemoryException::GetOutOfMemoryText(LKFContext^ context) {
			String^ oomT = context->GetOutOfMemoryText();
			if (oomT != nullptr) return oomT;
			return "Out Of Memory";
		}

		LKFMemoryException::LKFMemoryException(LKFContext^ context) : LKFException(-99999999, GetOutOfMemoryText(context))
		{

		}
	}
}


