public ChatLabelView(Chat chat, bool isClient = true) { Chat = chat; InitializeComponent(); if (!isClient) { LabelPath.SetResourceReference(Path.DataProperty, "Manager"); LabelPath.SetResourceReference(Shape.FillProperty, "TextOnDarkColor"); } else { var item = new MenuItem { Header = "Закрыть чат", }; item.Click += (s, e) => { Data.Current.InsertOrUpdateChat(Chat, isDialogOpened: false); }; ContextMenu = new ContextMenu { Items = { item } }; } Label.Content = string.IsNullOrWhiteSpace(Chat.LastName + Chat.FirstName) ? Chat.Username ?? Chat.Id.ToString() : Chat.LastName + " " + Chat.FirstName; }
private string GetLabelFile(Site site, string category) { var labelPath = new LabelPath(site); if (string.IsNullOrEmpty(category)) { return(Path.Combine(labelPath.PhysicalPath, DefaultLabelFile)); } else { return(Path.Combine(labelPath.PhysicalPath, category + ".json")); } }
private string GetImportExportTempFolder(Site site) { var labelPath = new LabelPath(site); return(Path.Combine(labelPath.PhysicalPath, "TEMP")); }
public IEnumerable <string> GetCategories(Site site) { var labelPath = new LabelPath(site); return(GetCategories(labelPath.PhysicalPath)); }
public void Flush(Site site) { var labelPath = new LabelPath(site); Kooboo.IO.IOUtility.DeleteDirectory(labelPath.PhysicalPath, true); }