Delegates, Events and Event Handler's

  • Thread starter Thread starter Festus Hagen
  • Start date Start date
F

Festus Hagen

Hi All,

Win7, VS2017RC Community.

As a learning exercise I ported Managing a Music Collection Using Visual Basic Express and SQL Server Express to Visual C++ Managed.

However, I've bumped my head on the limits of my skills with the Delegates, Events and their Handlers searching has been little help.
So here I am seeking wisdom from the wise ones!

Questions are in C++ comments of VBcode in LoadMp3s.*, Files.* and SqlMusicManager.cpp
Summary:

In SqlMusicManager.cpp
SqlMusicManager::btnSearch_Click(...)
//AddHandler loader.FileLoaded, AddressOf Me.OnFileLoaded
//RemoveHandler loader.FileLoaded, AddressOf Me.OnFileLoaded

In LoadMp3s.cpp:
LoadMp3s::F_FileFound(...)
// RaiseEvent FileLoaded(Me, New FileFoundEventArgs(e.FoundFile))

In LoadMp3s.h
// Friend Event FileLoaded As FileFoundDelegate
// Private WithEvents F As FindFiles = Nothing

In Files.cpp
FindFiles::EnumFiles(...)
//RaiseEvent FileFound(Me, New FileFoundEventArgs(i))

In Files.h
// Friend Delegate Sub FileFoundDelegate(ByVal sender As Object, ByVal e As FileFoundEventArgs)
// Friend Event FileFound As FileFoundDelegate


Full source:

Files.h

#pragma once

ref class FileFoundEventArgs : public System::EventArgs
{
public:
FileFoundEventArgs(System::IO::FileInfo^ FoundFile)
{
this->m_FoundFile = FoundFile;
}

property System::IO::FileInfo^ FoundFile
{
System::IO::FileInfo^ get()
{
return this->m_FoundFile;
}
}

private:
System::IO::FileInfo^ m_FoundFile;
};

// Friend Delegate Sub FileFoundDelegate(ByVal sender As Object, ByVal e As FileFoundEventArgs)
delegate System::Void FileFoundDelegate(System::Object^ sender, FileFoundEventArgs^ e);

ref class FindFiles {
public:
FindFiles();
System::Void EnumDirectory(System::IO::DirectoryInfo ^ Dir);
System::Void EnumFiles(System::IO::DirectoryInfo^ Dir);
System::Void Start(System::String ^ Path);
// Friend Event FileFound As FileFoundDelegate
event FileFoundDelegate^ FileFound;

property System::String^ SearchExt
{
System::String^ get()
{
return m_SearchExt;
}
System::Void set(System::String^ value)
{
m_SearchExt = value;
}
}

private:
System::String^ m_SearchExt = "*.mp3";
};



Files.cpp

#include "Files.h"

FindFiles::FindFiles()
{
}

System::Void FindFiles::Start(System::String^ Path)
{
if(System::IO::Directory::Exists(Path)) {
System::IO::DirectoryInfo^ i = gcnew System::IO::DirectoryInfo(Path);
this->EnumDirectory(i);
}
}

System::Void FindFiles::EnumDirectory(System::IO::DirectoryInfo^ Dir)
{
EnumFiles(Dir);
cli::array<System::IO::DirectoryInfo^>^ ds = Dir->GetDirectories();
for each(System::IO::DirectoryInfo^ i in ds)
{
EnumDirectory(i);
}
}

System::Void FindFiles::EnumFiles(System::IO::DirectoryInfo^ Dir)
{
cli::array<System::IO::FileInfo^>^ filesFound = Dir->GetFiles(this->m_SearchExt);
for each(System::IO::FileInfo^ i in filesFound)
{
//RaiseEvent FileFound(Me, New FileFoundEventArgs(i))
}
}


ID3v1Reader.h

#pragma once

ref class ID3v1Reader {
public:
ID3v1Reader();
ID3v1Reader(System::String^ FileName);
System::Void Parse();
private:
System::Void Reset();

public:
property System::String^ Artist
{
System::String^ get() {
return m_Artist;
}
System::Void set(System::String^ value) {
m_Artist = value;
}
}

property System::String^ Comment
{
System::String^ get() {
return m_Comment;
}
System::Void set(System::String^ value) {
m_Comment = value;
}
}

property System::Byte^ Genre
{
System::Byte^ get() {
return m_Genre;
}
System::Void set(System::Byte^ value) {
m_Genre = value;
}
}

property System::String^ FileName
{
System::String^ get() {
return m_FileName;
}
System::Void set(System::String^ value) {
m_FileName = value;
}
}

property System::String^ Recording
{
System::String^ get() {
return m_Recording;
}
System::Void set(System::String^ value) {
m_Recording = value;
}
}

property System::Byte^ TrackSequence
{
System::Byte^ get() {
return m_TrackSequence;
}
System::Void set(System::Byte^ value) {
m_TrackSequence = value;
}
}

property System::String^ TrackTitle
{
System::String^ get() {
return m_TrackTitle;
}
System::Void set(System::String^ value) {
m_TrackTitle = value;
}
}

property System::String^ Year
{
System::String^ get() {
return m_Year;
}
System::Void set(System::String^ value) {
m_Year = value;
}
}

private:
System::String^ m_Artist; // TPE1 Artist
System::String^ m_Recording; // TALB Album
System::String^ m_TrackTitle; // TIT2 Title
System::Byte^ m_TrackSequence; // TRCK Track
System::String^ m_Comment; // COMM Comment
System::Byte^ m_Genre; // TCON Genre
System::String^ m_Year; // TDRC Year
System::String^ m_FileName; // Filename
};


ID3v1Reader.cpp

#include "ID3v1Reader.h"

ID3v1Reader::ID3v1Reader()
{
}

ID3v1Reader::ID3v1Reader(System::String ^ FileName)
{
this->FileName = FileName;
}


System::Void ID3v1Reader::Parse()
{
if(!System::String::IsNullOrEmpty(this->FileName)) {
try
{
// Simple data for testing
m_Artist = "Artist";
m_Recording = "Album";
m_TrackTitle = "Title";
m_TrackSequence = (System::Byte)0;
m_Comment = "Comment";
m_Genre = (System::Byte)0;
m_Year = "Year";
} catch(...) {
System::Windows::Forms::MessageBox::Show("File load", "ERROR", System::Windows::Forms::MessageBoxButtons::OK, System::Windows::Forms::MessageBoxIcon::Exclamation);
}
}
}

System::Void ID3v1Reader::Reset()
{
m_Artist->System::String::Remove(0);
m_Recording->System::String::Remove(0);
m_TrackTitle->System::String::Remove(0);
m_TrackSequence = (System::Byte)0;
m_Comment->System::String::Remove(0);
m_Genre = (System::Byte)0;
m_Year->System::String::Remove(0);
}


LoadMp3s.h

#pragma once
#include "ID3v1Reader.h"
#include "Files.h"

ref class LoadMp3s {
public:
LoadMp3s();
LoadMp3s(System::String^ ConnectionString);
System::Int32^ Load(System::String^ Path);

System::Void F_FileFound(System::Object ^ sender, FileFoundEventArgs ^ e);

System::Data::SqlClient::SqlCommand ^ GetInsertCommand();

property System::String^ Filter
{
System::String^ get()
{
return m_Filter;
}
System::Void set(System::String^ value)
{
m_Filter = value;
}
}

private:
// Friend Event FileLoaded As FileFoundDelegate
// Private WithEvents F As FindFiles = Nothing
ID3v1Reader^ mp3Info;
FindFiles^ F;
System::Int32 m_FilesFound;
System::String^ mstrConnectionString;
System::Data::SqlClient::SqlConnection^ mcon;
System::Data::SqlClient::SqlCommand^ mcmd;
System::String^ m_Filter;
};


LoadMp3s.cpp

#include "LoadMp3s.h"
#include "ID3v1Reader.h"
#include "Files.h"

LoadMp3s::LoadMp3s() {
}

LoadMp3s::LoadMp3s(System::String ^ ConnectionString)
{
this->mstrConnectionString = ConnectionString;
mp3Info = gcnew ID3v1Reader;
}

System::Int32^ LoadMp3s::Load(System::String^ Path)
{
this->m_FilesFound = 0;
mcon = gcnew System::Data::SqlClient::SqlConnection(this->mstrConnectionString);
F = gcnew FindFiles;
F->SearchExt = "*.mp3";
F->Start(Path);
return this->m_FilesFound;
}

System::Void LoadMp3s::F_FileFound(System::Object^ sender, FileFoundEventArgs^ e)
{
this->m_FilesFound++;
if(mcon->State == System::Data::ConnectionState::Closed)
mcon->Open();
if(mcmd == nullptr)
mcmd = this->GetInsertCommand();
mp3Info->FileName = e->FoundFile->FullName;
mp3Info->Parse();
mcmd->Parameters->AddWithValue("@ArtistName", mp3Info->Artist);
mcmd->Parameters->AddWithValue("@ArtistName", mp3Info->Artist);
mcmd->Parameters->AddWithValue("@RecordingTitle", mp3Info->Recording);
mcmd->Parameters->AddWithValue("@TrackTitle", mp3Info->TrackTitle);
mcmd->Parameters->AddWithValue("@TrackSequence", mp3Info->TrackSequence);
mcmd->Parameters->AddWithValue("@TrackYear", mp3Info->Year);
mcmd->Parameters->AddWithValue("@TrackGenre", mp3Info->Genre);
mcmd->Parameters->AddWithValue("@TrackFileName", mp3Info->FileName);
mcmd->ExecuteNonQuery();
// RaiseEvent FileLoaded(Me, New FileFoundEventArgs(e.FoundFile))
}

System::Data::SqlClient::SqlCommand^ LoadMp3s::GetInsertCommand()
{
System::Data::SqlClient::SqlCommand^ cmd = gcnew System::Data::SqlClient::SqlCommand("AddMP3", mcon);
cmd->CommandType = System::Data::CommandType::StoredProcedure;

System::Data::SqlClient::SqlParameter^ prm = gcnew System::Data::SqlClient::SqlParameter("@ArtistName", System::Data::SqlDbType::VarChar, 30);
prm->Direction = System::Data::ParameterDirection::Input;
cmd->Parameters->Add(prm);

prm = gcnew System::Data::SqlClient::SqlParameter("@RecordingTitle", System::Data::SqlDbType::VarChar, 30);
prm->Direction = System::Data::ParameterDirection::Input;
cmd->Parameters->Add(prm);

prm = gcnew System::Data::SqlClient::SqlParameter("@TrackTitle", System::Data::SqlDbType::VarChar, 30);
prm->Direction = System::Data::ParameterDirection::Input;
cmd->Parameters->Add(prm);

prm = gcnew System::Data::SqlClient::SqlParameter("@TrackSequence", System::Data::SqlDbType::TinyInt);
prm->Direction = System::Data::ParameterDirection::Input;
cmd->Parameters->Add(prm);

prm = gcnew System::Data::SqlClient::SqlParameter("@TrackYear", System::Data::SqlDbType::NVarChar, 15);
prm->Direction = System::Data::ParameterDirection::Input;
cmd->Parameters->Add(prm);

prm = gcnew System::Data::SqlClient::SqlParameter("@TrackGenre", System::Data::SqlDbType::NVarChar, 30);
prm->Direction = System::Data::ParameterDirection::Input;
cmd->Parameters->Add(prm);

prm = gcnew System::Data::SqlClient::SqlParameter("@TrackFileName", System::Data::SqlDbType::NVarChar, 260);
prm->Direction = System::Data::ParameterDirection::Input;
cmd->Parameters->Add(prm);

return cmd;
}


SqlMusicManager.h

#pragma once

namespace MusicManager {

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

/// <summary>
/// Summary for SqlMusicManager
/// </summary>
public ref class SqlMusicManager : public System::Windows::Forms::Form
{
public:
SqlMusicManager(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}

protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~SqlMusicManager()
{
if (components)
{
delete components;
}
}
private:
System::Void btnClose_Click(System::Object ^ sender, System::EventArgs ^ e);
System::Void btnSearch_Click(System::Object ^ sender, System::EventArgs ^ e);
System::Void btnDirectoryPicker_Click(System::Object ^ sender, System::EventArgs ^ e);
System::Void btnDatabaseSelector_Click(System::Object ^ sender, System::EventArgs ^ e);
System::Void OnFileLoaded(System::Object ^ sender, FileFoundEventArgs ^ e);
System::Windows::Forms::Button^ btnClose;
System::Windows::Forms::Button^ btnSearch;
System::Windows::Forms::FolderBrowserDialog^ fbdDirectoryPicker;
System::Windows::Forms::Label^ label1;
System::Windows::Forms::Label^ label2;
System::Windows::Forms::TextBox^ tbxFilter;
System::Windows::Forms::TextBox^ tbxDirectory;
System::Windows::Forms::Button^ btnDirectoryPicker;
System::Windows::Forms::StatusStrip^ statusStrip1;
System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel1;
System::Windows::Forms::Button^ btnDatabaseSelector;
System::Windows::Forms::TextBox^ tbxDatabase;
System::Windows::Forms::Label^ label3;
System::Windows::Forms::OpenFileDialog^ ofdDatabase;
System::Boolean^ blnNeedRefresh = false;
System::String^ m_ConnectionString = "Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=C:\\Users\\you\\Documents\\AudioDB.mdf;Integrated Security=True;Connect Timeout=30";

private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->btnClose = (gcnew System::Windows::Forms::Button());
this->btnSearch = (gcnew System::Windows::Forms::Button());
this->fbdDirectoryPicker = (gcnew System::Windows::Forms::FolderBrowserDialog());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->tbxFilter = (gcnew System::Windows::Forms::TextBox());
this->tbxDirectory = (gcnew System::Windows::Forms::TextBox());
this->btnDirectoryPicker = (gcnew System::Windows::Forms::Button());
this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
this->toolStripStatusLabel1 = (gcnew System::Windows::Forms::ToolStripStatusLabel());
this->btnDatabaseSelector = (gcnew System::Windows::Forms::Button());
this->tbxDatabase = (gcnew System::Windows::Forms::TextBox());
this->label3 = (gcnew System::Windows::Forms::Label());
this->ofdDatabase = (gcnew System::Windows::Forms::OpenFileDialog());
this->statusStrip1->SuspendLayout();
this->SuspendLayout();
//
// btnClose
//
this->btnClose->Location = System::Drawing::Point(386, 177);
this->btnClose->Name = L"btnClose";
this->btnClose->Size = System::Drawing::Size(75, 23);
this->btnClose->TabIndex = 5;
this->btnClose->Text = L"Close";
this->btnClose->UseVisualStyleBackColor = true;
this->btnClose->Click += gcnew System::EventHandler(this, &SqlMusicManager::btnClose_Click);
//
// btnSearch
//
this->btnSearch->Location = System::Drawing::Point(305, 177);
this->btnSearch->Name = L"btnSearch";
this->btnSearch->Size = System::Drawing::Size(75, 23);
this->btnSearch->TabIndex = 4;
this->btnSearch->Text = L"Search";
this->btnSearch->UseVisualStyleBackColor = true;
this->btnSearch->Click += gcnew System::EventHandler(this, &SqlMusicManager::btnSearch_Click);
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(25, 16);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(29, 13);
this->label1->TabIndex = 2;
this->label1->Text = L"Filter";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(3, 43);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(49, 13);
this->label2->TabIndex = 3;
this->label2->Text = L"Directory";
//
// tbxFilter
//
this->tbxFilter->Location = System::Drawing::Point(60, 13);
this->tbxFilter->Name = L"tbxFilter";
this->tbxFilter->Size = System::Drawing::Size(100, 20);
this->tbxFilter->TabIndex = 1;
this->tbxFilter->Text = L"*.mp3";
//
// tbxDirectory
//
this->tbxDirectory->Location = System::Drawing::Point(59, 40);
this->tbxDirectory->Name = L"tbxDirectory";
this->tbxDirectory->Size = System::Drawing::Size(367, 20);
this->tbxDirectory->TabIndex = 2;
this->tbxDirectory->Text = L"M:\\Music";
//
// btnDirectoryPicker
//
this->btnDirectoryPicker->Location = System::Drawing::Point(432, 40);
this->btnDirectoryPicker->Name = L"btnDirectoryPicker";
this->btnDirectoryPicker->Size = System::Drawing::Size(29, 20);
this->btnDirectoryPicker->TabIndex = 3;
this->btnDirectoryPicker->Text = L"...";
this->btnDirectoryPicker->TextAlign = System::Drawing::ContentAlignment::TopLeft;
this->btnDirectoryPicker->UseVisualStyleBackColor = true;
this->btnDirectoryPicker->Click += gcnew System::EventHandler(this, &SqlMusicManager::btnDirectoryPicker_Click);
//
// statusStrip1
//
this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) { this->toolStripStatusLabel1 });
this->statusStrip1->Location = System::Drawing::Point(0, 203);
this->statusStrip1->Name = L"statusStrip1";
this->statusStrip1->Size = System::Drawing::Size(471, 22);
this->statusStrip1->TabIndex = 6;
this->statusStrip1->Text = L"statusStrip1";
//
// toolStripStatusLabel1
//
this->toolStripStatusLabel1->Name = L"toolStripStatusLabel1";
this->toolStripStatusLabel1->Size = System::Drawing::Size(456, 17);
this->toolStripStatusLabel1->Spring = true;
this->toolStripStatusLabel1->Text = L"Status Strip - Label - Not Currently Used";
this->toolStripStatusLabel1->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;
//
// btnDatabaseSelector
//
this->btnDatabaseSelector->Location = System::Drawing::Point(433, 66);
this->btnDatabaseSelector->Name = L"btnDatabaseSelector";
this->btnDatabaseSelector->Size = System::Drawing::Size(29, 20);
this->btnDatabaseSelector->TabIndex = 8;
this->btnDatabaseSelector->Text = L"...";
this->btnDatabaseSelector->TextAlign = System::Drawing::ContentAlignment::TopLeft;
this->btnDatabaseSelector->UseVisualStyleBackColor = true;
this->btnDatabaseSelector->Click += gcnew System::EventHandler(this, &SqlMusicManager::btnDatabaseSelector_Click);
//
// tbxDatabase
//
this->tbxDatabase->Location = System::Drawing::Point(60, 66);
this->tbxDatabase->Name = L"tbxDatabase";
this->tbxDatabase->Size = System::Drawing::Size(367, 20);
this->tbxDatabase->TabIndex = 7;
this->tbxDatabase->Text = L"C:\\Users\\you\\Documents\\AudioDB.mdf";
//
// label3
//
this->label3->AutoSize = true;
this->label3->Location = System::Drawing::Point(4, 69);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(53, 13);
this->label3->TabIndex = 9;
this->label3->Text = L"Database";
//
// ofdDatabase
//
this->ofdDatabase->DefaultExt = L"mdf";
this->ofdDatabase->Filter = L"Database (*.mdf)|*.mdf";
this->ofdDatabase->InitialDirectory = L"C:\\Users\\you\\Documents";
//
// SqlMusicManager
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(471, 225);
this->Controls->Add(this->btnDatabaseSelector);
this->Controls->Add(this->tbxDatabase);
this->Controls->Add(this->label3);
this->Controls->Add(this->statusStrip1);
this->Controls->Add(this->btnDirectoryPicker);
this->Controls->Add(this->tbxDirectory);
this->Controls->Add(this->tbxFilter);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->btnSearch);
this->Controls->Add(this->btnClose);
this->Location = System::Drawing::Point(1, 1);
this->MaximizeBox = false;
this->Name = L"MsSQLMusicManager";
this->StartPosition = System::Windows::Forms::FormStart
this->Text = L"MS SQL Music Manager converted from VB";
this->statusStrip1->ResumeLayout(false);
this->statusStrip1->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();

}
#pragma endregion
};
}


SqlMusicManager.cpp

#include <Windows.h>
#include <vcclr.h>

#include "SqlMusicManager.h"
#include "LoadMp3s.h"

using namespace MusicManager;

using namespace System;
using namespace System::Windows::Forms;

[STAThread]
void Main(array<String^>^ args) {

Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);

SqlMusicManager form;
Application::Run(%form);

}

System::Void SqlMusicManager::btnClose_Click(System::Object^ sender, System::EventArgs^ e)
{
this->Close();
}

System::Void SqlMusicManager::btnSearch_Click(System::Object^ sender, System::EventArgs^ e)
{
System::String^ strDirectoryRoot = this->tbxDirectory->Text;
System::String^ strFilter = this->tbxFilter->Text;

if (System::String::IsNullOrEmpty(strDirectoryRoot))
return;

if (System::String::IsNullOrEmpty(strFilter))
return;

LoadMp3s^ loader = gcnew LoadMp3s;
//AddHandler loader.FileLoaded, AddressOf Me.OnFileLoaded
blnNeedRefresh = true;
System::Int32^ intFilesFound = loader->Load(strDirectoryRoot);
System::Windows::Forms::MessageBox::Show(intFilesFound + " were loaded into the database", this->Text, System::Windows::Forms::MessageBoxButtons::OK, System::Windows::Forms::MessageBoxIcon::Information);
//RemoveHandler loader.FileLoaded, AddressOf Me.OnFileLoaded
//Me.rpnlStatus.BodyText = "Ready" // If you know what this type is please enlighten, else ignore.
}

System::Void SqlMusicManager::btnDirectoryPicker_Click(System::Object^ sender, System::EventArgs^ e)
{
if (this->fbdDirectoryPicker->ShowDialog() == System::Windows::Forms::DialogResult::OK) {
this->tbxDirectory->Text = this->fbdDirectoryPicker->SelectedPath;
}
}

System::Void SqlMusicManager::btnDatabaseSelector_Click(System::Object^ sender, System::EventArgs^ e)
{
if (this->ofdDatabase->ShowDialog() == System::Windows::Forms::DialogResult::OK) {
this->tbxDatabase->Text = this->ofdDatabase->FileName;
}
}

System::Void SqlMusicManager::OnFileLoaded(System::Object^ sender, FileFoundEventArgs^ e)
{
if(this->blnNeedRefresh) {
this->Refresh();
this->blnNeedRefresh = false;
}
// Don't know what object type the following is, if you know please enlighten else ignore.
//' Me.rpnlStatus.BodyText = e.FoundFile.FullName & " added!"
//' Me.rpnlStatus.Refresh()
}


SqlMusicManager.resx

<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

Version 2.0

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>

There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="fbdDirectoryPicker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>159, 17</value>
</metadata>
<metadata name="ofdDatabase.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>269, 17</value>
</metadata>
</root>


Thank you
-Enjoy
fh : )_~

EDIT: in files.h, Added qualifier to derive class FileFoundEventArgs from public System::EventArg

Continue reading...
 
Back
Top