public static UC_DocItem Add(JToken Token) { Console.WriteLine("[UC)DocItem]:AddNew Token"); UC_DocItem newDocItem = new UC_DocItem(); newDocItem.Deserialize(Token); UC_Collections.DocItems.Add(newDocItem); MainWindow.instance.DocItemsPanel.Children.Add(newDocItem); newDocItem.CheckIfWebLinkTitleUnavailable(); return(newDocItem); }
public static UC_DocItem Add(string Name, string Path, string FullName, FileFormats Format, ImageSource Icon = null) { Console.WriteLine("[UC)DocItem]:AddNew 6 params"); UC_DocItem newDocItem = new UC_DocItem(); newDocItem.Id = UC_Collections.DocItems.Count(); newDocItem.DocName = Name; newDocItem.DocPath = Path; newDocItem.DocFormat = Format; newDocItem.FullName = FullName; newDocItem.Icon = Icon; if (Icon == null) { Icon = CSB_FileDropDetection.getExtensionIcon(Path, Format); } newDocItem.CheckIfWebLinkTitleUnavailable(); UC_Collections.DocItems.Add(newDocItem); MainWindow.instance.DocItemsPanel.Children.Add(newDocItem); return(newDocItem); }