public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            DatabaseConnection = SqliteManager.GetDatabaseConnection();

            Authenticator.Initialise(DatabaseConnection, _conn);

            DataSource   = new RecordTableDataSource(DatabaseConnection);
            NSTextFields = new NSTextField[] { websiteField, accountField, passwordField };

            PushView();
        }
Beispiel #2
0
        public static RecordTableDataSource SearchSource(RecordTableDataSource dataSource, string query)
        {
            var searchData = new RecordTableDataSource(dataSource.Records.Where(x => x.Website.Contains(query, StringComparison.InvariantCultureIgnoreCase) || x.AccountName.Contains(query, StringComparison.InvariantCultureIgnoreCase)).ToList());

            if (searchData.Records.Count == 0)
            {
                var searchAlert = new NSAlert()
                {
                    AlertStyle      = NSAlertStyle.Warning,
                    InformativeText = "No search results!"
                };

                searchAlert.RunModal();

                return(dataSource);
            }

            return(searchData);
        }
Beispiel #3
0
 public RecordTableDelegate(RecordTableDataSource dataSource, ViewController controller)
 {
     this.DataSource = dataSource;
     this.Controller = controller;
 }
 public void RemoveFilters()
 {
     DataSource = new RecordTableDataSource(DatabaseConnection);
     PushView();
 }