Esempio n. 1
0
        public void Parse(ChecklistModel model, string filename)
        {
            Model = model;
            XmlReader   reader   = new FileManage().LoadXml(filename);
            XmlDocument document = new XmlDocument();

            document.Load(reader);

            for (int i = 0; i < document.ChildNodes.Count; i++)
            {
                XmlNode node = document.ChildNodes[i];

                if (node.NodeType != XmlNodeType.Element)
                {
                    continue;
                }

                // pass node to the appropriate parsing function depending on its name
                if (node.Name == "Checklist")
                {
                    ParseWholeChecklist(node);
                }
                else
                {
                    //uh, this is bad and I don't know what ought to be done. TODO
                }
            }
        }
Esempio n. 2
0
        public SQLiteConnection GetConnection()
        {
            var    sqliteFilename = "ChecklistDatabase.db3";
            string documentsPath  = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // Documents folder
            string libraryPath    = new FileManage().GetLibraryFolder();                           //Library folder.
            var    path           = Path.Combine(libraryPath, sqliteFilename);
            // Create the connection
            var plat = new SQLite.Net.Platform.XamarinIOS.SQLitePlatformIOS();
            var conn = new SQLite.Net.SQLiteConnection(plat, path);

            // Return the database connection
            return(conn);
        }