public bool GetEnableDeleteMenu(MyPictureEdit mypictureedit) { if (this.list.ContainsKey(mypictureedit)) { return list[mypictureedit].EnableDeleteMenu; } return false; }
public EventHandler GetCustomClickUpLoad(MyPictureEdit mypictureedit) { if (this.list.ContainsKey(mypictureedit)) { return list[mypictureedit].CustomClickUpLoad; } return null; }
public void SetEnableUpLoadMenu(MyPictureEdit mypictureedit, bool enableuploadmenu) { if (!this.list.ContainsKey(mypictureedit)) { var para = GetDefaultMenupara(); para.EnableUpLoadMenu = enableuploadmenu; this.list.Add(mypictureedit, para); } else { this.list[mypictureedit].EnableUpLoadMenu = enableuploadmenu; } DoStyle(mypictureedit); }
private void DoStyle(MyPictureEdit mypictureedit) { if (!this.list.ContainsKey(mypictureedit)) { return; } var para = this.list[mypictureedit]; if (para.EnableMenu) { var mypicturemenu = new MyPictureMenu(mypictureedit); mypicturemenu.EnableUpLoad = para.EnableUpLoadMenu; mypicturemenu.EnableDelete = para.EnableDeleteMenu; mypicturemenu.EnableSave = para.EnableSaveMenu; mypicturemenu.UpLoadClicked -= para.CustomClickUpLoad; mypicturemenu.UpLoadClicked += para.CustomClickUpLoad; mypicturemenu.DeleteClicked -= para.CustomClickDelete; mypicturemenu.DeleteClicked += para.CustomClickDelete; mypicturemenu.SaveClicked -= para.CustomClickSave; mypicturemenu.SaveClicked += para.CustomClickSave; mypictureedit._Menu = mypicturemenu; } }
public void SetCustomClickUpLoad(MyPictureEdit mypictureedit, EventHandler customclickupload) { if (!this.list.ContainsKey(mypictureedit)) { var para = GetDefaultMenupara(); para.CustomClickUpLoad = customclickupload; this.list.Add(mypictureedit, para); } else { this.list[mypictureedit].CustomClickUpLoad = customclickupload; } DoStyle(mypictureedit); }