Karthik Agarwal

Karthik Agarwal

  • NA
  • 748
  • 266.5k

Can anyone explain what does this code mean?

Oct 27 2011 5:12 AM
       [Description ("Foreground color"), Category ("Text Configuration")]
       property Color DrawColor
       {
          Color get()
          {
             return draw_color;
          }
          void set( Color val )
          {
             draw_color = val;
          }
       }

and also the below code and what's the difference between the above and below code?

    [Description ("Alignment to be used for this text"), Category ("Text Configuration")]
       [TypeConverter(AlignModeList::typeid)]
       property String ^ Alignment
       {
          String ^ get()
          {
             return alignment;
          }

          void set( String ^ val )
          {
             alignment = val;
          }
       }

public ref class AlignModeList : System::ComponentModel::StringConverter
   {
     public:
       static array<String ^> ^ alignmode = gcnew array<String ^>(3){"Left", "Centre", "Right"};
       virtual System::ComponentModel::TypeConverter::StandardValuesCollection ^ GetStandardValues(System::ComponentModel::ITypeDescriptorContext ^ context) override
       {
           return gcnew StandardValuesCollection(alignmode);
       }
       virtual bool GetStandardValuesSupported(System::ComponentModel::ITypeDescriptorContext ^ context) override
       {
          return true;
       }
       virtual bool GetStandardValuesExclusive(System::ComponentModel::ITypeDescriptorContext ^ context) override
       {
          return true;
       }
   };

Answers (17)