سلام دوستان وقت بخیر.
من یه کد وی بی پیدا کردم برای نوتیفیکیشن اونو تبدیل کردم به سی شارپ حالا یه مشکلی دارم که کد خطاشو میزارم اینجا.
این کدهای کلاس:


public class ExtendedControl :Control
{


ExtendedControl()
{
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.SupportsTransparentBackColo r, true);
}


bool m_isTransparent = false;
[Description("Gets or sets the 'real' transparency of the control.")]
public bool IsTransparent
{
get { return m_isTransparent; }
set
{
m_isTransparent = value;
if ((value == true))
{
this.BackColor = Color.Transparent;
}
Invalidate();
}
}
protected override void OnPaintBackground(System.Windows.Forms.PaintEventA rgs e)
{
base.OnPaintBackground(e);


if ((IsTransparent))
{
if (!(Parent == null))
{
int myIndex = Parent.Controls.GetChildIndex(this);
for (int i = Parent.Controls.Count - 1; i >= myIndex + 1; i += -1)
{
Control ctrl = Parent.Controls[i];
if ((ctrl.Bounds.IntersectsWith(Bounds)))
{
if ((ctrl.Visible))
{
Bitmap bmp = new Bitmap(ctrl.Width, ctrl.Height);
ctrl.DrawToBitmap(bmp, ctrl.ClientRectangle);
e.Graphics.TranslateTransform(ctrl.Left - Left, ctrl.Top - Top);
e.Graphics.DrawImage(bmp, Point.Empty);
e.Graphics.TranslateTransform(Left - ctrl.Left, Top - ctrl.Top);
bmp.Dispose();
}
}
}
}
}
}
}



اینم کد کلاس نوتیفیکیشن منیجر:



class NotificationManager
{
Timer tmrAnimation;
Timer tmrDelay;
//Control where the message will be displayed.
ExtendedControl displaycontrol = new ExtendedControl();
//Some property variables.
Color GlowColor = Color.Blue;
float alphaval = 0;
float incr = 0.1f;
bool isVisible = false;
SizeF textSize;
string msg = "";
Control prnt;
private void Control_Paint(object sender, PaintEventArgs pe)
{
//This BITMAP object will hold the appearance of the notification dialog.
//Why paint in bitmap? because we will set its opacity and paint it on the control later with a specified alpha.
Bitmap img = new Bitmap(displaycontrol.Width, displaycontrol.Height);
Graphics e = Graphics.FromImage(img);


//Set smoothing.
e.SmoothingMode = SmoothingMode.AntiAlias;


//Prepare drawing tools.
Brush bru = new SolidBrush(Color.FromArgb(50, GlowColor));
Pen pn = new Pen(bru, 6);
GraphicsPath gp = new GraphicsPath();


//Make connecting edges rounded.
pn.LineJoin = LineJoin.Round;


//Draw borders
//Outmost, 50 alpha
gp.AddRectangle(new Rectangle(3, 3, displaycontrol.Width - 10, displaycontrol.Height - 10));
e.DrawPath(pn, gp);


//level 3, A bit solid
gp.Reset();
gp.AddRectangle(new Rectangle(5, 5, displaycontrol.Width - 14, displaycontrol.Height - 14));
e.DrawPath(pn, gp);


//level 2, a bit more solid
gp.Reset();
gp.AddRectangle(new Rectangle(7, 7, displaycontrol.Width - 18, displaycontrol.Height - 18));
e.DrawPath(pn, gp);


//level 1, more solidness
gp.Reset();
gp.AddRectangle(new Rectangle(9, 9, displaycontrol.Width - 22, displaycontrol.Height - 22));
e.DrawPath(pn, gp);


//Draw Content Rectangle.
gp.Reset();
bru = new SolidBrush(Color.FromArgb(7, 7, 7));
pn = new Pen(bru, 5);
pn.LineJoin = LineJoin.Round;
gp.AddRectangle(new Rectangle(8, 8, displaycontrol.Width - 20, displaycontrol.Height - 20));
e.DrawPath(pn, gp);
e.FillRectangle(bru, new Rectangle(9, 9, displaycontrol.Width - 21, displaycontrol.Height - 21));


//Set COLORMATRIX (RGBAw).
//Matrix [3,3] will be the Alpha. Alpha is in float, 0(transparent) - 1(opaque).
ColorMatrix cma = new ColorMatrix();
cma.Matrix33 = alphaval;
ImageAttributes imga = new ImageAttributes();
imga.SetColorMatrix(cma);


//Draw the notification message..
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Center;
sf.LineAlignment = StringAlignment.Center;
e.DrawString(msg, prnt.Font, new SolidBrush(Color.FromArgb(247, 247, 247)), new Rectangle(9, 9, displaycontrol.Width - 21, displaycontrol.Height - 21), sf);


//Now, draw the content on the control.
pe.Graphics.DrawImage(img, new Rectangle(0, 0, displaycontrol.Width, displaycontrol.Height), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel, imga);


//Free the memory.
cma = null;
sf.Dispose();
imga.Dispose();
e.Dispose();
img.Dispose();
bru.Dispose();
pn.Dispose();
gp.Dispose();


}


//Handles the window animation.
// ERROR: Handles clauses are not supported in C#‎
private void tmr_tick(object sender, EventArgs e)
{
if ((incr > 0))
{
if ((alphaval < 1))
{
if ((alphaval + incr <= 1))
{
alphaval += incr;
displaycontrol.Refresh();
}
else
{
alphaval = 1;
displaycontrol.Refresh();
tmrAnimation.Enabled = false;
tmrDelay.Enabled = true;
}
}
}
else
{
if ((alphaval > 0))
{
if ((alphaval + incr >= 0))
{
alphaval += incr;
displaycontrol.Refresh();
}
else
{
alphaval = 0;
tmrAnimation.Enabled = false;
tmrAnimation.Dispose();
tmrDelay.Dispose();
displaycontrol.Dispose();
incr = 0.1f;
isVisible = false;
}
}
}
}


//handles the delay.
// ERROR: Handles clauses are not supported in C#‎
private void tmrDelay_tick(object sender, EventArgs e)
{
incr = -0.1f;
tmrAnimation.Enabled = true;
tmrDelay.Enabled = false;
}
public void Show(ref Control Parent, string Message, Color glw, int delay)
{
if (!(isVisible))
{
isVisible = true;
prnt = Parent;
msg = Message;
//Set up notification window.
displaycontrol = new ExtendedControl();
displaycontrol.IsTransparent = true;


//Measure message
textSize = displaycontrol.CreateGraphics().MeasureString(Mess age, Parent.Font);
displaycontrol.Height = (int)25 + (int)textSize.Height;
displaycontrol.Width = (int)35 + (int)textSize.Width;
if ((textSize.Width > Parent.Width - 100))
{
displaycontrol.Width = Parent.Width - 100;
int hf = (int)textSize.Width / (Parent.Width - 100);
displaycontrol.Height += (int)(textSize.Height * hf);
}


//Position control in parent
displaycontrol.Left = (Parent.Width - displaycontrol.Width) / 2;
displaycontrol.Top = (Parent.Height - displaycontrol.Height) - 50;
Parent.Controls.Add(displaycontrol);
displaycontrol.BringToFront();
GlowColor = glw;


//Set up animation
tmrAnimation = new Timer();
tmrAnimation.Interval = 15;
tmrAnimation.Enabled = true;


tmrDelay = new Timer();
tmrDelay.Interval = delay;
}
else
{
tmrDelay.Stop();
tmrDelay.Start();
}
}


}





که روی خط ExtendedControl displaycontrol = new ExtendedControl(); این خطا رو میده



Error 1 'WindowsFormsApplication2.ExtendedControl.Extended Control()' is inaccessible due to its protection level D:\WindowsFormsApplication2\WindowsFormsApplicatio n2\NotificationManager.cs 16 42 WindowsFormsApplication2






ممنون میشم راهنماییم کنید بدجور لنگ اینم.