public void ShowDataToLV(ExplorerNode parent) { lv_data.Clear(); foreach (ExplorerNode item in parent.Child) { LV_data dt = new LV_data(); dt.Node = item; if (item.Info.DateMod != time_default) { dt.d_mod = item.Info.DateMod.ToString(timeformat); } if (item.Info.Size >= 0) { dt.SizeString = UnitConventer.ConvertSize(item.Info.Size, 2, UnitConventer.unit_size); string extension = item.GetExtension(); dt.ImgSource = Setting_UI.GetImage( item.GetRoot.NodeType.Type == CloudType.LocalDisk ? IconReader.GetFileIcon(item.GetFullPathString(), IconReader.IconSize.Small, false) : //some large file make slow. IconReader.GetFileIcon("." + extension, IconReader.IconSize.Small, false) ).Source; } else { dt.SizeString = "-1"; dt.ImgSource = Setting_UI.GetImage(IconReader.GetFolderIcon(IconReader.IconSize.Small, IconReader.FolderType.Closed)).Source; } lv_data.Add(dt); } }
void Update() { this.Type = Node.NodeType.Type; ImgSource = Setting_UI.GetImage(ListBitmapImageResource.list_bm_cloud[(int)this.Type]).Source; switch (this.Type) { case CloudType.Folder: case CloudType.LocalDisk: this.Name = Node.Info.Name; break; default: this.Name = Node.NodeType.Email; break; } }
void LoadImage() { image_back.Source = Setting_UI.GetImage(CloudManagerGeneralLib.Properties.Resources.back_icon).Source; image_next.Source = Setting_UI.GetImage(CloudManagerGeneralLib.Properties.Resources.next_icon).Source; image_search.Source = Setting_UI.GetImage(CloudManagerGeneralLib.Properties.Resources.search_64x64, image_search.Width, image_search.Height).Source; }
public ContextMenuDataModel(CloudType Name_n_Img_type) { this.Text = Name_n_Img_type.ToString(); this.Img = Setting_UI.GetImage(ListBitmapImageResource.list_bm_cloud[(int)Name_n_Img_type]); this.Type = Name_n_Img_type; }
public ContextMenuDataModel(string Name, CloudType Img_type) { this.Text = Name; this.Img = Setting_UI.GetImage(ListBitmapImageResource.list_bm_cloud[(int)Img_type]); this.Type = Img_type; }