コード例 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            int taskID = Intent.GetIntExtra("TaskID", 0);

            if (taskID > 0)
            {
                task = TodoItemManager.GetTask(taskID);
            }

            // set our layout to be the home screen
            SetContentView(Resource.Layout.TaskDetails);
            nameTextEdit  = FindViewById <EditText>(Resource.Id.NameText);
            notesTextEdit = FindViewById <EditText>(Resource.Id.NotesText);
            saveButton    = FindViewById <Button>(Resource.Id.SaveButton);

            // TODO: find the Checkbox control and set the value
            doneCheckbox         = FindViewById <CheckBox>(Resource.Id.chkDone);
            doneCheckbox.Checked = task.Done;

            // find all our controls
            cancelDeleteButton = FindViewById <Button>(Resource.Id.CancelDeleteButton);

            // set the cancel delete based on whether or not it's an existing task
            cancelDeleteButton.Text = (task.ID == 0 ? "Cancel" : "Delete");

            nameTextEdit.Text  = task.Name;
            notesTextEdit.Text = task.Notes;

            // button clicks
            cancelDeleteButton.Click += (sender, e) => { CancelDelete(); };
            saveButton.Click         += (sender, e) => { Save(); };
        }
コード例 #2
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Current = this;

            // LIST
//			TaskMgr = new TodoItemManager();

            // XML
//			var sqliteFilename = "TaskDB.xml";
//			string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
//			string libraryPath = Path.Combine (documentsPath, "..","Library"); // Library folder
//			var path = Path.Combine(libraryPath, sqliteFilename);
//			var xmlStorage = new XmlStorageImplementation ();
//			TaskMgr = new TodoItemManager(path, xmlStorage);

            // SQL
//			var sqliteFilename = "TaskDB.db3";
//			string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
//			string libraryPath = Path.Combine (documentsPath, "..", "Library"); // Library folder
//			var path = Path.Combine(libraryPath, sqliteFilename);
//			var conn = new Connection(path);
//			TaskMgr = new TodoItemManager(conn);

            // AZURE
            TaskMgr = new TodoItemManager(AzureStorageImplementation.DefaultService);

            // PARSE
//			TaskMgr = new TodoItemManager(ParseStorageImplementation.Default);

            return(true);
        }
コード例 #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.HomeScreen);
            tasks = TodoItemManager.GetTasks();

            foreach (TodoItem task in tasks)
            {
                tableItems.Add(new TableItem()
                {
                    Heading = task.Name, SubHeading = task.Date
                });
            }

            listView            = FindViewById <ListView>(Resource.Id.TaskList);
            listView.Adapter    = new HomeScreenAdapter(this, tableItems);
            listView.ItemClick += OnListItemClick;

            addButton = FindViewById <ImageButton> (Resource.Id.addButton);

            if (addButton != null)
            {
                addButton.Click += (sender, e) => {
                    StartActivity(typeof(TodoItemScreen));
                };
            }
        }
コード例 #4
0
 public App()
 {
     InitializeComponent();
     TodoManger = new TodoItemManager(new RestService());
     //MainPage = new MainPage();
     MainPage = new NavigationPage(new TodoListPage());
 }
コード例 #5
0
        public override void OnCreate()
        {
            base.OnCreate();

            // List
//			TaskMgr = new TodoItemManager();

            // XML
//			var sqliteFilename = "TaskDB.xml";
//			string libraryPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
//			var path = Path.Combine(libraryPath, sqliteFilename);
//			var xmlStorage = new AndroidTodo.XmlStorageImplementation ();
//			TaskMgr = new TodoItemManager(path, xmlStorage);

            // SQL
//			var sqliteFilename = "TaskDB.db3";
//			string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
//			var path = Path.Combine(documentsPath, sqliteFilename);
//			var conn = new Connection(path);
//			TaskMgr = new TodoItemManager(conn);

            // AZURE
            TaskMgr = new TodoItemManager(AzureStorageImplementation.DefaultService);

            // PARSE
//			TaskMgr = new TodoItemManager(ParseStorageImplementation.Default);
        }
コード例 #6
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Current = this;

            // SQL
//			var sqliteFilename = "TaskDB.db3";
//			string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
//			string libraryPath = Path.Combine (documentsPath, "..", "Library"); // Library folder
//			var path = Path.Combine(libraryPath, sqliteFilename);
//			var conn = new Connection(path);
//			TaskMgr = new TodoItemManager(conn);

            // AZURE
            TaskMgr = new TodoItemManager(AzureStorageImplementation.DefaultService);


            // PUSH
            UIRemoteNotificationType notificationTypes =
                UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;

            UIApplication.SharedApplication
            .RegisterForRemoteNotificationTypes(notificationTypes);

            return(true);
        }
コード例 #7
0
ファイル: Application.cs プロジェクト: yuxifu/xamarin-samples
        public override void OnCreate()
        {
            base.OnCreate();

            // TODO: pick which storage library you wish to use...

            // List
//          TaskMgr = new TodoItemManager();

            // XML
//			var sqliteFilename = "TodoList.xml";
//			string libraryPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
//			var path = Path.Combine(libraryPath, sqliteFilename);
//			var xmlStorage = new AndroidTodo.XmlStorageImplementation ();
//			TaskMgr = new TodoItemManager(path, xmlStorage);

            // ADO.NET
            var    sqliteFilename = "TodoADODB.db3";
            string documentsPath  = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // Documents folder
            string libraryPath    = Path.Combine(documentsPath, "..", "Library");                  // Library folder
            var    path           = Path.Combine(libraryPath, sqliteFilename);
            var    db             = new ADODatabase(path);

            TaskMgr = new TodoItemManager(db);

            // SQLite
//			var sqliteFilename = "TodoSqliteDB.db3";
//			string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
//			var path = Path.Combine(documentsPath, sqliteFilename);
//			var conn = new Connection(path);
//			TaskMgr = new TodoItemManager(conn);
        }
コード例 #8
0
        public MainPage()
        {
            InitializeComponent();


          
            manager = TodoItemManager.DefaultManager;
        }
コード例 #9
0
 public void DeleteTask()
 {
     if (currentItem.ID >= 0)
     {
         TodoItemManager.DeleteTask(currentItem.ID);
     }
     NavigationController.PopViewController(true);
 }
コード例 #10
0
 public void DeleteTaskRow(int rowId)
 {
     using (var transaction = TodoItemManager.BeginTransaction())
     {
         TodoItemManager.DeleteTask(tasks [rowId].ID);
         transaction.Commit();
     }
 }
コード例 #11
0
ファイル: App.xaml.cs プロジェクト: kidfox2001/Phoneword
        public App()
        {
            InitializeComponent();
            PhoneNumbers = new List <string>();
            TodoManager  = new TodoItemManager(new RestService());

            MainPage = new NavigationPage(new MainPage2());
        }
コード例 #12
0
 void CancelDelete()
 {
     if (task.ID != 0)
     {
         TodoItemManager.DeleteTask(task.ID);
     }
     Finish();
 }
コード例 #13
0
 public async Task CancelDelete()
 {
     if (!string.IsNullOrEmpty(task._id))
     {
         await TodoItemManager.DeleteKTask(task);
     }
     Finish();
 }
コード例 #14
0
 void CancelDelete()
 {
     if (task.ID != null)
     {
         TodoItemManager.DeleteTask(task.ID);
     }
     transaction.Commit();
     Finish();
 }
コード例 #15
0
 public void DeleteTask()
 {
     if (currentItem != null)
     {
         TodoItemManager.DeleteTask(currentItem.ID);
     }
     NavigationController.PopViewController(true);
     transaction.Commit();
 }
コード例 #16
0
ファイル: HomeScreen.cs プロジェクト: robowookie/Assignment-7
        public async Task DeleteTask()
        {
            if (currentItem.ID >= 0)
            {
                await TodoItemManager.DeleteKTask(currentItem);
            }

            NavigationController.PopViewController(true);
            PopulateTable();
        }
コード例 #17
0
 public void SaveTask()
 {
     context.Fetch();              // re-populates with updated values
     currentItem.Name  = taskDialog.Name;
     currentItem.Notes = taskDialog.Notes;
     // TODO: show the completion status in the UI
     currentItem.Done = taskDialog.Done;
     TodoItemManager.SaveTask(currentItem);
     NavigationController.PopViewController(true);
 }
コード例 #18
0
        void Save()
        {
            task.Name  = nameTextEdit.Text;
            task.Notes = notesTextEdit.Text;
            //TODO:
            task.Done = doneCheckbox.Checked;

            TodoItemManager.SaveTask(task);
            Finish();
        }
コード例 #19
0
        private void Inizializations()
        {
            var    sqliteFilename = "TodoItemDB.db3";
            string libraryPath    = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            var    path           = Path.Combine(libraryPath, sqliteFilename);

            conn = new SQLiteConnection(path);

            TodoManager = new TodoItemManager(conn);
        }
コード例 #20
0
        void Save()
        {
            task.Name  = nameTextEdit.Text;
            task.Notes = notesTextEdit.Text;
            task.Done  = doneCheckbox.Checked;

            TodoItemManager.SaveTask(task);
            transaction.Commit();
            Finish();
        }
コード例 #21
0
ファイル: TodoItemPage.xaml.cs プロジェクト: Beyhum/Todo2
        private async void OnAddItem(object sender, EventArgs e)
        {
            Item itemToAdd = new Item(titleEntry.Text, notesEntry.Text);


            // pops our navigation stack, returning us to the previous page (TodoListPage)
            await Navigation.PopAsync();

            await TodoItemManager.AddItem(itemToAdd);
        }
コード例 #22
0
        public override void OnCreate()
        {
            base.OnCreate();

            var    sqliteFilename = "TaskDB.xml";
            string libraryPath    = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            var    path           = Path.Combine(libraryPath, sqliteFilename);

            TaskMgr = new TodoItemManager(path);
        }
コード例 #23
0
        protected void ShowTaskDetails(TodoItem item)
        {
            transaction = TodoItemManager.BeginTransaction();
            item        = item ?? TodoItemManager.CreateTodoItem();

            currentItem   = item;
            taskDialog    = new TodoItemDialog(currentItem);
            context       = new BindingContext(this, taskDialog, "Task Details");
            detailsScreen = new DialogViewController(context.Root, true);
            ActivateController(detailsScreen);
        }
コード例 #24
0
        public TodoListViewModel()
        {
            InitCommands();

            TodoItemManager.CreateAsync().ContinueWith(x => {
                this.manager = x.Result;
                this.manager.MobileServiceClient.EventManager.Subscribe <StoreOperationCompletedEvent>(StoreOperationEventHandler);

                Device.BeginInvokeOnMainThread(async() => { await SyncItemsAsync(); });
            });
        }
コード例 #25
0
        public async Task Save()
        {
            task.Name  = nameTextEdit.Text;
            task.Notes = notesTextEdit.Text;
            //TODO:
            task.Done = doneCheckbox.Checked;

            await TodoItemManager.SaveKTask(task);

            Finish();
        }
コード例 #26
0
        void Save()
        {
            task.Name     = nameTextEdit.Text;
            task.Date     = notesTextEdit.Text;
            task.Reminder = "";
            task.Details  = "";
            task.Done     = doneCheckbox.Checked;

            TodoItemManager.SaveTask(task);
            Finish();
        }
        public TodoListViewModel()
        {
            InitCommands();

            TodoItemManager.CreateAsync().ContinueWith(x => {
                this.manager = x.Result;
                this.manager.MobileServiceClient.EventManager.Subscribe<StoreOperationCompletedEvent>(StoreOperationEventHandler);

                Device.BeginInvokeOnMainThread(async () => { await SyncItemsAsync(); });
            });
        }
コード例 #28
0
ファイル: HomeScreen.cs プロジェクト: pafik13/CRMLite-Doctors
        protected override void OnResume()
        {
            base.OnResume();

            tasks = TodoItemManager.GetTasks();

            // create our adapter
            taskList = new TodoItemListAdapter(this, tasks);

            //Hook up our adapter to our ListView
            taskListView.Adapter = taskList;
        }
コード例 #29
0
        // called whenever we interact with an item in our list (long press on Android, swipe on iOS, right click on Windows) and choose the "Remove" Menu button
        private async void OnMenuRemoveItem(object sender, EventArgs e)
        {
            // the sender is the MenuItem object which we defined in our XAML
            // we set its Clicked property to the name of this method in XAML instead of giving it a name and referencing it in C#
            var menuItem = sender as MenuItem;

            // We had bound the CommandParameter property to the current Item that's selected through {Binding .}
            // We cast it into an Item to access its properties
            var currentItem = menuItem.CommandParameter as Item;

            await TodoItemManager.RemoveItem(currentItem);
        }
コード例 #30
0
ファイル: AppStart.xaml.cs プロジェクト: liwich/CarpoolScio
        public AppStart()
        {
            TodoItemManager obj = new TodoItemManager();

            UserMain    = new User();
            UserMain.Id = "";

            InitializeComponent();
            var loginPage = new NavigationPage(new Login());

            MainPage = loginPage;
        }
コード例 #31
0
ファイル: Application.cs プロジェクト: Yashwanth1302/Test
        public override void OnCreate()
        {
            base.OnCreate();

            var    sqliteFilename = "TodoItemDB.db3";
            string libraryPath    = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            var    path           = Path.Combine(libraryPath, sqliteFilename);

            conn = new SQLiteConnection(path);

            TodoManager = new TodoItemManager(conn);
        }
コード例 #32
0
        public YondaList()
        {
            InitializeComponent();

            manager = TodoItemManager.DefaultManager;

            // OnPlatform<T> doesn't currently support the "Windows" target platform, so we have this check here.
            if (manager.IsOfflineEnabled &&
                (Device.OS == TargetPlatform.Windows || Device.OS == TargetPlatform.WinPhone))
            {
                var syncButton = new Button
                {
                    Text = "Sync items",
                    MinimumHeightRequest = 15
                };
                syncButton.Clicked += OnSyncItems;

                buttonsPanel.Children.Add(syncButton);
            }
        }
コード例 #33
0
 public TodoItemFileSyncHandler(TodoItemManager itemManager)
 {
     this.todoItemManager = itemManager;
 }