Tepsile (interface)
interface kullanımı ile ilgili// -----------------------------1.İŞLEM-----------------------------------
//C# Programından New Project->ClassLibrary seçin
//proje adını Tepsile.cs olarak değiştirin
//aşağıdaki kodu yapıştırın ve derleyin
//Tepsile.cs Arayüz(interface) kullanımı için bir örnektir.
//Bu kod derlendikten sonra Aşağıdaki işlemleri yapın
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
namespace Tepsile
{
public interface ITepsi
{
string NotifyIconText
{
get;
set;
}
bool NotifyIconVisible
{
get;
set;
}
string Notify_icon
{
get;
set;
}
ContextMenu menu
{
get;
set;
}
**** Tepsile();
}
public class Tepsi:ITepsi
{
private string _NotifyIconText;
private bool _NotifyIconVisible;
private string _Notify_icon;
private ContextMenu _menu;
private NotifyIcon notifyIcon;
public string NotifyIconText
{
get
{
return _NotifyIconText;
}
set
{
_NotifyIconText=value;
}
}
public bool NotifyIconVisible
{
get
{
return _NotifyIconVisible;
}
set
{
_NotifyIconVisible=value;
}
}
public string Notify_icon
{
get
{
return _Notify_icon;
}
set
{
_Notify_icon = value;
}
}
public ContextMenu menu
{
get
{
return _menu;
}
set
{
_menu = value;
}
}
public **** Tepsile()
{
notifyIcon = new NotifyIcon();
notifyIcon.Text = NotifyIconText;
notifyIcon.Visible = NotifyIconVisible;
notifyIcon.Icon = new Icon(Notify_icon);
notifyIcon.ContextMenu = menu;
}
}
}
//-------------------------------------------------------------------
//------------------------2.İŞLEM----------------------------------------------
//C# NewProject->WindowsApplicaiton seçin
//Reference->Tepsile.dll ekleyin(Reference sağ tıkla Add Reference den
//Karşınıza çıkan Pencereden Browse sekmesinden Tepsile.dll yi seçin)
//Proje ismine Test.cs yazın sonra aşağıdaki kodu yazın ve derleyin
//Form Açılacak program çalıştığında saatin yanında programın simgesi
//olacak sağ tıklarsanız "KAPAT" menüsünü göreceksiniz
//Oluşturduğunuz Windows Application için Debug Klasöründe\bin Klasörünün içinde
//Programın exe dosyasının yanına "icon1.ico" adlı bir simge dosyası eklemeyi
//unutmayın yoksa çalışmaz
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private **** Form1_Load(object sender, EventArgs e)
{
ContextMenu men = new ContextMenu();
men.MenuItems.Add(0, new MenuItem("KAPAT", new System.EventHandler(k)));
Tepsile.Tepsi tepsi = new Tepsile.Tepsi();
tepsi.Notify_icon = "groups.ico";
tepsi.NotifyIconText = "caner..";
tepsi.NotifyIconVisible = true;
tepsi.menu = men;
tepsi.Tepsile();
}
**** k(object o, System.EventArgs e)
{
Close();
}
}
}
C# Tepsile
interface kullanımı ile ilgili// -----------------------------1.İŞLEM-----------------------------------
//C# Programından New Project->ClassLibrary seçin
//proje adını Tepsile.cs olarak değiştirin
//aşağıdaki kodu yapıştırın ve derleyin
//Tepsile.cs Arayüz(interface) kullanımı için bir örnektir.
//Bu kod derlendikten sonra Aşağıdaki işlemleri yapın
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
namespace Tepsile
{
public interface ITepsi
{
string NotifyIconText
{
get;
set;
}
bool NotifyIconVisible
{
get;
set;
}
string Notify_icon
{
get;
set;
}
ContextMenu menu
{
get;
set;
}
**** Tepsile();
}
public class Tepsi:ITepsi
{
private string _NotifyIconText;
private bool _NotifyIconVisible;
private string _Notify_icon;
private ContextMenu _menu;
private NotifyIcon notifyIcon;
public string NotifyIconText
{
get
{
return _NotifyIconText;
}
set
{
_NotifyIconText=value;
}
}
public bool NotifyIconVisible
{
get
{
return _NotifyIconVisible;
}
set
{
_NotifyIconVisible=value;
}
}
public string Notify_icon
{
get
{
return _Notify_icon;
}
set
{
_Notify_icon = value;
}
}
public ContextMenu menu
{
get
{
return _menu;
}
set
{
_menu = value;
}
}
public **** Tepsile()
{
notifyIcon = new NotifyIcon();
notifyIcon.Text = NotifyIconText;
notifyIcon.Visible = NotifyIconVisible;
notifyIcon.Icon = new Icon(Notify_icon);
notifyIcon.ContextMenu = menu;
}
}
}
//-------------------------------------------------------------------
//------------------------2.İŞLEM----------------------------------------------
//C# NewProject->WindowsApplicaiton seçin
//Reference->Tepsile.dll ekleyin(Reference sağ tıkla Add Reference den
//Karşınıza çıkan Pencereden Browse sekmesinden Tepsile.dll yi seçin)
//Proje ismine Test.cs yazın sonra aşağıdaki kodu yazın ve derleyin
//Form Açılacak program çalıştığında saatin yanında programın simgesi
//olacak sağ tıklarsanız "KAPAT" menüsünü göreceksiniz
//Oluşturduğunuz Windows Application için Debug Klasöründe\bin Klasörünün içinde
//Programın exe dosyasının yanına "icon1.ico" adlı bir simge dosyası eklemeyi
//unutmayın yoksa çalışmaz
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private **** Form1_Load(object sender, EventArgs e)
{
ContextMenu men = new ContextMenu();
men.MenuItems.Add(0, new MenuItem("KAPAT", new System.EventHandler(k)));
Tepsile.Tepsi tepsi = new Tepsile.Tepsi();
tepsi.Notify_icon = "groups.ico";
tepsi.NotifyIconText = "caner..";
tepsi.NotifyIconVisible = true;
tepsi.menu = men;
tepsi.Tepsile();
}
**** k(object o, System.EventArgs e)
{
Close();
}
}
}
C# Tepsile