H
hazz
Guest
Error 1 Inconsistent accessibility: parameter type 'Interface_Sample.IMemberProfile' is less accessible than method 'Interface_Sample.Form1.RetrieveMemberProfile(Interface_Sample.IMemberProfile)'
how do I correct this error for the line in red below given IMemberProfile and class MemberProfile below? g
Code Snippet
Continue reading...
how do I correct this error for the line in red below given IMemberProfile and class MemberProfile below? g
Code Snippet
namespace
Interface_Sample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static void RetrieveMemberProfile(IMemberProfile Profile)
{
Profile.FirstName =
"John";
Profile.LastName =
"Doe";
Profile.Email =
"jdoe@email.com";
Profile.MemberID =
new System.Guid
(
"{65C38236-CA96-4FF1-9142-00873B8BD333}");
}
public static void UpdateMemberProfile(IMemberProfile Profile)
{
string _FirstName;
string _LastName;
string _Email;
string _MemberID;
_FirstName = Profile.FirstName;
_LastName = Profile.LastName;
_Email = Profile.Email;
_MemberID = Profile.MemberID.ToString();
}
private void Form1_Load(object sender, EventArgs e)
{
BusinessRules.RetrieveMemberProfile(
this);
}
private void btnUpdate_Click(object sender, EventArgs e)
{
BusinessRules.UpdateMemberProfile(
this);
}
}
}
Code Snippet
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
namespace
Interface_Sample
{
interface IMemberProfile
{
FirstName { get; set; }
string LastName { get; set; }
string Email { get; set; }
System.
Guid MemberID { get; set; }
}
}
Code Snippet
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
namespace
Interface_Sample
{
class MemberProfile: IMemberProfile
{
public string FirstName
{
get { return txtFirstName.Text; }
set { txtFirstName.Text = value; }
}
public string LastName
{
get { return txtLastName.Text; }
set { txtLastName.Text = value; }
}
public string Email
{
get { return txtEmail.Text; }
set { txtEmail.Text = value; }
}
public System.Guid MemberID
{
get
{
if (m_uniqueID.CompareTo(null) == 0)
{
m_uniqueID = System.
Guid.NewGuid();
}
return m_uniqueID;
}
set
{
m_uniqueID =
value;
}
}
}
}
Continue reading...