public TabIDs getCurrentSelectedTabAndTabsListID() { bool notif_received = false; TabIDs result = new TabIDs(); Messenger.Default.Register <TempContentNotification>(this, (notification) => { if (notification.answerNotification && notification.type == TempContentType.currentIDs) { TabID currentIDs = (TabID)notification.content; result.listID = currentIDs.ID_TabsList; result.tabID = currentIDs.ID_Tab; notif_received = true; } }); Messenger.Default.Send(new TempContentNotification { answerNotification = false, type = TempContentType.currentIDs }); while (!notif_received) { ; } return(result); }
private static void QueueCacheItem_Removed(object Sender, CacheItemEventArgs <string, TabQueue> e) { TabQueue Queue = e.Value; string TabID = Queue.TabID; string Location; Queue.Queue.Clear(); lock (locationByTabID) { if (locationByTabID.TryGetValue(TabID, out Location)) { locationByTabID.Remove(TabID); } else { Location = null; } } if (Location != null) { lock (tabIdsByLocation) { if (tabIdsByLocation.TryGetValue(Location, out Dictionary <string, List <KeyValuePair <string, string> > > TabIDs)) { if (TabIDs.Remove(TabID) && TabIDs.Count == 0) { tabIdsByLocation.Remove(Location); } } } } }
public void focusTabViaPosition(int tabNumber) { TabIDs IDs = getCurrentSelectedTabAndTabsListID(); Messenger.Default.Send(new STSNotification { Type = TypeUpdateTab.SelectTabViaNumber, TabNumber = tabNumber, ID = new TabID { ID_Tab = IDs.tabID, ID_TabsList = IDs.listID } }); }
public Tab getTabViaID(TabIDs id) { var tab = TabsAccessManager.GetTabViaID(new TabID { ID_Tab = id.tabID, ID_TabsList = id.listID }); Tab newTab = new Tab(); //Convert InfosTab (.NET Lib) to Tab (WinRT Component) newTab.id = id; newTab.dateTabContentUpdated = tab.DateTabContentUpdated; if (tab.TabOriginalPathContent == null) { newTab.pathContent = ""; } else { newTab.pathContent = tab.TabOriginalPathContent; } switch (tab.TabContentType) { case ContentType.File: newTab.tabContentType = ContentTypeInfos.File; break; case ContentType.Folder: newTab.tabContentType = ContentTypeInfos.Folder; break; } newTab.tabDateModified = tab.TabDateModified; newTab.tabName = tab.TabName; newTab.tabNewModifications = tab.TabNewModifications; newTab.tabType = tab.TabType; newTab.encoding = EncodingsHelper.EncodingName(tab.TabEncoding, tab.TabEncodingWithBOM); return(newTab); }