public static Form createViewForm(string viewName, ViewControl viewControl) { Form viewForm = new Form(); viewForm.Controls.Add(viewControl); viewForm.Size = viewControl.Size; return viewForm; }
public AddForm(string viewName, ViewControl control) { InitializeComponent(); addControl = new AddControl(viewName, control); this.Controls.Add(addControl); this.Size = addControl.Size; }
public UpdateForm(string viewName, ViewControl control) { contentManager = Program.Context.ContentManager; updateControl = new UpdateControl(viewName, control); this.Controls.Add(updateControl); InitializeComponent(); this.Size = updateControl.Size; }
public AddControl(string viewName, ViewControl viewControl) { this.View = viewControl.View; this.gridView = viewControl.GridView; this.viewControl = viewControl; valueBoxes = Program.Context.ContentManager.generateContent(this, gridView, view); InitializeComponent(); SzpifControl last = valueBoxes[valueBoxes.Count - 1]; this.OKButton.Location = new Point(OKButton.Location.X, last.Location.Y + last.Size.Height); this.CancelButton.Location = new Point(CancelButton.Location.X, last.Location.Y + last.Size.Height); this.Height = OKButton.Location.Y + OKButton.Height + 40; this.Width = CancelButton.Location.X + CancelButton.Width + 20; }
public UpdateControl(string viewName, ViewControl viewControl) { contentManager = Program.Context.ContentManager; this.viewControl = viewControl; this.gridView = viewControl.GridView; this.view = viewControl.View; InitializeComponent(); valueBoxes = contentManager.generateContent(this, gridView, view); SzpifControl last = valueBoxes[valueBoxes.Count-1]; this.OKButton.Location = new Point(OKButton.Location.X, last.Location.Y + last.Size.Height); this.deleteButton.Location = new Point(deleteButton.Location.X, last.Location.Y + last.Size.Height); this.cancelButton.Location = new Point(cancelButton.Location.X, last.Location.Y + last.Size.Height); this.Height = OKButton.Location.Y + OKButton.Height + 40; this.Width = cancelButton.Location.X + cancelButton.Width + 20; if (view.Deletable == false) deleteButton.Visible = false; }
public Control buildFromNode(XmlNode node) { // przetwarzamy rekurencyjnie wszystkich synow, zbieramy te widoki, do ktorych mamy uprawnienia List<Control> controls = new List<Control>(); foreach (XmlNode child in node.ChildNodes) { Control c = buildFromNode(child); if (c != null) controls.Add(c); } // przetwarzamy aktualny wezel if (controls.Count == 0) { if(node.Attributes["roles"] != null && roles.Contains(node.Attributes["roles"].Value.ToString())) { string viewName = node.Attributes["viewname"].Value.ToString(); string name = node.Attributes["name"].Value.ToString(); ViewControl viewControl = new ViewControl(viewName, 400); viewControl.Name = name; return viewControl; } else return null; } // else if (controls.Count == 1) // { // return controls[0]; // } else { TabbedControl tabbedControl = new TabbedControl(controls); tabbedControl.Name = node.Attributes["name"].Value.ToString(); return tabbedControl; } }
public static UpdateForm createUpdateForm(string viewName, ViewControl viewControl) { return new UpdateForm(viewName, viewControl); }
public static AddForm createAddForm(string viewName, ViewControl viewControl) { return new AddForm(viewName, viewControl); }