コード例 #1
0
 public GridViewMenuEnumEntity()
     : base("GridViewMenuEnumEntity")
 {
     this.Items.Add(new ToolStripMenuItemCodon("Add", Language.Current.Explorer_GridViewMenuEnumEntity_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_GridViewMenuEnumEntity_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_GridViewMenuEnumEntity_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("AddItem", Language.Current.Explorer_GridViewMenuEnumEntity_AddItem,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.AddItemCommand != null)
         {
             AddItemCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (AddItemCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(AddItemCommand.CanExcute());
                              } }
     });
 }
コード例 #2
0
 public TreeMenuToolStripItem()
     : base("TreeMenuToolStripItem")
 {
     //添加
     this.Items.Add(new ToolStripMenuItemCodon("Add", Language.Current.Explorer_TreeMenuToolStripItem_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_TreeMenuToolStripItem_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_TreeMenuToolStripItem_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_TreeMenuToolStripItem_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_TreeMenuToolStripItem_MoveAfter,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.MoveAfterCommand != null)
         {
             MoveAfterCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (MoveAfterCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(MoveAfterCommand.CanExcute());
                              } }
     });
 }
コード例 #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());
                              } }
     });
 }
コード例 #4
0
 public GridMenuToolStripItem()
     : base("GridMenuToolStripItem")
 {
     //添加
     this.Items.Add(new ToolStripMenuItemCodon("Add", Language.Current.Explorer_GridMenuToolStripItem_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_GridMenuToolStripItem_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_GridMenuToolStripItem_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_GridMenuToolStripItem_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_GridMenuToolStripItem_MoveAfter,
                                               delegate(object sender, ToolStripItemCodonEventArgs args)
     {
         if (this.MoveAfterCommand != null)
         {
             MoveAfterCommand.Excute();
         }
     })
     {
         IsEnabled = (e) => { if (MoveAfterCommand == null)
                              {
                                  return(false);
                              }
                              else
                              {
                                  return(MoveAfterCommand.CanExcute());
                              } }
     });
     ////------------
     //this.Items.Add(new ToolStripSeparatorCodon());
     ////预览
     //this.Items.Add(new ToolStripMenuItemCodon("Preview", Language.Current.Explorer_GridMenuToolStripItem_Preview,
     //    delegate(object sender, ToolStripItemCodonEventArgs args)
     //    {
     //        if (this.PreviewCommand != null) PreviewCommand.Excute();
     //    })
     //{
     //    IsEnabled = (e) => { if (PreviewCommand == null) return false; else return PreviewCommand.CanExcute(); }
     //});
 }