Search Results

Search found 3 results on 1 pages for 'megamind'.

Page 1/1 | 1 

  • How Visual Studio could help to avoid duplicating code?

    - by MegaMind
    I work within a team of developers. Everyone is making their changes without carrying too much if the same thing is already implemented in the codebase. This leads to classes constantly growing and to severe duplication. I want to add line items to class definitions from which a developer could judge what this class has. Would it help? How to do it in Visual Studio? If it wouldn't help, what would be the better alternative to encourage the developers to check if something exists before implementing it?

    Read the article

  • Pass structure as an argument in c# method

    - by MegaMind
    I want to know if it is possible to pass a Structure as a parameter in c# method and if possible, is it a good practice to do so? I have a c# method which is taking six arguments, i really hate that. I could create a carrier class for that and pass it as an argument, but i want to know if structure could do the job. I want to mention here that few arguments to that method are of ref type and few are of value type.

    Read the article

  • How to Bind a Command in WPF

    - by MegaMind
    Sometimes we used complex ways so many times, we forgot the simplest ways to do the task. I know how to do command binding, but i always use same approach. Create a class that implements ICommand interface and from the view model i create new instance of that class and binding works like a charm. This is the code that i used for command binding public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DataContext = this; testCommand = new MeCommand(processor); } ICommand testCommand; public ICommand test { get { return testCommand; } } public void processor() { MessageBox.Show("hello world"); } } public class MeCommand : ICommand { public delegate void ExecuteMethod(); private ExecuteMethod meth; public MeCommand(ExecuteMethod exec) { meth = exec; } public bool CanExecute(object parameter) { return false; } public event EventHandler CanExecuteChanged; public void Execute(object parameter) { meth(); } } But i want to know the basic way to do this, no third party dll no new class creation. Do this simple command binding using a single class. Actual class implements from ICommand interface and do the work.

    Read the article

1