private void Load_Click(object sender, RoutedEventArgs e) { //Note: It may required to run Visual Studio in administrator mode fro filestream to work FileStream f = new FileStream("C:/History.xml", FileMode.Open, FileAccess.Read); DataContractSerializer sz = new DataContractSerializer(typeof(BrowseHistory)); History = (BrowseHistory)sz.ReadObject(f); f.Close(); m_biz.SetFullHistory(History); int currentzoom = (int)slider.Value; HE = m_biz.GetCurrHistEntry(); xaxis = HE.x; yaxis = HE.y; if (currentzoom != HE.zoom) { slideraddhistent = 0; slider.Value = HE.zoom; } else { loader(); } }
public HistEntry GetCurrHistEntry() { int index = browseH.CurrEntryIndex; HistEntry h = browseH.History[index]; return(h); }
/// <summary> /// HistForward /// sets zoom,x,y to next hist entry /// </summary /// <param name="x"></param> /// <param name="y"></param> /// <param name="zoom"></param> public void HistForward(out int x, out int y, out int zoom) { HistEntry entry = m_hist.GetHistForward(); x = entry.X; y = entry.Y; zoom = entry.Zoom; }
/// <summary> /// GetCurrHistEntry /// get x, y and zoom from the current history entry /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="zoom"></param> public void GetCurrHistEntry(out int x, out int y, out int zoom) { HistEntry entry = m_hist.GetCurrHist(); x = entry.X; y = entry.Y; zoom = entry.Zoom; }
//Adds history to the list when user navigates through tiles public void AddHistEntry(int x, int y, int zoom) { try { HistEntry he = new HistEntry(x, y, zoom); m_hist.AddHistEntry(he); } catch (NullReferenceException) { System.Console.WriteLine("Attempt for saving history just after loadin tile!"); } }
public void AddHistEntry(HistEntry h) { //browseH.CurrEntryIndex = browseH.CurrEntryIndex + 1; browseH.CurrEntryIndex++; browseH.History.Insert(browseH.CurrEntryIndex, h); Console.WriteLine("AddHist: " + browseH.CurrEntryIndex); Console.WriteLine("AddHist Count: " + browseH.History.Count); while (browseH.History.Count > browseH.CurrEntryIndex + 1) { browseH.History.RemoveAt(browseH.History.Count - 1); } }
public void AddHistEntry(HistEntry hist) { if (CurrEntryIdx < History.Count - 1) { //Removing previous history entries when user calls HistBack() Several times and then add a new entry //CurrEntryIndex + 1 - is becuase we need to save only the current entry as the history left when user navigates through tiles again this.History.RemoveRange(CurrEntryIdx + 1, History.Count - (CurrEntryIdx + 1)); } this.History.Add(hist); //Helps to get the next available index of the list CurrEntryIdx++; }
public HistEntry HistForward() { if (browseH.CurrEntryIndex < browseH.History.Count - 1) { browseH.CurrEntryIndex = browseH.CurrEntryIndex + 1; HistEntry h = browseH.History[browseH.CurrEntryIndex]; Console.WriteLine("Forward: " + browseH.CurrEntryIndex); Console.WriteLine("Forward Count: " + browseH.History.Count); return(h); } else { return(null); } }
public HistEntry HistBack() { if (browseH.CurrEntryIndex > 0) { browseH.CurrEntryIndex = browseH.CurrEntryIndex - 1; HistEntry h = browseH.History[browseH.CurrEntryIndex]; Console.WriteLine("Back: " + browseH.CurrEntryIndex); Console.WriteLine("Back Count: " + browseH.History.Count); return(h); } else { return(null); } }
public HistEntry GetCurrHistEntry() { HistEntry x = null; try { x = History[CurrEntryIdx]; } //If Load tile button have not clicked already catch (ArgumentOutOfRangeException) { System.Console.WriteLine(); } return(x); }
private void Back_Click(object sender, RoutedEventArgs e) { int curridx = m_biz.GetCurrentIndex(); if (curridx > 0) { int currentzoom = (int)slider.Value; HE = m_biz.HistBack(); xaxis = HE.x; yaxis = HE.y; if (currentzoom != HE.zoom) { slideraddhistent = 0; slider.Value = HE.zoom; } else { loader(); } } }
public HistEntry GetCurrHistEntry() { His = BH.BHGetCurrHistEntry(); return(His); }
public HistEntry HistForward() { His = BH.BHHistForward(); return(His); }
public HistEntry HistBack() { His = BH.BHHistBack(); return(His); }