예제 #1
0
 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;
 }
예제 #2
0
        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"));
            }
        }
예제 #3
0
        private string GetImportExportTempFolder(Site site)
        {
            var labelPath = new LabelPath(site);

            return(Path.Combine(labelPath.PhysicalPath, "TEMP"));
        }
예제 #4
0
        public IEnumerable <string> GetCategories(Site site)
        {
            var labelPath = new LabelPath(site);

            return(GetCategories(labelPath.PhysicalPath));
        }
예제 #5
0
        public void Flush(Site site)
        {
            var labelPath = new LabelPath(site);

            Kooboo.IO.IOUtility.DeleteDirectory(labelPath.PhysicalPath, true);
        }