public GridViewMenuEnumItemEntity()
     : base("GridViewMenuEnumItemEntity")
 {
     this.Items.Add(new ToolStripMenuItemCodon("Add", Language.Current.Explorer_GridViewMenuEnumItemEntity_Add,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.AddCommand != null)
         {
             AddCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (AddCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(AddCommand.CanExcute());
                              } }
     });
     this.Items.Add(new ToolStripMenuItemCodon("Edit", Language.Current.Explorer_GridViewMenuEnumItemEntity_Edit,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.EditCommand != null)
         {
             EditCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (EditCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(EditCommand.CanExcute());
                              } }
     });
     this.Items.Add(new ToolStripMenuItemCodon("Delete", Language.Current.Explorer_GridViewMenuEnumItemEntity_Delete,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.DeleteCommand != null)
         {
             DeleteCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (DeleteCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(DeleteCommand.CanExcute());
                              } }
     });
 }
 public TreeMenuMenuEntity()
     : base("TreeMenuMenuEntity")
 {
     this.Items.Add(new ToolStripMenuItemCodon("Add", Language.Current.Explorer_TreeMenuMenuEntity_Add,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.AddCommand != null)
         {
             AddCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (AddCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(AddCommand.CanExcute());
                              } }
     });
     this.Items.Add(new ToolStripMenuItemCodon("Edit", Language.Current.Explorer_TreeMenuMenuEntity_Edit,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.EditCommand != null)
         {
             EditCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (EditCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(EditCommand.CanExcute());
                              } }
     });
     this.Items.Add(new ToolStripMenuItemCodon("Delete", Language.Current.Explorer_TreeMenuMenuEntity_Delete,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.DeleteCommand != null)
         {
             DeleteCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (DeleteCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(DeleteCommand.CanExcute());
                              } }
     });
     this.Items.Add(new ToolStripSeparatorCodon());
     this.Items.Add(new ToolStripMenuItemCodon("MoveBeforeCommand", Language.Current.Explorer_TreeMenuMenuEntity_MoveBefore,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.MoveBeforeCommand != null)
         {
             MoveBeforeCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (MoveBeforeCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(MoveBeforeCommand.CanExcute());
                              } }
     });
     this.Items.Add(new ToolStripMenuItemCodon("MoveAfterCommand", Language.Current.Explorer_TreeMenuMenuEntity_MoveAfter,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.MoveAfterCommand != null)
         {
             MoveAfterCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (MoveAfterCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(MoveAfterCommand.CanExcute());
                              } }
     });
 }
Esempio n. 3
0
 public GridViewMenuDataEntity()
     : base("GridViewMenuDataEntity")
 {
     this.Items.Add(new ToolStripMenuItemCodon("Add", Language.Current.GridViewMenuDataEntity_Add,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.AddCommand != null)
         {
             AddCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (AddCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(AddCommand.CanExcute());
                              } }
     });
     this.Items.Add(new ToolStripMenuItemCodon("Edit", Language.Current.GridViewMenuDataEntity_Edit,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.EditCommand != null)
         {
             EditCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (EditCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(EditCommand.CanExcute());
                              } }
     });
     this.Items.Add(new ToolStripMenuItemCodon("Delete", Language.Current.GridViewMenuDataEntity_Delete,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.DeleteCommand != null)
         {
             DeleteCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (DeleteCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(DeleteCommand.CanExcute());
                              } }
     });
     this.Items.Add(new ToolStripSeparatorCodon());
     this.Items.Add(new ToolStripMenuItemCodon("CreateSql", Language.Current.GridViewMenuDataEntity_CreateSql,
                                               IconsLibrary.Script,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.CreateSqlCommand != null)
         {
             CreateSqlCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (CreateSqlCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(CreateSqlCommand.CanExcute());
                              } }
     });
 }
 public GridMenuToolStripPage()
     : base("GridMenuToolStripPage")
 {
     //添加
     this.Items.Add(new ToolStripMenuItemCodon("Add", Language.Current.Explorer_GridMenuToolStripPage_Add,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.AddCommand != null)
         {
             AddCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (AddCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(AddCommand.CanExcute());
                              } }
     });
     //编辑
     this.Items.Add(new ToolStripMenuItemCodon("Edit", Language.Current.Explorer_GridMenuToolStripPage_Edit,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.EditCommand != null)
         {
             EditCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (EditCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(EditCommand.CanExcute());
                              } }
     });
     //删除
     this.Items.Add(new ToolStripMenuItemCodon("Delete", Language.Current.Explorer_GridMenuToolStripPage_Delete,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.DeleteCommand != null)
         {
             DeleteCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (DeleteCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(DeleteCommand.CanExcute());
                              } }
     });
     //------------
     this.Items.Add(new ToolStripSeparatorCodon());
     //上移
     this.Items.Add(new ToolStripMenuItemCodon("MoveBefore", Language.Current.Explorer_GridMenuToolStripPage_MoveBefore,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.MoveBeforeCommand != null)
         {
             MoveBeforeCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (MoveBeforeCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(MoveBeforeCommand.CanExcute());
                              } }
     });
     //下移
     this.Items.Add(new ToolStripMenuItemCodon("MoveAfter", Language.Current.Explorer_GridMenuToolStripPage_MoveAfter,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.MoveAfterCommand != null)
         {
             MoveAfterCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (MoveAfterCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(MoveAfterCommand.CanExcute());
                              } }
     });
 }