Then I moved one step ahead and provided the refrence to cutesoft.chat.dll
the code looked like this:
***************************************************
using
System;
using
System.Data;
using
System.Web;
using
CuteSoft.Chat;
using
System.Data.SqlClient;
namespace
CuteChatControls
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class MyDataProvider : CuteSoft.Chat.DataProvider
{
public override string GetUserDisplayName(string uniquename)
{
return useruniquename;
}
public override string[] ListUserUniqueName()
{
AdminDB admin =
new AdminDB();
SqlDataReader reader = admin.GetUsers();
ArrayList result =
new ArrayList();
while(reader.Read())
{
result.Add(reader.GetString(0));
}
return (String[]) result.ToArray(typeof(String));
}
public override bool IsAdministrator(string useruniquename)
{
String[] roles;
UsersDB user =
new UsersDB();
roles = user.GetRoles(useruniquename);
foreach (String role in roles)
{
if (role.ToLower()=="admins")
{
return true;
}
}
return false;
}
public override string[] SearchUserUniqueNameByDisplayName(string name)
{
if(userDisplaName==null||userDisplaName=="")return new string[0];
userDisplaName = userDisplaName.ToLower();
AdminDB admin =
new AdminDB();
SqlDataReader reader = admin.GetUsers();
ArrayList names =
new ArrayList();
while(reader.Read())
{
try
{
string val= reader.GetString(1);
if(val.ToLower().IndexOf(userDisplaName)!=-1)
names.Add(val);
}
catch{}
}
return (string[])names.ToArray(typeof(string));
}
}
public
class MyUserAdapter : CuteSoft.Chat.UserAdapter
{
public override string GetUserUniqueName(System.Web.HttpContext context)
{
IIdentity iden=context.User.Identity;
if(iden==null||!iden.IsAuthenticated)
returnnull;
if(iden.Name==null||iden.Name.Length==0)
return null;
return iden.Name;
}
}
public class IbuySpyConnectionStringProvider: CuteSoft.Chat.ConnectionStringProvider
{
protected override string GetConnectionString(CuteSoft.Chat.UserIdentity user)
{
return System.Configuration.ConfigurationSettings.AppSettings["connectionString"];
}
}
}
**************************************
I got these errors
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(16): The name 'useruniquename' does not exist in the class or namespace 'CuteChatControls.MyDataProvider'
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(20): The type or namespace name 'AdminDB' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(21): The type or namespace name 'admin' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(22): The type or namespace name 'ArrayList' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(26): The type or namespace name 'result' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(28): The type or namespace name 'result' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(34): The type or namespace name 'UsersDB' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(35): The type or namespace name 'user' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(49): The name 'userDisplaName' does not exist in the class or namespace 'CuteChatControls.MyDataProvider'
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(50): The name 'userDisplaName' does not exist in the class or namespace 'CuteChatControls.MyDataProvider'
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(52): The type or namespace name 'AdminDB' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(53): The type or namespace name 'admin' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(55): The type or namespace name 'ArrayList' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(61): The name 'userDisplaName' does not exist in the class or namespace 'CuteChatControls.MyDataProvider'
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(62): The type or namespace name 'names' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(66): The type or namespace name 'names' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(74): The type or namespace name 'IIdentity' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(75): The name 'iden' does not exist in the class or namespace 'CuteChatControls.MyUserAdapter'
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(76): Only assignment, call, increment, decrement, and new object expressions can be used as a statement
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(76): The name 'returnnull' does not exist in the class or namespace 'CuteChatControls.MyUserAdapter'
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(76): The type or namespace name 'iden' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\Palwinder\My Documents\Visual Studio Projects\CuteChatControls\CuteChatControls.cs(79): The type or namespace name 'iden' could not be found (are you missing a using directive or an assembly reference?)
Can you please provide some elaborated details here as you have provided in your examples or tell me which specific example should I follow as I am trying to integrate it into my existing system?