The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

dinattar (1) [Avatar] Offline
#1
I have this peculiar problem. In the source code below, all non-indexed properties work whereas with the indexed property, I do not get drop down list as expected. I get nothing for this property. I have tried all avenues to fix this problem. I need the EXPERTS' help. PLEASE...

#pragma once

using namespace System;
using namespace System::ComponentModel;
#using <mscorlib.dll>


ref class CManagedClass1
{
public:

array<int>^ MyArr; //** THIS ONE DOES NOT WORK **//
// default indexer
[Category("MyArrFIX")]
property int default[int] {
int get(int index) {
return MyArr[index];
}
void set(int index, int value) {
MyArr[index] = value;
}
}

bool bCanStretch;
[Category("Appearance")]
property Boolean CanStretch
{
Boolean get() { return bCanStretch; }
void set(Boolean value)
{
bCanStretch = value;
}
}

enum class suit{clubs,diamonds,spade,hearts};
[Category("MyPropertysuit")]
property suit MyPropertysuit
{
void set( suit value )
{
}
suit MyPropertysuit::get()
{
// Getter code here:
return(suit::clubs);
}
}
CManagedClass1(void);
};
using namespace System;

#include "StdAfx.h"
#include "ManagedClass1.h"

CManagedClass1::CManagedClass1(void)
{
MyArr = gcnew array<int>(3);
}