الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

أريد شرح لهذا الكود البسيط في FileSystemWatcher

مغلق
بدأه Mr.Abdulilah في 4 مارس 2006 · 4 رد · 601 مشاهدة · في Microsoft Visual C#.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

بسم الله الرحمن الرحيم

***************************************************************************

أما بعد : -

يوجد لدي كود لم أفهمه والمشكلة أني أستخدمة بدون أن أفقهه :s : -

private System.IO.FileSystemWatcher fileSystemWatcher1; 


private void InitializeComponent()
  {
 	 this.fileSystemWatcher1 = new System.IO.FileSystemWatcher(); 
((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).BeginInit();  \\ هذا لم أفهمة جيدا

this.fileSystemWatcher1.EnableRaisingEvents = true;
 	 this.fileSystemWatcher1.IncludeSubdirectories = true;
 	 this.fileSystemWatcher1.Path = "C:\\2";
 	 this.fileSystemWatcher1.SynchronizingObject = this;
 	 this.fileSystemWatcher1.Created += new System.IO.FileSystemEventHandler(this.fileSystemWatcher1_Created); 

((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).EndInit(); \\ هذا لم أفهمة جيدا



} 


private void fileSystemWatcher1_Created(object sender, System.IO.FileSystemEventArgs e)
  {
 	 MessageBox.Show(e.ChangeType.ToString()+" & "+e.FullPath.ToString()+" & "+e.Name.ToString());

}

*************************************************************************************************************

وأريد منكم شرح هذا الكود شرح تفصيلي

#3
ISupportInitialize.BeginInit Method :
Signals the object that initialization is starting.

ISupportInitialize.EndInit Method  : 
Signals the object that initialization is complete.
#4
baha_ashour كتب:
ISupportInitialize.BeginInit Method :
Signals the object that initialization is starting.

ISupportInitialize.EndInit Method  : 
Signals the object that initialization is complete.

MSDN مرجع ممتاز في مثل هذه الحالات, يجب اخي الممتاز ان تفكر في الحصول عليها والبحث بها ايضا لان هذه الاجزاء من البرمجيات اكيد مشروحة ضمنها.

Do as I say, not as I do

We are Anonymous. We are Legion. We don't forgive. We don't forget

#5

شكرا لكم وشكرا على مجهودكم الرائع

هذا الموضوع مغلق.

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…