Ejemplo n.º 1
0
 private DictionaryNode GetNewVariantNode(DictionaryNode variantsNode, PopupWindowShowActionExecuteEventArgs e, out ViewCloner viewCloner) {
     DictionaryNode newVariantNode = variantsNode.AddChildNode("Variant");
     viewCloner = ((ViewCloner) e.PopupWindow.View.CurrentObject);
     newVariantNode.SetAttribute("ViewID", viewCloner.Caption);
     setAttributes(newVariantNode, viewCloner);
     return newVariantNode;
 }
 private void RepositoryItem_OnButtonClick(object sender, ButtonPressedEventArgs e)
 {
     
     if (e.Button.Kind == ButtonPredefines.Delete)
     {
         if (MessageBox.Show("Delete current view?", null,MessageBoxButtons.YesNo)==DialogResult.Yes) {
             deleteView(sender);
             return;
         }
     }
     else if (e.Button.Kind==ButtonPredefines.Ellipsis) {
         
         var objectSpace = Application.CreateObjectSpace();
         var viewCloner = new ViewCloner(objectSpace.Session){Caption = Frame.GetController<ChangeVariantController>().ChangeVariantAction.SelectedItem.Caption};
         var detailView = Application.CreateDetailView(objectSpace, viewCloner);
         var parameters = new ShowViewParameters(detailView) {TargetWindow = TargetWindow.NewModalWindow};
         var controller = new DialogController();
         controller.AcceptAction.Execute+=EditViewActionOnExecute;
         parameters.Controllers.Add(controller);
         Application.ShowViewStrategy.ShowView(parameters, new ShowViewSource(null, null));
     }
 }
Ejemplo n.º 3
0
 private void setAttributes(DictionaryNode dictionaryNode, ViewCloner viewCloner)
 {
     dictionaryNode.SetAttribute("Caption", viewCloner.Caption);
     dictionaryNode.SetAttribute("ID", viewCloner.Caption);
 }