コード例 #1
0
        void ReleaseDesignerOutlets()
        {
            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

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

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

            if (OkButton != null)
            {
                OkButton.Dispose();
                OkButton = null;
            }
        }
コード例 #2
0
        void ReleaseDesignerOutlets()
        {
            if (CloseButton != null)
            {
                CloseButton.Dispose();
                CloseButton = null;
            }

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

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

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

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

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

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

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

            if (ErrorMessageLabel != null)
            {
                ErrorMessageLabel.Dispose();
                ErrorMessageLabel = null;
            }
        }
コード例 #3
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (TextField != null)
            {
                TextField.Dispose();
                TextField = null;
            }

            ErrorMessageLabel?.Dispose();
            ErrorMessageLabel = null;
        }
コード例 #4
0
 void ReleaseDesignerOutlets()
 {
     if (ErrorMessageLabel != null)
     {
         ErrorMessageLabel.Dispose();
         ErrorMessageLabel = null;
     }
     if (TextField != null)
     {
         TextField.Dispose();
         TextField = null;
     }
 }
コード例 #5
0
        private void renderErrorState(string error)
        {
            ExtensionContext.SetWidgetLargestAvailableDisplayMode(NCWidgetDisplayMode.Compact);
            ErrorMessageLabel.Hidden = false;
            ErrorMessageLabel.Text   = error;
            ErrorMessageLabel.SetLineSpacing(errorMessageLineSpacing, UITextAlignment.Center);

            View.AddGestureRecognizer(tapGestureRecognizer);

            StopButton.Hidden       = true;
            StartButton.Hidden      = true;
            DurationLabel.Hidden    = true;
            DescriptionLabel.Hidden = true;
            ProjectNameLabel.Hidden = true;
            DotView.Hidden          = true;

            elapsedTimeTimer?.Invalidate();
            elapsedTimeTimer = null;
        }
コード例 #6
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (TextField != null)
                {
                    //TextField.RemoveTarget(HandleTextField, UIControlEvent.EditingChanged);
                    TextField.InitTextBindHandle = null;
                    TextField.Dispose();
                    TextField = null;
                }

                ErrorMessageLabel?.Dispose();
                ErrorMessageLabel = null;
                _topLabel?.Dispose();
                _topLabel = null;
                SeparatorView?.Dispose();
                SeparatorView = null;
            }
            base.Dispose(disposing);
        }
コード例 #7
0
        void ReleaseDesignerOutlets()
        {
            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (WhatIsSeekiosButton != null)
            {
                WhatIsSeekiosButton.Dispose();
                WhatIsSeekiosButton = null;
            }
        }
コード例 #8
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            projectTaskClientToAttributedString = new ProjectTaskClientToAttributedString(
                ProjectTaskClientLabel.Font.CapHeight,
                Colors.EditTimeEntry.ClientText.ToNativeColor());

            tagsListToAttributedString = new TagsListToAttributedString(TagsTextView);

            localizeLabels();
            prepareViews();
            prepareOnboarding();

            contentSizeChangedDisposable = ScrollViewContent.AddObserver(boundsKey, NSKeyValueObservingOptions.New, onContentSizeChanged);

            DescriptionTextView.Text = ViewModel.Description.Value;

            ViewModel.Preferences
            .Select(preferences => preferences.DurationFormat)
            .Select(format => ViewModel.GroupDuration.ToFormattedString(format))
            .Subscribe(GroupDuration.Rx().Text())
            .DisposedBy(DisposeBag);

            CloseButton.Rx().Tap()
            .Subscribe(ViewModel.CloseWithDefaultResult)
            .DisposedBy(DisposeBag);

            ConfirmButton.Rx()
            .BindAction(ViewModel.Save)
            .DisposedBy(DisposeBag);

            DescriptionTextView.TextObservable
            .Subscribe(ViewModel.Description.Accept)
            .DisposedBy(DisposeBag);

            DescriptionTextView.SizeChangedObservable
            .Subscribe(adjustHeight)
            .DisposedBy(DisposeBag);

            ViewModel.SyncErrorMessage
            .Subscribe(ErrorMessageLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            ViewModel.IsSyncErrorMessageVisible
            .Subscribe(ErrorView.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ErrorView.Rx().Tap()
            .Subscribe(ViewModel.DismissSyncErrorMessage.Inputs)
            .DisposedBy(DisposeBag);

            ViewModel.ProjectClientTask
            .Select(info => projectTaskClientToAttributedString.Convert(
                        info.Project,
                        info.Task,
                        info.Client,
                        new Color(info.ProjectColor).ToNativeColor()))
            .Subscribe(ProjectTaskClientLabel.Rx().AttributedText())
            .DisposedBy(DisposeBag);

            ViewModel.ProjectClientTask
            .Select(info => info.HasProject)
            .Subscribe(ProjectTaskClientLabel.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.ProjectClientTask
            .Select(info => !info.HasProject)
            .Subscribe(AddProjectAndTaskView.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            SelectProject.Rx()
            .BindAction(ViewModel.SelectProject)
            .DisposedBy(DisposeBag);

            TagsTextView.Rx()
            .BindAction(ViewModel.SelectTags)
            .DisposedBy(DisposeBag);

            AddTagsView.Rx()
            .BindAction(ViewModel.SelectTags)
            .DisposedBy(DisposeBag);

            var containsTags = ViewModel.Tags
                               .Select(tags => tags.Any());

            containsTags
            .Invert()
            .Subscribe(AddTagsView.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            containsTags
            .Subscribe(TagsTextView.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.IsBillable
            .Subscribe(BillableSwitch.Rx().CheckedObserver())
            .DisposedBy(DisposeBag);

            BillableSwitch.Rx().Changed()
            .Subscribe(ViewModel.ToggleBillable.Inputs)
            .DisposedBy(DisposeBag);

            ViewModel.IsBillableAvailable
            .Subscribe(BillableView.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.IsInaccessible
            .Subscribe(adjustUIForInaccessibleTimeEntry)
            .DisposedBy(DisposeBag);

            ViewModel.StartTime
            .WithLatestFrom(ViewModel.Preferences,
                            (startTime, preferences) => DateTimeToFormattedString.Convert(
                                startTime,
                                preferences.TimeOfDayFormat.Format))
            .Subscribe(StartTimeLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            ViewModel.StartTime
            .WithLatestFrom(ViewModel.Preferences,
                            (startTime, preferences) => DateTimeToFormattedString.Convert(
                                startTime,
                                preferences.DateFormat.Short))
            .Subscribe(StartDateLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            StartTimeView.Rx().Tap()
            .SelectValue(EditViewTapSource.StartTime)
            .Subscribe(ViewModel.EditTimes.Inputs)
            .DisposedBy(DisposeBag);

            StartDateView.Rx().Tap()
            .Subscribe(ViewModel.SelectStartDate.Inputs)
            .DisposedBy(DisposeBag);

            ViewModel.IsTimeEntryRunning
            .Subscribe(StopButton.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.IsTimeEntryRunning
            .Select(CommonFunctions.Invert)
            .Subscribe(EndTimeLabel.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.StopTime
            .Where(stopTime => stopTime.HasValue)
            .Select(stopTime => stopTime.Value)
            .WithLatestFrom(ViewModel.Preferences,
                            (stopTime, preferences) => DateTimeToFormattedString.Convert(
                                stopTime,
                                preferences.TimeOfDayFormat.Format))
            .Subscribe(EndTimeLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            EndTimeView.Rx().Tap()
            .SelectLatestFrom(ViewModel.IsTimeEntryRunning)
            .Invert()
            .Where(CommonFunctions.Identity)
            .SelectValue(EditViewTapSource.StopTime)
            .Subscribe(ViewModel.EditTimes.Inputs)
            .DisposedBy(DisposeBag);

            EndTimeView.Rx().Tap()
            .Merge(StopButton.Rx().Tap())
            .SelectLatestFrom(ViewModel.IsTimeEntryRunning)
            .Where(CommonFunctions.Identity)
            .SelectUnit()
            .Subscribe(ViewModel.StopTimeEntry.Inputs)
            .DisposedBy(DisposeBag);

            ViewModel.Duration
            .WithLatestFrom(ViewModel.Preferences,
                            (duration, preferences) => duration.ToFormattedString(preferences.DurationFormat))
            .Subscribe(DurationLabel.Rx().Text())
            .DisposedBy(DisposeBag);

            DurationView.Rx().Tap()
            .SelectValue(EditViewTapSource.Duration)
            .Subscribe(ViewModel.EditTimes.Inputs)
            .DisposedBy(DisposeBag);

            DeleteButton.Rx()
            .BindAction(ViewModel.Delete)
            .DisposedBy(DisposeBag);
        }
コード例 #9
0
        void ReleaseDesignerOutlets()
        {
            if (AddProjectAndTaskView != null)
            {
                AddProjectAndTaskView.Dispose();
                AddProjectAndTaskView = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (AddTagsLabel != null)
            {
                AddTagsLabel.Dispose();
                AddTagsLabel = null;
            }
        }
コード例 #10
0
        void ReleaseDesignerOutlets()
        {
            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (SuggestionsTableViewHeightConstraint != null)
            {
                SuggestionsTableViewHeightConstraint.Dispose();
                SuggestionsTableViewHeightConstraint = null;
            }
        }
コード例 #11
0
        void ReleaseDesignerOutlets()
        {
            if (AddProjectAndTaskView != null)
            {
                AddProjectAndTaskView.Dispose();
                AddProjectAndTaskView = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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