My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using System.Windows.Forms;
using SyringeControl.WinForms;

namespace SyringeControl
{
/// <summary>
/// An implementation of <see cref="IViewControlModel"/>
/// </summary>
class ViewControlModel : IViewControlModel
{
public ViewControlModel()
{
_types.Changed += InvokePropertyChanged;
_control.Changed += InvokePropertyChanged;
_selectedAssembly.Changed += InvokePropertyChanged;
_selectedType.Changed += InvokePropertyChanged;
}

#region Члены INotifyPropertyChanged

public event PropertyChangedEventHandler PropertyChanged;

#endregion
void InvokePropertyChanged(string propName)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propName));
}

#region Члены IViewControlModel

ListProperty<Type> _types = new ListProperty<Type>("Types");
public IList<Type> Types
{
get
{
return _types.Get();
}
set
{
_types.Set(value);
}
}

SimpleProperty<Type> _selectedType = new SimpleProperty<Type>("SelectedType");
public Type SelectedType
{
get
{
return _selectedType.Get();
}
set
{
_selectedType.Set(value);
}
}

SimpleProperty<Assembly> _selectedAssembly = new SimpleProperty<Assembly>("SelectedAssembly");
public Assembly SelectedAssembly
{
get
{
return _selectedAssembly.Get();
}
set
{
_selectedAssembly.Set(value);
}
}

SimpleProperty<Control> _control = new SimpleProperty<Control>("TestedControl");
public Control TestedControl
{
get { return _control.Get(); }
set
{
_control.Set(value);
}
}
#endregion
}
}

Change log

b4e5f52768aa by Yuri Korchyomkin <yuri.korchyomkin> on Aug 9, 2009   Diff
added to IControlView event notifying
about pressing 'Setup' button
moved some classes to separate files
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 2362 bytes, 87 lines
Powered by Google Project Hosting