private void ApplyEditorSettings(XMLEditorPropertyControl propertyControl) { _documentLayout.MinimalSize = new Rectangle( Convert.ToInt32(propertyControl.textBoxLeft.Text), Convert.ToInt32(propertyControl.textBoxTop.Text), Convert.ToInt32(propertyControl.textBoxRight.Text) - Convert.ToInt32(propertyControl.textBoxLeft.Text), Convert.ToInt32(propertyControl.textBoxBottom.Text) - Convert.ToInt32(propertyControl.textBoxTop.Text) ); _documentLayout.BackgroundImage = propertyControl.textBoxBackgroundImage.Text; UpdateBackgroundImage(); storeNeeded = true; }
public void CreateEditorPropertyWindow() { XMLEditorPropertyControl editorPropertyWindow = null; if (_propertyWindowPlace != null) { editorPropertyWindow = new XMLEditorPropertyControl(); editorPropertyWindow.textBoxLeft.Text = DocumentLayout.Size.Left.ToString(); editorPropertyWindow.textBoxTop.Text = DocumentLayout.Size.Top.ToString(); editorPropertyWindow.textBoxRight.Text = DocumentLayout.Size.Right.ToString(); editorPropertyWindow.textBoxBottom.Text = DocumentLayout.Size.Bottom.ToString(); editorPropertyWindow.textBoxBackgroundImage.Text = DocumentLayout.BackgroundImage; editorPropertyWindow.Parent = _propertyWindowPlace; editorPropertyWindow.Dock = DockStyle.Top; editorPropertyWindow.OnDataSourceChanged += delegate { ApplyEditorSettings(editorPropertyWindow); }; editorPropertyWindow.Show(); } if (_currentPropertyWindow != null) { _currentPropertyWindow.Hide(); _currentPropertyWindow.Dispose(); } _currentPropertyWindow = editorPropertyWindow; }