public List <EditorCommon.Resources.ResourceFolderContextMenuItem> GetMenuItems(EditorCommon.Resources.IFolderItem folderItem) { var retItems = new List <EditorCommon.Resources.ResourceFolderContextMenuItem>(); return(retItems); }
public List<EditorCommon.Resources.ResourceFolderContextMenuItem> GetMenuItems(EditorCommon.Resources.IFolderItem folderItem) { var retItems = new List<EditorCommon.Resources.ResourceFolderContextMenuItem>(); //foreach(var prop in typeof(CCore.Graphics.TextureImageInfo).GetProperties()) //{ // var atts = prop.GetCustomAttributes(typeof(CSUtility.Editor.Editor_MultiSetInResourceFolderContextMenuAttribute), false); // if (atts.Length <= 0) // continue; // string disName = prop.Name; // atts = prop.GetCustomAttributes(typeof(System.ComponentModel.DisplayNameAttribute), false); // if (atts.Length > 0) // disName = ((System.ComponentModel.DisplayNameAttribute)(atts[0])).DisplayName; // if(prop.PropertyType == typeof(bool)) // { // var menuItem = new EditorCommon.Resources.ResourceFolderContextMenuItem(); // menuItem.Header = "批量设置" + disName; // menuItem.ClickAction = () => // { // if (!System.IO.Directory.Exists(folderItem.AbsolutePath)) // return; // var resInfoAtts = typeof(TextureResourceInfo).GetCustomAttributes(typeof(EditorCommon.Resources.ResourceInfoAttribute), false); // if (resInfoAtts.Length == 0) // return; // SearchOption sop = SearchOption.TopDirectoryOnly; // if (EditorCommon.MessageBox.Show("是否设置子文件夹?", EditorCommon.MessageBox.enMessageBoxButton.YesNo) == EditorCommon.MessageBox.enMessageBoxResult.Yes) // sop = SearchOption.AllDirectories; // var att = resInfoAtts[0] as EditorCommon.Resources.ResourceInfoAttribute; // foreach(var ext in att.ResourceExts) // { // foreach(var file in System.IO.Directory.GetFiles(folderItem.AbsolutePath, "*" + ext, sop)) // { // // 跳过缩略图 // if (file.EndsWith(EditorCommon.Program.SnapshotExt)) // continue; // var imgInfo = new CCore.Graphics.TextureImageInfo(); // var imgInfoFile = file + CCore.Graphics.TextureImageInfo.Suffix; // if(System.IO.File.Exists(imgInfoFile)) // { // imgInfo.Load(file); // //imgInfo.Load(imgInfoFile); // } // prop.SetValue(imgInfo, true); // imgInfo.Save(file); // //imgInfo.Save(imgInfoFile); // } // } // }; // retItems.Add(menuItem); // menuItem = new EditorCommon.Resources.ResourceFolderContextMenuItem(); // menuItem.Header = "批量取消" + disName; // menuItem.ClickAction = () => // { // if (!System.IO.Directory.Exists(folderItem.AbsolutePath)) // return; // var resInfoAtts = typeof(TextureResourceInfo).GetCustomAttributes(typeof(EditorCommon.Resources.ResourceInfoAttribute), false); // if (resInfoAtts.Length == 0) // return; // SearchOption sop = SearchOption.TopDirectoryOnly; // if (EditorCommon.MessageBox.Show("是否设置子文件夹?", EditorCommon.MessageBox.enMessageBoxButton.YesNo) == EditorCommon.MessageBox.enMessageBoxResult.Yes) // sop = SearchOption.AllDirectories; // var att = resInfoAtts[0] as EditorCommon.Resources.ResourceInfoAttribute; // foreach (var ext in att.ResourceExts) // { // foreach (var file in System.IO.Directory.GetFiles(folderItem.AbsolutePath, "*" + ext, sop)) // { // // 跳过缩略图 // if (file.EndsWith(EditorCommon.Program.SnapshotExt)) // continue; // var imgInfo = new CCore.Graphics.TextureImageInfo(); // var imgInfoFile = file + CCore.Graphics.TextureImageInfo.Suffix; // if (System.IO.File.Exists(imgInfoFile)) // { // imgInfo.Load(file); // } // prop.SetValue(imgInfo, false); // imgInfo.Save(file); // } // } // }; // retItems.Add(menuItem); // } //} return retItems; }