Changeset 17586 for branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.cs
- Timestamp:
- 06/04/20 15:55:13 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:mergeinfo changed
/trunk merged: 17574-17576,17579-17581,17583-17585
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.cs
r17226 r17586 170 170 } 171 171 172 172 173 private void OnViewTypeChanged() { 173 if (viewType != null) {174 175 throw new InvalidOperationException(string.Format("View \"{0}\" cannot display content \"{1}\".",176 viewType, Content.GetType())); 177 178 179 180 181 182 183 184 } 174 if (viewType == null) return; 175 if (!ViewCanShowContent(viewType, Content)) 176 throw new InvalidOperationException(string.Format("View \"{0}\" cannot display content \"{1}\".", viewType, Content.GetType())); 177 178 IContentView view = MainFormManager.CreateView(viewType); 179 view.Locked = Locked; 180 view.ReadOnly = ReadOnly; 181 ActiveView = view; //necessary to allow the views to change the status of the viewhost 182 view.Content = Content; 183 184 UpdateActiveMenuItem(); 185 185 186 } 186 187 … … 188 189 activeView.CaptionChanged += new EventHandler(activeView_CaptionChanged); 189 190 activeView.LockedChanged += new EventHandler(activeView_LockedChanged); 191 activeView.ReadOnlyChanged += new EventHandler(activeView_ReadOnlyChanged); 190 192 activeView.Changed += new EventHandler(activeView_Changed); 191 193 } … … 193 195 activeView.CaptionChanged -= new EventHandler(activeView_CaptionChanged); 194 196 activeView.LockedChanged -= new EventHandler(activeView_LockedChanged); 197 activeView.ReadOnlyChanged -= new EventHandler(activeView_ReadOnlyChanged); 195 198 activeView.Changed -= new EventHandler(activeView_Changed); 196 199 } … … 202 205 configurationLabel.Enabled = !activeView.Locked; 203 206 } 207 private void activeView_ReadOnlyChanged(object sender, EventArgs e) { 208 ReadOnly = activeView.ReadOnly; 209 } 210 204 211 private void activeView_Changed(object sender, EventArgs e) { 205 212 OnChanged(); … … 228 235 229 236 #region forwarding of view events 230 internal protectedoverride void OnShown(ViewShownEventArgs e) {237 protected internal override void OnShown(ViewShownEventArgs e) { 231 238 base.OnShown(e); 232 239 View view = ActiveView as View; … … 234 241 view.OnShown(e); 235 242 } 236 internal protectedoverride void OnHidden(EventArgs e) {243 protected internal override void OnHidden(EventArgs e) { 237 244 base.OnHidden(e); 238 245 View view = ActiveView as View; … … 240 247 view.OnHidden(e); 241 248 } 242 internal protectedoverride void OnClosing(FormClosingEventArgs e) {249 protected internal override void OnClosing(FormClosingEventArgs e) { 243 250 base.OnClosing(e); 244 251 View view = ActiveView as View; … … 246 253 view.OnClosing(e); 247 254 } 248 internal protectedoverride void OnClosed(FormClosedEventArgs e) {255 protected internal override void OnClosed(FormClosedEventArgs e) { 249 256 base.OnClosed(e); 250 257 View view = ActiveView as View;
Note: See TracChangeset
for help on using the changeset viewer.