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

Last change on this file since 1620 was 1620, checked in by kopal, 12 years ago
  • connectors now may only connect from output to InputConnection
  • view is disabled when editor is executing now
  • connector now has "lastData" which stores last used data
  • minwidth, minheight of an VisualElementModel can only be >=50 now
File size: 3.1 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        public Point Position { get; set; }
51
52        private double minWidth=50;
53        /// <summary>
54        /// Minimum Width of this VisualElementModel
55        /// </summary>
56        public double MinWidth
57        {
58            get { return minWidth; }
59            set
60            {
61                if (value > 50)
62                {
63                    minWidth = value;
64                };
65            }
66        }
67
68        private double minHeight = 50;
69        /// <summary>
70        /// Minimum Height of this VisualElementModel
71        /// </summary>
72        public double MinHeight
73        {
74            get{ return minHeight; }
75            set
76            {
77                if (value > 50)
78                {
79                    minHeight = value;
80                };
81            }
82        }
83
84        /// <summary>
85        /// Width of this VisualElementModel
86        /// </summary>
87        public double Width { get; set; }
88
89        /// <summary>
90        /// Height of this VisualElementModel
91        /// </summary>
92        public double Height { get; set; }
93
94        /// <summary>
95        /// Name of this VisualElementModel
96        /// </summary>
97        public string Name { get; set; }
98
99        /// <summary>
100        /// Indicates that this Model Element needs a GUI Update
101        /// </summary>
102        public Boolean GuiNeedsUpdate { get; set; }
103
104        /// <summary>
105        /// View Element of this VisualElement
106        /// </summary>
107        public IUpdateableView UpdateableView = null;
108    }
109
110}
Note: See TracBrowser for help on using the repository browser.