Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 831209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:09:54+00:00 2026-05-15T04:09:54+00:00

I have extended the standard FileSystemWatcher class by adding a string property (fileToTest), now

  • 0

I have extended the standard FileSystemWatcher class by adding a string property (fileToTest), now i need to extend also the FileSystemEventArgs to add this property how can i do this ?

my extend FileSystemWatcher :

    class AleFileSystemWatcher : FileSystemWatcher
{
    public string fileToTest { get; set; } 
}

The FileSystemEventArgs fileToTest property should be the same of AleFileSystemWatcher fileToTest .

Can i do this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:09:55+00:00Added an answer on May 15, 2026 at 4:09 am

    Personally, I wouldn’t extend the FileSystemWatcher, but have it as an instance variable in a class. You don’t really extend the functionality of the FileSystemWatcher in its main respect, but make use of its functionality (ie. listen for changed/created/whatever files and match those with the file you are looking for)

    public class SpecificFileWatcher
    {
      public string FileToTest { get; set; }
    
      private readonly FileSystemWatcher iWatcher;
    
    
      public class SpecificFileWatcher(FileSystemWatcher watcher)
      {
        iWatcher = watcher;
        iWatcher.Changed += iWatcher_Changed; //whatever event you need here
      }
    
      //eventhandler for watcher
      public ...
      {
        if(e.FileName == FileToTest)
          Console.WriteLine("file found");
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main class and two extended classes: class Main { public $foo;
I have a class named CropImageView which is extended from ImageView . but the
I have a class extended from CCSprite that implements CCTargetedTouchDeledate like so: @interface PianoKey
I have extended PHP's mysqli class, which works fine. But how can I make
I have a very basic program which displays a standard Textview and a extended
I have extended the standard symfony sfWebResponse and I would like to modify the
I have standard WPF Window that I have extended the Aero Glass on the
I have a standard javascript object whose prototype is extended with a .start() method
I have extended SimpleCursorAdapter and am running into a weird issue with bindView, which
I have extended my entities to implement specific interfaces for its type. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.