Ejemplo n.º 1
0
        public MainWindow()
        {
            /// TODO:
            /// Every annotation needs a timestam
            /// Also, we will add an edits table for handling diffs and revisions
            /// Edits are also timestamped
            /// By comparing timestamps we can preserve annotation indexing

               ///Show the number of annotations on the text selection page
               ///Highlight the

            db = DataUtil.GetDataContext();
            ///Todo:
            ///Add a library of fundamental texts
            ///Filter annotations based on where you are in the text
            ///Introduce inter-text linking and the notion of chapter, paragraph, etc.
            InitializeComponent();
            this.ShowAll = true;
            this.currentUser = db.Users.First();

            this.currentTextDetail = db.TextDetails.Where(i => i.Title == "Les Miserables").Single();
            this.currentText = db.Texts.Where(i => i.ID == 1).Single();

            if (!db.Texts.Select(i => i.TextDetail.Title).Contains(currentTextDetail.Title)) {
                db.Texts.AddObject(this.currentText);
                db.SaveChanges();
            }
            loadAnnotations();

            this.allTexts.ItemsSource = db.Texts.Select(i => i.TextDetail);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUsers(User user)
 {
     base.AddObject("Users", user);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a new User object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static User CreateUser(global::System.Int32 id)
 {
     User user = new User();
     user.ID = id;
     return user;
 }