source: trunk/CrypPlugins/WorkspaceManager/Model/VisualElementModel.cs @ 1685

Last change on this file since 1685 was 1685, checked in by matkovic, 12 years ago

-Style changes

File size: 3.2 KB
Line 
1/*                             
2   Copyright 2010 Nils Kopal, Viktor M.
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8       http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15*/
16
17
18using System;
19using System.Collections.Generic;
20using System.Linq;
21using System.Text;
22using System.Windows;
23using WorkspaceManager.View.Interface;
24
25namespace WorkspaceManager.Model
26{
27    /// <summary>
28    /// Abstract super class for all Model Elements which will have
29    /// a representation by a View class. It is needed to represent
30    /// Coordinates and Dimensions
31    /// </summary>
32    [Serializable]
33    public abstract class VisualElementModel
34    {
35        /// <summary>
36        /// Called when this object is deleted
37        /// </summary
38        public event EventHandler<EventArgs> OnDelete;
39
40        /// <summary>
41        /// Triggers event OnDelete
42        /// </summary>
43        public void onDelete(){
44            if(OnDelete != null){
45                EventArgs args = new EventArgs();         
46                OnDelete.Invoke(this, args);
47            }
48        }
49
50        /// <summary>
51        /// Current Position of this VisualElementModel
52        /// </summary>
53        public Point Position { get; set; }
54
55        private double minWidth=150;
56        /// <summary>
57        /// Minimum Width of this VisualElementModel
58        /// </summary>
59        public double MinWidth
60        {
61            get { return minWidth; }
62            set
63            {
64                if (value > 150)
65                {
66                    minWidth = value;
67                };
68            }
69        }
70
71        private double minHeight = 150;
72        /// <summary>
73        /// Minimum Height of this VisualElementModel
74        /// </summary>
75        public double MinHeight
76        {
77            get{ return minHeight; }
78            set
79            {
80                if (value > 150)
81                {
82                    minHeight = value;
83                };
84            }
85        }
86
87        /// <summary>
88        /// Width of this VisualElementModel
89        /// </summary>
90        public double Width { get; set; }
91
92        /// <summary>
93        /// Height of this VisualElementModel
94        /// </summary>
95        public double Height { get; set; }
96
97        /// <summary>
98        /// Name of this VisualElementModel
99        /// </summary>
100        public string Name { get; set; }
101
102        /// <summary>
103        /// Indicates that this Model Element needs a GUI Update
104        /// </summary>
105        public Boolean GuiNeedsUpdate { get; set; }
106
107        /// <summary>
108        /// View Element of this VisualElement
109        /// </summary>
110        [NonSerialized]
111        public IUpdateableView UpdateableView = null;
112    }
113
114}
Note: See TracBrowser for help on using the repository browser.