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 3945720
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:02:55+00:00 2026-05-20T01:02:55+00:00

Is it possible to design a method in such a fashion, that it knows

  • 0

Is it possible to design a method in such a fashion, that it knows it must automatically call a next method in succession upon exiting?

In the following example, I must call Refresh() to cause my form to repaint after this event takes place. The problem is that, it’s ugly to call Refresh() after, for example, 20 different events which must make the form refresh. e.g

private void PriorityLine_Click(object sender, EventArgs e)
{
   _showPriorityLine = (_showPriorityLine) ? false : true;
  Refresh(); // Must call refresh for changes to take effect.
}

I suppose what I’m looking for is some kind of signature I can apply to the method to cause it to automatically chain to the next method, regardless from where its called. e.g

(I know this isn’t syntactically correct.)

private void PriorityLine_Click(object sender, EventArgs e).Refresh()
{
   _showPriorityLine = (_showPriorityLine) ? false : true;
}

I want to seperate the interface of the method, from the logic contained within the method. I understand it would be the exact amount of effort, if not more. For example, if I were to edit the method and accidently removed Refresh, it would cause my application to break. Whereas, if the Refresh method was outside of the actual logic of the method, I could do anything within the method without worrying about removing the next chain of logic.

  • 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-20T01:02:56+00:00Added an answer on May 20, 2026 at 1:02 am

    Sounds like what you want is Aspect Oriented Programming, there are a number of different frameworks to enable you to have stuff “magically” happen after some set of methods have run, have a look here AOP programming in .Net?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: What is so bad about Singletons? It's understandable that many design patterns
Here is a multilang table design. Is it possible to add a method for
I am having trouble deciding between two possible design choices. I have a web
Is it possible to design a metro styled winform in visual studio 10 or
My use case expects heavy read load - there are two possible model design
Is it possible to get design mode to work for templated user controls? I
Possible Duplicate: Android Layout and positioning issue Design layout which support for all kind
By design I'm expecting a DuplicateKeyExeception from time to time. Is it possible to
Possible Duplicate: Yield In VB.NET In C#, when writing a function that returns an
When making a database with users (that have attributes such as religion), what is

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.