private void Init()
        {
            var noDataLabel = new Label
            {
                Text = string.Format(AppResources.NoLoginsForUri, _name ?? "--"),
                HorizontalTextAlignment = TextAlignment.Center,
                FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                Style    = (Style)Application.Current.Resources["text-muted"]
            };

            var addLoginButton = new ExtendedButton
            {
                Text    = AppResources.AddALogin,
                Command = new Command(() => AddLoginAsync()),
                Style   = (Style)Application.Current.Resources["btn-primaryAccent"]
            };

            NoDataStackLayout = new StackLayout
            {
                Children        = { noDataLabel, addLoginButton },
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Padding         = new Thickness(20, 0),
                Spacing         = 20
            };

            AddLoginItem = new AddLoginToolBarItem(this);
            ToolbarItems.Add(AddLoginItem);
            SearchItem = new SearchToolBarItem(this);
            ToolbarItems.Add(SearchItem);

            ListView = new ListView(ListViewCachingStrategy.RecycleElement)
            {
                IsGroupingEnabled   = true,
                ItemsSource         = PresentationLoginsGroup,
                HasUnevenRows       = true,
                GroupHeaderTemplate = new DataTemplate(() => new HeaderViewCell()),
                ItemTemplate        = new DataTemplate(() => new VaultListViewCell(
                                                           (VaultListPageModel.Login l) => MoreClickedAsync(l)))
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                ListView.RowHeight = -1;
            }

            Title = string.Format(AppResources.LoginsForUri, _name ?? "--");

            LoadingIndicator = new ActivityIndicator
            {
                IsRunning         = true,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.Center
            };

            Content = LoadingIndicator;
        }
예제 #2
0
        void ReleaseDesignerOutlets()
        {
            if (BackForwardToolBarItem != null)
            {
                BackForwardToolBarItem.Dispose();
                BackForwardToolBarItem = null;
            }

            if (ContainerView != null)
            {
                ContainerView.Dispose();
                ContainerView = null;
            }

            if (LoggedInLabel != null)
            {
                LoggedInLabel.Dispose();
                LoggedInLabel = null;
            }

            if (RefreshToolBarItem != null)
            {
                RefreshToolBarItem.Dispose();
                RefreshToolBarItem = null;
            }

            if (SearchFieldCell != null)
            {
                SearchFieldCell.Dispose();
                SearchFieldCell = null;
            }

            if (SearchRecordsField != null)
            {
                SearchRecordsField.Dispose();
                SearchRecordsField = null;
            }

            if (SearchToolBarItem != null)
            {
                SearchToolBarItem.Dispose();
                SearchToolBarItem = null;
            }

            if (ServerToolBarItem != null)
            {
                ServerToolBarItem.Dispose();
                ServerToolBarItem = null;
            }

            if (NetworkStatus != null)
            {
                NetworkStatus.Dispose();
                NetworkStatus = null;
            }
        }
예제 #3
0
        private void Init()
        {
            SearchItem    = new SearchToolBarItem(this);
            AddCipherItem = new AddCipherToolBarItem(this, null);
            ToolbarItems.Add(SearchItem);
            ToolbarItems.Add(AddCipherItem);

            ListView = new ListView(ListViewCachingStrategy.RecycleElement)
            {
                IsGroupingEnabled   = true,
                ItemsSource         = PresentationSections,
                HasUnevenRows       = true,
                GroupHeaderTemplate = new DataTemplate(() => new SectionHeaderViewCell(
                                                           nameof(Section <Grouping> .Name), nameof(Section <Grouping> .Count), new Thickness(16, 12))),
                ItemTemplate = new DataTemplate(() => new VaultGroupingViewCell())
            };

            if (Device.RuntimePlatform == Device.iOS)
            {
                ListView.RowHeight = -1;
            }

            var noDataLabel = new Label
            {
                Text = AppResources.NoItems,
                HorizontalTextAlignment = TextAlignment.Center,
                FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                Style    = (Style)Application.Current.Resources["text-muted"]
            };

            var addCipherButton = new ExtendedButton
            {
                Text    = AppResources.AddAnItem,
                Command = new Command(() => Helpers.AddCipher(this, null)),
                Style   = (Style)Application.Current.Resources["btn-primaryAccent"]
            };

            NoDataStackLayout = new StackLayout
            {
                Children        = { noDataLabel, addCipherButton },
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Padding         = new Thickness(20, 0),
                Spacing         = 20
            };

            LoadingIndicator = new ActivityIndicator
            {
                IsRunning         = true,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.Center
            };

            Content = LoadingIndicator;
            Title   = AppResources.MyVault;
        }
예제 #4
0
        void ReleaseDesignerOutlets()
        {
            if (SearchFieldCell != null)
            {
                SearchFieldCell.Dispose();
                SearchFieldCell = null;
            }

            if (BackForwardToolBarItem != null)
            {
                BackForwardToolBarItem.Dispose();
                BackForwardToolBarItem = null;
            }

            if (ConnectionToolBarItem != null)
            {
                ConnectionToolBarItem.Dispose();
                ConnectionToolBarItem = null;
            }

            if (CustomView != null)
            {
                CustomView.Dispose();
                CustomView = null;
            }

            if (LoggedInLabel != null)
            {
                LoggedInLabel.Dispose();
                LoggedInLabel = null;
            }

            if (RefreshToolBarItem != null)
            {
                RefreshToolBarItem.Dispose();
                RefreshToolBarItem = null;
            }

            if (SearchToolBarItem != null)
            {
                SearchToolBarItem.Dispose();
                SearchToolBarItem = null;
            }

            if (ShowServerInfoToolBarItem != null)
            {
                ShowServerInfoToolBarItem.Dispose();
                ShowServerInfoToolBarItem = null;
            }
        }
예제 #5
0
        private void Init()
        {
            var noDataLabel = new Label
            {
                Text = string.Format(AppResources.NoItemsForUri, _name ?? "--"),
                HorizontalTextAlignment = TextAlignment.Center,
                FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                Style    = (Style)Application.Current.Resources["text-muted"]
            };

            var addCipherButton = new ExtendedButton
            {
                Text    = AppResources.AddAnItem,
                Command = new Command(() => AddCipherAsync()),
                Style   = (Style)Application.Current.Resources["btn-primaryAccent"]
            };

            NoDataStackLayout = new StackLayout
            {
                Children        = { noDataLabel, addCipherButton },
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Padding         = new Thickness(20, 0),
                Spacing         = 20
            };

            SearchItem = new SearchToolBarItem(this);
            ToolbarItems.Add(SearchItem);

            ListView = new ExtendedListView(ListViewCachingStrategy.RecycleElement)
            {
                IsGroupingEnabled   = true,
                ItemsSource         = PresentationCiphersGroup,
                HasUnevenRows       = true,
                GroupHeaderTemplate = new DataTemplate(() => new SectionHeaderViewCell(
                                                           nameof(Section <AutofillCipher> .Name))),
                ItemTemplate = new DataTemplate(() => new VaultListViewCell(
                                                    (VaultListPageModel.Cipher c) => Helpers.CipherMoreClickedAsync(this, c, true)))
            };

            if (Device.RuntimePlatform == Device.iOS)
            {
                ListView.RowHeight = -1;
            }

            Title = string.Format(AppResources.ItemsForUri, _name ?? "--");

            LoadingIndicator = new ActivityIndicator
            {
                IsRunning         = true,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.Center
            };

            ContentView = new ContentView
            {
                Content = LoadingIndicator
            };

            var fabLayout = new FabLayout(ContentView);

            Fab = new Fab(fabLayout, "plus.png", async(sender, args) => await AddCipherAsync());
            ListView.BottomPadding = 170;

            Content = fabLayout;
        }
예제 #6
0
        void ReleaseDesignerOutlets()
        {
            if (RefreshToolBarItem != null)
            {
                RefreshToolBarItem.Dispose();
                RefreshToolBarItem = null;
            }

            if (AddRootCertificateToolBarItem != null)
            {
                AddRootCertificateToolBarItem.Dispose();
                AddRootCertificateToolBarItem = null;
            }

            if (BackForwardToolBarItem != null)
            {
                BackForwardToolBarItem.Dispose();
                BackForwardToolBarItem = null;
            }

            if (ContainerView != null)
            {
                ContainerView.Dispose();
                ContainerView = null;
            }

            if (HandleConnectionToolBarItem != null)
            {
                HandleConnectionToolBarItem.Dispose();
                HandleConnectionToolBarItem = null;
            }

            if (LoggedUserLabel != null)
            {
                LoggedUserLabel.Dispose();
                LoggedUserLabel = null;
            }

            if (SearchToolBarItem != null)
            {
                SearchToolBarItem.Dispose();
                SearchToolBarItem = null;
            }

            if (ServerInfoToolBarItem != null)
            {
                ServerInfoToolBarItem.Dispose();
                ServerInfoToolBarItem = null;
            }

            if (ShowRootCertificateToolBarItem != null)
            {
                ShowRootCertificateToolBarItem.Dispose();
                ShowRootCertificateToolBarItem = null;
            }

            if (splitview != null)
            {
                splitview.Dispose();
                splitview = null;
            }

            if (ValidateRootCertificateToolBarItem != null)
            {
                ValidateRootCertificateToolBarItem.Dispose();
                ValidateRootCertificateToolBarItem = null;
            }
        }
예제 #7
0
        void ReleaseDesignerOutlets()
        {
            if (OptionalToolBarItem != null)
            {
                OptionalToolBarItem.Dispose();
                OptionalToolBarItem = null;
            }

            if (AddGroupToolBarItem != null)
            {
                AddGroupToolBarItem.Dispose();
                AddGroupToolBarItem = null;
            }

            if (AddObjectToolBarItem != null)
            {
                AddObjectToolBarItem.Dispose();
                AddObjectToolBarItem = null;
            }

            if (AddUserToolBarItem != null)
            {
                AddUserToolBarItem.Dispose();
                AddUserToolBarItem = null;
            }

            if (BackForwardToolBarItem != null)
            {
                BackForwardToolBarItem.Dispose();
                BackForwardToolBarItem = null;
            }

            if (ConnectMenuItem != null)
            {
                ConnectMenuItem.Dispose();
                ConnectMenuItem = null;
            }

            if (ContainerView != null)
            {
                ContainerView.Dispose();
                ContainerView = null;
            }

            if (DeleteObjectToolBarItem != null)
            {
                DeleteObjectToolBarItem.Dispose();
                DeleteObjectToolBarItem = null;
            }

            if (DisconnectMenuItem != null)
            {
                DisconnectMenuItem.Dispose();
                DisconnectMenuItem = null;
            }

            if (FetchNextPageToolBarItem != null)
            {
                FetchNextPageToolBarItem.Dispose();
                FetchNextPageToolBarItem = null;
            }

            if (OperationalToolBarItem != null)
            {
                OperationalToolBarItem.Dispose();
                OperationalToolBarItem = null;
            }

            if (PageSizeToolBarItem != null)
            {
                PageSizeToolBarItem.Dispose();
                PageSizeToolBarItem = null;
            }

            if (PropertiesToolBarItem != null)
            {
                PropertiesToolBarItem.Dispose();
                PropertiesToolBarItem = null;
            }

            if (RefreshToolBarItem != null)
            {
                RefreshToolBarItem.Dispose();
                RefreshToolBarItem = null;
            }

            if (SchemaToolBarItem != null)
            {
                SchemaToolBarItem.Dispose();
                SchemaToolBarItem = null;
            }

            if (SearchToolBarItem != null)
            {
                SearchToolBarItem.Dispose();
                SearchToolBarItem = null;
            }

            if (ServerToolBarItem != null)
            {
                ServerToolBarItem.Dispose();
                ServerToolBarItem = null;
            }

            if (StatusLabel != null)
            {
                StatusLabel.Dispose();
                StatusLabel = null;
            }

            if (SuperLogToolBarItem != null)
            {
                SuperLogToolBarItem.Dispose();
                SuperLogToolBarItem = null;
            }
        }