public virtual void GenerateCommands(GenerateCommandArgs args) { Document.GenerateActions(args); if (args.Area == "viewer") { this.args = args; } //actions = args.Actions; string area = args.Area; if (area == "main") { var aiFile = args.Menu.Items.GetSubmenu("&File"); if (Document.EditMode) { aiFile.Items.Add(new Actions.SaveFile(this), 500); } aiFile.Items.Add(new Actions.SaveAs(this), 500); if (Document.EditMode) { args.ToolBar.Items.Add(new Actions.SaveFile(this), 500); } Viewer.GenerateCommands(args); } }
public GenerateCommandArgs(GenerateCommandArgs args) { Control = args.Control; EditMode = args.EditMode; Area = args.Area; Menu = args.Menu; ToolBar = args.ToolBar; KeyboardCommands = args.KeyboardCommands; }
public void GenerateCommands(GenerateCommandArgs args) { Viewer.GenerateCommands(args); var smView = args.Menu.Items.GetSubmenu("&View"); smView.Items.Add(new Actions.Autoscroll(this), 500); var smZoom = smView.Items.GetSubmenu("&Zoom", 500); smZoom.Items.Add(actionZoomFitWidth = new Actions.FitWidth(this), 500); smZoom.Items.Add(actionZoomFitHeight = new Actions.FitHeight(this), 500); smZoom.Items.Add(actionAllowGrow = new Actions.AllowGrow(this), 500); smZoom.Items.AddSeparator(500); RadioCommand controller = null; zoomLevels.Clear(); foreach (float zoomLevel in ZOOM_LEVELS) { var raction = new RadioCommand { Controller = controller, ID = "zoom" + zoomLevel, MenuText = string.Format("{0}%", zoomLevel * 100) }; raction.Executed += (sender, e) => { var action = sender as RadioCommand; ZoomInfo.Zoom = (float)action.Tag; UpdateSizes(); }; if (controller == null) { controller = raction; } raction.Tag = zoomLevel; smZoom.Items.Add(raction); zoomLevels.Add(zoomLevel, raction); } UpdateUI(); }
public virtual void GenerateCommands(GenerateCommandArgs args) { }
public virtual void GenerateActions(GenerateCommandArgs args) { Info.GenerateCommands(args); }