Make your own free website on Tripod.com
EPolWS
EPolESForm
Home
Account
ep_test.txt
SerializableBase
DbConnectionBase
EPolESForm
DbSTable
EmailFactory.cs
epmain
EPolES
DbVariableView.cs
ProfileView
EPolLOcal Main
Page Main Example
EPolWS EPolWS.asmx
EPolWS EPolWS.cs
CommandManager
CommandFactory
CommandFactoryBase
OrganisationView
EPolConsole Main
DbEPBase.cs
DbRecordArray
DbTable

Enter subhead content here

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Collections; using System.Diagnostics; using System.IO; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters; using System.Runtime.Serialization.Formatters.Binary; using EPol; /*using DotNetOpenMail; using DotNetOpenMail.SmtpAuth; using LumiSoft.Net; using LumiSoft.Net.Log; using LumiSoft.Net.POP3.Client; using LumiSoft.Net.Mime; */ using EXDb97; //###7 namespace EPol { public partial class EPolESForm : Form { public EPolESForm() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void runToolStripMenuItem_Click(object sender, EventArgs e) { } /* * Instantiate a new object, then call the List method. The List method will return an array of Pop3Message objects. You can then iterate through the Pop3Message objects and retrieve each in turn. Finally, you call the Disconnect method to release the socket. POP3 is described in RFC 1939. You can read the full specification from the IETF website RFC 1939. */ private void pOP3ReadToolStripMenuItem_Click(object sender, EventArgs e) { /* try { Pop3 obj = new Pop3(); // obj.Connect("pop.secureserver.net", "lobo@initiativemarket.com", "saturne"); // obj.Connect("pop.secureserver.net", "lobo@initiativemarket.com", "saturne"); obj.Connect("pop.mail.yahoo.com", "revolutionfiscale", "saturne"); ArrayList list = obj.List(); foreach (Pop3Message msg in list) { Pop3Message msg2 = obj.Retrieve(msg); System.Console.WriteLine ("Message {0}: {1}", msg2.number, msg2.message); } obj.Disconnect(); } catch (Pop3Exception e1) { System.Console.WriteLine(e.ToString()); } catch (System.Exception e1) { System.Console.WriteLine(e.ToString()); } */ } private void sMTPTestToolStripMenuItem_Click(object sender, EventArgs e) { /* EmailMessage emailMessage = new EmailMessage(); emailMessage.FromAddress = new EmailAddress("revolutionfiscale@yahoo.fr", "revolutionfiscale"); emailMessage.AddToAddress(new EmailAddress("revolutionfiscale@yahoo.fr", "revolutionfiscale")); emailMessage.Subject = "Test OpenMail"; emailMessage.TextPart = new TextAttachment("New message " + "2.\r\nSMTP!\r\n\r\n-LBY"); SmtpServer smtpYahooServer = new SmtpServer("smtp.mail.yahoo.com"); smtpYahooServer.SmtpAuthToken = new SmtpAuthToken("revolutionfiscale", "saturne"); // SmtpServer smtSecureServer = new SmtpServer("smtpout.secureserver.net"); // smtSecureServer.SmtpAuthToken = new SmtpAuthToken("lobo@initiativemarket.com", "saturne"); emailMessage.Send(smtpYahooServer); */ } // private POP3_Client m_pPop3 = null; private void pOP3LumisoftToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { oEmailManager.dRecievedEmail(); } /* POP3_Client pop3 = new POP3_Client(); try { pop3.Logger = new Logger(); pop3.Logger.WriteLog += m_pLogCallback; //pop3.Connect("pop.secureserver.net", 110, false); pop3.Connect("pop.mail.yahoo.com", 110, false); pop3.Authenticate("revolutionfiscale", "saturne", true); FillMessagesList(pop3); pop3.Disconnect(); } catch (Exception x) { Debug.WriteLine("POP3 server returned: " + x.Message); pop3.Dispose(); }*/ } /* private void FillMessagesList(POP3_Client pPop3) { Debug.WriteLine("pPop3.Messages count = " + pPop3.Messages.Count ); foreach (POP3_ClientMessage message in pPop3.Messages) { Mime mime = Mime.Parse(message.HeaderToByte()); if (mime.MainEntity.From != null) { Debug.WriteLine("\nSequenceNumber= " + message.SequenceNumber); Debug.WriteLine("AddressList = " + mime.MainEntity.From.ToAddressListString()); } else { Debug.WriteLine("AddressList = " + ""); } if (string.IsNullOrEmpty(mime.MainEntity.Subject)) { Debug.WriteLine(""); } else { Debug.WriteLine("Subject = " + mime.MainEntity.Subject); } Debug.WriteLine("Date = " + mime.MainEntity.Date.ToString()); Debug.WriteLine("Message Size = " + ((decimal)(message.Size / (decimal)1000)).ToString("f2") + " kb"); // Debug.WriteLine("Message = " + Convert.ToString(message.MessageToByte()) ); Debug.WriteLine("IsMArkForDElition= " + message.IsMarkedForDeletion); // Debug.WriteLine("HeaderToString= " + message.HeaderToString() ); Mime mimeParseMessage = Mime.Parse(message.MessageToByte()); foreach (MimeEntity entity in mimeParseMessage.Attachments) { if (entity.ContentDisposition_FileName != null) { Debug.Write("Attachement File Name = " + entity.ContentDisposition_FileName); } } Debug.WriteLine("mimeParseMessage.BodyText = " + mimeParseMessage.BodyText); Debug.WriteLine("IsMArkForDElition= " + message.IsMarkedForDeletion); } }*/ private void removeMEssageLumisoftToolStripMenuItem_Click(object sender, EventArgs e) { /* POP3_Client pop3 = new POP3_Client(); try { pop3.Logger = new Logger(); pop3.Logger.WriteLog += m_pLogCallback; //pop3.Connect("pop.secureserver.net", 110, false); pop3.Connect(CEmailManager.POP_SERVER, 110, false); pop3.Authenticate(CEmailManager.USER_ID, "saturne", true); Debug.WriteLine("pPop3.Messages count = " + pop3.Messages.Count); foreach (POP3_ClientMessage message in pop3.Messages) { Debug.WriteLine("seq = " + message.SequenceNumber); message.MarkForDeletion(); } pop3.Disconnect(); } catch (Exception x) { Debug.WriteLine("POP3 server returned: " + x.Message); pop3.Dispose(); } */ } private void registrationFromEmailToolStripMenuItem_Click(object sender, EventArgs e) { CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create avatar achille -language:eng"); Debug.WriteLine(oRecievedEmail.csDump()); } private void avatarTestToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "root@yahoo.fr", DateTime.Now); // oRecievedEmail.dAddText("create avatar gustave -language:eng"); // oRecievedEmail.dAddText("create avatar bertrand;create avatar bernard"); /* oRecievedEmail.dAddText("create avatar achille -language:eng"); oRecievedEmail.dAddText("create avatar avatar1_of_achille -parent:achille"); oRecievedEmail.dAddText("create avatar avatar1_of_1 -parent:avatar1_of_achille"); oRecievedEmail.dAddText("create avatar avatar2_of_1 -parent:avatar1_of_achille"); oRecievedEmail.dAddText("create avatar avatar3_of_1_1 -parent:avatar1_of_1 -language:fr"); oRecievedEmail.dAddText("create avatar avatar4_of_1_1 -parent:avatar1_of_1 -language:fr"); */ oRecievedEmail.dAddText("create avatar achille -language:eng"); //oRecievedEmail.dAddText("list avatar -language"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CStatusEmail oStatusEmail; CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void createAvatarToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { oEmailManager.vCleanAllData(); CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "root@yahoo.fr", DateTime.Now); // oRecievedEmail.dAddText("remove avatar avatar4_of_1_1;r avatar avatar1_of_1;r avatar avatar2_of_1;r avatar avatar1_of_achille"); // oRecievedEmail.dAddText("r avatar achille"); oRecievedEmail.dAddText("create avatar achille -language:french"); oRecievedEmail.dAddText("create avatar avatar1_of_achille -parent:achille -language:eng"); oRecievedEmail.dAddText("create avatar avatar1_of_1 -parent:avatar1_of_achille"); oRecievedEmail.dAddText("create avatar avatar2_of_1 -parent:avatar1_of_achille"); oRecievedEmail.dAddText("create avatar avatar3_of_1_1 -parent:avatar1_of_1 -language:french"); oRecievedEmail.dAddText("create avatar avatar4_of_1_1 -parent:avatar1_of_1 -language:fr"); oRecievedEmail.dAddText("list avatar -language -recursive"); Debug.WriteLine(oRecievedEmail.csDump()); CStatusEmail oStatusEmail; CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void updateAvatarToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "root@yahoo.fr", DateTime.Now); //oRecievedEmail.vAddRecipient("sent@yahoo.fr"); oRecievedEmail.dAddText("update avatar avatar3_of_1_1 -language:eng -name:new3_of_1_1"); oRecievedEmail.dAddText("list avatar -language -parent:achille"); Debug.WriteLine(oRecievedEmail.csDump()); CStatusEmail oStatusEmail; CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void removeAvatarToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "root@yahoo.fr", DateTime.Now); // oRecievedEmail.vAddRecipient("sent@yahoo.fr"); oRecievedEmail.dAddText("list avatar -language"); // oRecievedEmail.dAddText("remove avatar new3_of_1_1"); oRecievedEmail.dAddText("remove avatar avatar4_of_1_1"); oRecievedEmail.dAddText("remove avatar achille"); oRecievedEmail.dAddText("list avatar"); Debug.WriteLine(oRecievedEmail.csDump()); CStatusEmail oStatusEmail; CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void deleteAvatarToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "recieved@yahoo.fr", DateTime.Now); // oRecievedEmail.vAddRecipient("sent@yahoo.fr"); oRecievedEmail.dAddText("list avatar -language"); // oRecievedEmail.dAddText("remove avatar new3_of_1_1"); oRecievedEmail.dAddText("remove avatar avatar4_of_1_1"); oRecievedEmail.dAddText("remove avatar achille"); oRecievedEmail.dAddText("list avatar"); Debug.WriteLine(oRecievedEmail.csDump()); CStatusEmail oStatusEmail; CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void stopToolStripMenuItem_Click(object sender, EventArgs e) { } private void sMTPCreateAvatarToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "revolutionfiscale@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create avatar achille -language:eng"); oRecievedEmail.dAddText("create avatar avatar1_of_achille -parent:achille"); oRecievedEmail.dAddText("create avatar avatar1_of_1 -parent:avatar1_of_achille"); oRecievedEmail.dAddText("create avatar avatar2_of_1 -parent:avatar1_of_achille"); oRecievedEmail.dAddText("create avatar avatar3_of_1_1 -parent:avatar1_of_1 -language:fr"); oRecievedEmail.dAddText("create avatar avatar4_of_1_1 -parent:avatar1_of_1 -language:fr"); oRecievedEmail.dAddText("list avatar -language"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CStatusEmail oStatusEmail; CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); dStatus = oEmailManager.dSendEmail(oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void createOrganisationToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { oEmailManager.vCleanAllData(); CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create organisation organisation3 -language:eng"); oRecievedEmail.dAddText("create organisation organisation1Of3 -parent:organisation3"); oRecievedEmail.dAddText("create organisation organisation2Of3 -parent:organisation3"); oRecievedEmail.dAddText("list organisation -parent:organisation3 -recursive -language"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CStatusEmail oStatusEmail; CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); dStatus = oEmailManager.dSendEmail(oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void listOrganisationToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("list organisation -parent:organisation3 -recursive -language"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CStatusEmail oStatusEmail; CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); dStatus = oEmailManager.dSendEmail(oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void listAvatarToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("list avatar -language"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CStatusEmail oStatusEmail; CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); dStatus = oEmailManager.dSendEmail(oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void addMemberToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { oEmailManager.vCleanAllData(); CStatusEmail oStatusEmail; CReceivedEmail oRecievedEmail = new CReceivedEmail("member5@yahoo.fr", "member5", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar member5_avatar"); CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member1@yahoo.fr", "member1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar member1_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("administrator@yahoo.fr", "administrator", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar administrator_achille"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member3@yahoo.fr", "member3", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar member3_avatar"); oRecievedEmail.dAddText("c friend member1_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member2@yahoo.fr", "member2", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar member2_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); Debug.WriteLine("Administrator list organisation"); oRecievedEmail = new CReceivedEmail("administrator@yahoo.fr", "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create organisation organisation3 -language:eng -avatar:administrator_achille"); oRecievedEmail.dAddText("add member member5_avatar"); oRecievedEmail.dAddText("add member member1_avatar"); oRecievedEmail.dAddText("list member organisation3"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member1@yahoo.fr", "member1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("grant access organisation3"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); Debug.WriteLine("\n----------------------------------------------------------------------------\nAdministrator list organisation and friend"); oRecievedEmail = new CReceivedEmail("administrator@yahoo.fr", "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("list member organisation3"); //oRecievedEmail.dAddText("list friend"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member1@yahoo.fr", "member1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c id myslogan='member1 is in organisation3' -organisation:organisation3 -type:string -avatar:member1_avatar"); oRecievedEmail.dAddText("c id myslogan='member1 has a personal slogan' -type:string -avatar:member1_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member5@yahoo.fr", "member5", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("d myslogan -member:member1_avatar -organisation:organisation3"); oRecievedEmail.dAddText("d myslogan -member:member1_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member1@yahoo.fr", "member1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("f myslogan -avatar:member1_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member5@yahoo.fr", "member5", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("d myslogan -member:member1_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member1@yahoo.fr", "member1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("authorize myslogan -avatar:member1_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member5@yahoo.fr", "member5", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("d myslogan -member:member1_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member1@yahoo.fr", "member1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("list access"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void addFriendToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { oEmailManager.vCleanAllData(); CStatusEmail oStatusEmail; CReceivedEmail oRecievedEmail = new CReceivedEmail("friend0@yahoo.fr", "friend0", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar friend0_avatar"); CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("friend5@yahoo.fr", "friend5", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar friend5_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("friend1@yahoo.fr", "friend1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar friend1_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("administrator1@yahoo.fr", "administrator1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar administrator1_achille; c avatar administrator1_achille2 -parent:administrator1_achille"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("administrator1@yahoo.fr", "administrator1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText(" c avatar administrator1_achille3 -parent:administrator1_achille;add friend friend0_avatar"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("administrator1@yahoo.fr", "administrator1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("add friend friend1_avatar -avatar:administrator1_achille2"); oRecievedEmail.dAddText("list friend"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("friend5@yahoo.fr", "friend5", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar friend5_avatar2;add friend administrator1_achille2;list friend"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); Debug.WriteLine("\n\n\nAdministrator list organisation and friend"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("administrator1@yahoo.fr", "administrator1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c id myroot=\"private_data_of administartor\" -type:string -avatar:administrator1_achille2"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("friend5@yahoo.fr", "friend5", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("d myroot -member:administrator1_achille2"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void myAttributeToolStripMenuItem_Click(object sender, EventArgs e) { CDbConnectionManagement.CreateDatabase( EPolES.CUR_DATABASE); CProfileView oProfileTable = new CProfileView(CDbEPBase.P.ENGLISH, EPolES.CUR_DATABASE); oProfileTable.vCleanAllData(); Debug.WriteLine("oProfileTable = " + oProfileTable.ToString()); CCommandFactoryBase.SIndex oParentProfile = oProfileTable.dAddProfileFromEmail(EPolES.INPUT_EMAIL, CDbEPBase.P.ENGLISH); Trace.WriteLine("dAddProfile = " + oParentProfile.csDump()); CCommandFactoryBase.SIndex oAvatar1; oProfileTable.dAddAvatar("Avatar1", oParentProfile, CDbEPBase.P.ENGLISH, out oAvatar1); Trace.WriteLine("bAddAvatar= " + oAvatar1.csDump()); CDbEPBase.SIndex oMemeVersion; CDbEPBase.ec dRet = oProfileTable.dAddAttribute(oAvatar1, CCommandFactoryBase.NOT_USED_SINDEX, CDbEPBase.P.ATTRIBUTE_CLASS, CDbEPBase.P.IDENTIFIER, "MyAttribute", CDbEPBase.P.STRING_255_TYPE, "Attribute of avatar1", null, out oMemeVersion); Trace.WriteLine("oProfileTable.dAddEnglishAttribute = " + dRet); CMeme[] oMemeArray; int dCount; CEntityArray oAttributeArray = new CEntityArray(); oAttributeArray.MetaClass = CDbEPBase.P.ATTRIBUTE_CLASS; oAttributeArray.Class = CDbEPBase.P.IDENTIFIER; oAttributeArray.vAdd( oProfileTable.oGetEntity(CDbEPBase.P.IDENTIFIER, "MyAttribute")); dRet = oProfileTable.dGetAttribute(oAvatar1, oAvatar1, CCommandFactoryBase.NOT_USED_SINDEX, oAttributeArray, out oMemeArray, out dCount); Trace.WriteLine("myAttribute = " + ((oMemeArray.Length > 0) ? oMemeArray[0].ToString() : "None") ); dRet = oProfileTable.dUpdateMeme(oAvatar1, CCommandFactoryBase.NOT_USED_SINDEX, oAttributeArray, "Attribute of avatar2", out oMemeVersion); dRet = oProfileTable.dGetAttribute(oAvatar1, oAvatar1, CCommandFactoryBase.NOT_USED_SINDEX, oAttributeArray, out oMemeArray, out dCount); Trace.WriteLine("oProfileTable.dGetAttributemyAttribute = " + ((oMemeArray.Length > 0) ? oMemeArray[0].ToString() : "None")); } private void createAttributeToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { oEmailManager.vCleanAllData(); CStatusEmail oStatusEmail; CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create avatar achille -language:eng"); oRecievedEmail.dAddText("create avatar avatar1_of_achille -parent:achille"); oRecievedEmail.dAddText("list avatar -language"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); dStatus = oEmailManager.dSendEmail(oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create id myday=13 -type:integer"); oRecievedEmail.dAddText("create id myday=14 -type:integer"); // oRecievedEmail.dAddText("update myday 15"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void updateAttributeToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { CStatusEmail oStatusEmail; CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("update myday 16"); CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void getAttributeToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { oEmailManager.vCleanAllData(); CStatusEmail oStatusEmail; CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create avatar achille -language:eng"); oRecievedEmail.dAddText("create avatar avatar1_of_achille -parent:achille"); oRecievedEmail.dAddText("create avatar avatar1_of_1 -parent:avatar1_of_achille"); oRecievedEmail.dAddText("list avatar -language"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); dStatus = oEmailManager.dSendEmail(oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create id testtitle='This is the book about democracy' -type:string -avatar:avatar1_of_1 -attribute:theme=democracy"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("display testtitle"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void createAttributeSentenceToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { oEmailManager.vCleanAllData(); CStatusEmail oStatusEmail; CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create avatar achille -language:eng"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); dStatus = oEmailManager.dSendEmail(oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create id myadress:'I am here' -type:string"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("display myadress"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void createTextToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { oEmailManager.vCleanAllData(); CStatusEmail oStatusEmail; CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create avatar achille -language:eng"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); dStatus = oEmailManager.dSendEmail(oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create id mydemocracy:'That is my democracy' -type:text -theme:democracy"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create id mydemocracy2:'That is my democracy2' -type:text -theme:democracy"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create id mymeritocracy:'That is my meritocracy' -type:text -theme:meritocracy"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("display id theme=democracy"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void linkToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { oEmailManager.vCleanAllData(); CStatusEmail oStatusEmail; CReceivedEmail oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "lobo", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create avatar achille -language:eng"); Debug.WriteLine("oRecievedEmail.csDump() = " + oRecievedEmail.csDump()); CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); dStatus = oEmailManager.dSendEmail(oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create id mydemocracy:'That is my democracy' -type:text -theme:democracy"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("create link session=june,mymessage -to:theme=democracy,mydemocracy "); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail(EPolES.INPUT_EMAIL, "root", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("display mymessage"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } private void persistenceToolStripMenuItem_Click(object sender, EventArgs e) { Random oRandom = new Random(1); ArrayList oArrayList = new ArrayList(); for (int i = 0; i < 1000; i++) { oArrayList.Add(i); } MemoryStream msArrayList = new MemoryStream(); IFormatter formatter = new BinaryFormatter(); // serialize shapes formatter.Serialize(msArrayList, oArrayList); msArrayList.Seek(0, 0); Debug.WriteLine("\nmsArrayList = " + msArrayList.Length); IFormatter formatter2 = new BinaryFormatter(); ArrayList oArrayListNew = (ArrayList)formatter2.Deserialize(msArrayList); Debug.WriteLine("Array List Count\n" + oArrayListNew.Count); int[] oArrayInteger = new int[1000]; for (int i = 0; i < 1000; i++) { oArrayInteger[i] =i; } IFormatter formatterInt = new BinaryFormatter(); IFormatter formatterInt2 = new BinaryFormatter(); MemoryStream msArrayInt = new MemoryStream(); formatterInt.Serialize(msArrayInt, oArrayInteger); msArrayInt.Seek(0, 0); Debug.WriteLine("\nmsArray Integer= " + msArrayInt.Length); int[] oArrayInteger2 = (int[])formatterInt2.Deserialize(msArrayInt); Debug.WriteLine("Array Integer Count\n" + oArrayInteger2.Length); string[] oArrayStr = new string[1000]; for (int i = 0; i < 1000; i++) { oArrayStr[i] = "@@@@@@@" + i.ToString(); } MemoryStream msArrayStr = new MemoryStream(); formatterInt.Serialize(msArrayStr, oArrayStr); msArrayStr.Seek(0, 0); Debug.WriteLine("\nmsArray Str Length = " + msArrayStr.Length); string[] oArrayStr2 = (string[])formatterInt2.Deserialize(msArrayStr); Debug.WriteLine("Array Str size\n" + oArrayStr2.Length); Debug.WriteLine("Array Str[10]=" + oArrayStr2[10]); } public enum ENTest { Item1, Item2 } private void testEnumToolStripMenuItem_Click(object sender, EventArgs e) { ENTest enEn = ENTest.Item1; Debug.WriteLine("ENTest = " + enEn.ToString()); Debug.WriteLine("ENTest int = " + (int)enEn); Debug.WriteLine("ENTest int = " + (int)ENTest.Item2); ENTest enEn1 = (ENTest)9999; Debug.WriteLine("ENTest bad = " + enEn1); Debug.WriteLine("ENTest bad str = " + enEn1.ToString()); } private void principleToolStripMenuItem_Click(object sender, EventArgs e) { CEmailManager oEmailManager = new CEmailManager(); if (oEmailManager.bInitDatabase( EPolES.CUR_DATABASE)) { oEmailManager.vCleanAllData(); CStatusEmail oStatusEmail; CReceivedEmail oRecievedEmail = new CReceivedEmail("member2@yahoo.fr", "member2", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar member2_avatar"); CDbEPBase.ec dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member1@yahoo.fr", "member1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c avatar member1_avatar;create organisation party -language:eng -avatar:member1_avatar"); oRecievedEmail.dAddText("add member member2_avatar;list member party"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member1@yahoo.fr", "member1", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("c principle Rule1 -comment:'this is the first principle'"); oRecievedEmail.dAddText("c principle Rule2 -comment:'this is the second principle'"); oRecievedEmail.dAddText("c principle Rule3 -comment:'this is the third principle'"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member2@yahoo.fr", "member2", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("grant access party"); oRecievedEmail.dAddText("c principle Rule4 -comment:'this is the fourth principle'"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member2@yahoo.fr", "member2", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("support principle Rule3;oppose principle Rule2"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); oRecievedEmail = new CReceivedEmail("member2@yahoo.fr", "member2", "root@yahoo.fr", DateTime.Now); oRecievedEmail.dAddText("count principle -organisation:party -trace"); dStatus = oEmailManager.dExecute(oRecievedEmail, out oStatusEmail); Debug.WriteLine("oStatusEmail dStatus = " + dStatus + " " + oStatusEmail.csDump()); } } } }

Enter supporting content here