public virtual FolderMeta ToMeta(string name) { var meta = new FolderMeta(); meta.SetRoot(GetRoot()); meta.SetMetaPath(GetMetaPath()); meta.SetMetaName(name); meta.SetHash(GetHash()); meta.SetType(GetMetaType()); meta.SetId(GetMetaId()); return meta; }
public void SaveMeta(FolderMeta meta) { _DbEngine.Save(meta); }
public void Init() { if (IlPath == null) { IlPath = new ImageList(); IlPath.ColorDepth = ColorDepth.Depth32Bit; IlPath.ImageSize = new Size(16, 16); IlMetaLarge = new ImageList(); IlMetaLarge.ColorDepth = ColorDepth.Depth32Bit; IlMetaLarge.ImageSize = new Size(48, 48); IlMetaSmall = new ImageList(); IlMetaSmall.ColorDepth = ColorDepth.Depth32Bit; IlMetaSmall.ImageSize = new Size(16, 16); LoadIcon(Path.Combine(_UserModel.ResHome, "Meta"), IlPath); LoadIcon(Path.Combine(_UserModel.ResHome, "Mime"), IlMetaLarge); } TvPath.ImageList = IlPath; LvMeta.LargeImageList = IlMetaLarge; LvMeta.SmallImageList = IlMetaSmall; var meta = new FolderMeta(); meta.SetMetaPath(CPcs.PATH_FAV); meta.SetMetaName("收藏"); _TnFav = GenNode(meta, CPcs.ICON_FAV); TvPath.Nodes.Add(_TnFav); meta = new FolderMeta(); meta.SetMetaPath(CPcs.PATH_LIB); meta.SetMetaName("公共"); _TnPub = GenNode(meta, CPcs.ICON_LIB); TvPath.Nodes.Add(_TnPub); meta = new FolderMeta(); meta.SetMetaPath(_PcsClient.GetPath(CPcs.PATH_LIB_DOCUMENTS)); meta.SetMetaName("文档"); _TnPub.Nodes.Add(GenNode(meta, CPcs.ICON_LIB_DOCUMENTS)); meta = new FolderMeta(); meta.SetMetaPath(_PcsClient.GetPath(CPcs.PATH_LIB_PICTURES)); meta.SetMetaName("图片"); _TnPub.Nodes.Add(GenNode(meta, CPcs.ICON_LIB_PICTURES)); meta = new FolderMeta(); meta.SetMetaPath(_PcsClient.GetPath(CPcs.PATH_LIB_AUDIOS)); meta.SetMetaName("音乐"); _TnPub.Nodes.Add(GenNode(meta, CPcs.ICON_LIB_AUDIOS)); meta = new FolderMeta(); meta.SetMetaPath(_PcsClient.GetPath(CPcs.PATH_LIB_VIDEOS)); meta.SetMetaName("视频"); _TnPub.Nodes.Add(GenNode(meta, CPcs.ICON_LIB_VIDEOS)); meta = new FolderMeta(); meta.SetMetaPath(CPcs.PATH_ALL); meta.SetMetaName("所有"); _TnAll = GenNode(meta, CPcs.ICON_ALL); TvPath.Nodes.Add(_TnAll); meta = new FolderMeta(); meta.SetMetaPath(_PcsClient.GetPath(CPcs.PATH_SNS)); meta.SetMetaName("分享"); _TnSns = GenNode(meta, CPcs.ICON_SNS); TvPath.Nodes.Add(_TnSns); meta = new FolderMeta(); meta.SetMetaPath(_PcsClient.GetPath(CPcs.PATH_APP)); meta.SetMetaName("应用"); _TnApp = GenNode(meta, CPcs.ICON_APP); TvPath.Nodes.Add(_TnApp); meta = new FolderMeta(); meta.SetMetaPath(_PcsClient.GetPath(CPcs.PATH_BIN)); meta.SetMetaName("回收站"); _TnBin = GenNode(meta, CPcs.ICON_BIN); TvPath.Nodes.Add(_TnBin); foreach (var fav in _DataModel.ListMeta(MPcs.ServerType, MPcs.UserId)) { _TnFav.Nodes.Add(GenNode(fav)); } _NddEngine = new NddEngine(); _NddEngine.Init(MPcs.LocalRoot); }