Exemplo n.º 1
0
 public ModalButtonOptions(bool showCancel, bool showConfirm, CancelButton cancelButton, ConfirmButton confirmButton)
 {
     this.ShowCancelButton  = showCancel;
     this.ShowConfirmButton = showConfirm;
     this.CancelButtonType  = cancelButton;
     this.ConfirmButtonType = confirmButton;
 }
 void ReleaseDesignerOutlets()
 {
     if (AddressLabel != null)
     {
         AddressLabel.Dispose();
         AddressLabel = null;
     }
     if (CityLabel != null)
     {
         CityLabel.Dispose();
         CityLabel = null;
     }
     if (ConfirmButton != null)
     {
         ConfirmButton.Dispose();
         ConfirmButton = null;
     }
     if (GoBackButton != null)
     {
         GoBackButton.Dispose();
         GoBackButton = null;
     }
     if (NameLabel != null)
     {
         NameLabel.Dispose();
         NameLabel = null;
     }
     if (PhoneLabel != null)
     {
         PhoneLabel.Dispose();
         PhoneLabel = null;
     }
 }
Exemplo n.º 3
0
 private void Awake()
 {
     confirmButton = GetComponentInChildren <ConfirmButton>();
     cancelButton  = GetComponentInChildren <CancelButton>();
     textField     = GetComponentInChildren <TextMeshProUGUI>();
     tagalong      = GetComponent <Tagalong>();
     capturer      = GetComponentInChildren <PhotoCaptureWithHolograms>();
 }
Exemplo n.º 4
0
        public void Confirm()
        {
            if (!ConfirmButton.Enabled)
            {
                throw new ApiException("Confirm button can not be clicked because it is not enabled in the messagebox.");
            }

            ConfirmButton.Click();
        }
Exemplo n.º 5
0
    void ReleaseDesignerOutlets()
    {
        if (ActionSheetBottomButton != null)
        {
            ActionSheetBottomButton.Dispose();
            ActionSheetBottomButton = null;
        }

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

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

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

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

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

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

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

        if (ToastButton != null)
        {
            ToastButton.Dispose();
            ToastButton = null;
        }
    }
Exemplo n.º 6
0
        void ReleaseDesignerOutlets()
        {
            if (Address1Label != null)
            {
                Address1Label.Dispose();
                Address1Label = null;
            }

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

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

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

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

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

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

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

            if (TimeLabel != null)
            {
                TimeLabel.Dispose();
                TimeLabel = null;
            }
        }
Exemplo n.º 7
0
 private void Awake()
 {
     cb = this;
     button = GetComponent<dfButton>();
     control = GetComponent<dfControl>();
     tabcontainer = MenuTabContainer.tab;
     shipSelect = FindObjectOfType<dfCoverflow>();
     title.Display("Create Captain");
     hbs = FindObjectOfType<HullBarScript>();
     sbs = FindObjectOfType<ShieldBarScript>();
 }
Exemplo n.º 8
0
 internal void ConfirmDelete()
 {
     try
     {
         //Click on the "Confirm" button
         ConfirmButton.Click();
     }
     catch (Exception e)
     {
         Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Test Failed, Delete Unsuccessfull", e.Message);
     }
 }
Exemplo n.º 9
0
 public string FindHotelsByDestination(Destination destination)
 {
     GuestDropDownList.Click();
     NumberOfAdultsDropDownList.Click();
     NumberOfAdultsDropDownList.SendKeys(OpenQA.Selenium.Keys.Down);
     ConfirmButton.Click();
     SearchInputLine.SendKeys(destination.EmptyDestination);
     ComeInDate.Click();
     ChosenData.Click();
     SearchButton.Click();
     return(ErrorDiscovered.Text);
 }
Exemplo n.º 10
0
    public void ValidateInput()
    {
        if (isNewObject)
        {
            ConfirmButton.SetInteractivity(true);
            return;
        }

        bool valid = ((string)nameInput.GetValue()) != selectedObject.GetName();

        ConfirmButton.SetInteractivity(valid, "Name has not been changed");
    }
        void ReleaseDesignerOutlets()
        {
            if (CommentField != null)
            {
                CommentField.Dispose();
                CommentField = null;
            }

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

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

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

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

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

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

            if (StateUserLabel != null)
            {
                StateUserLabel.Dispose();
                StateUserLabel = null;
            }
        }
Exemplo n.º 12
0
 private void userNameBox_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)13)
     {
         if (userNameBox.Focused)
         {
             PasswordBox.Focus();
         }
         else if (PasswordBox.Focused)
         {
             ConfirmButton.Focus();
         }
     }
 }
Exemplo n.º 13
0
    private void Awake()
    {
        InputGO    = transform.Find("Input").gameObject;
        InputComp  = InputGO.GetComponent <InputField>();
        InputImage = InputGO.GetComponent <Image>();
        InputValue = InputGO.transform.Find("Value").GetComponent <Text>();

        EditButton      = transform.Find("Edit").gameObject;
        ConfirmButton   = transform.Find("Confirm").gameObject;
        EditCanGroup    = EditButton.GetComponent <CanvasGroup>();
        ConfirmCanGroup = ConfirmButton.GetComponent <CanvasGroup>();

        SetButtonEvents();
        DefaultMode();
    }
        private void localizeLabels()
        {
            TitleLabel.Text = ViewModel.IsEditingGroup
                ? string.Format(Resources.EditingTimeEntryGroup, ViewModel.GroupCount)
                : Resources.Edit;

            BillableLabel.Text               = Resources.Billable;
            StartDateDescriptionLabel.Text   = Resources.Startdate;
            DurationDescriptionLabel.Text    = Resources.Duration;
            StartDescriptionLabel.Text       = Resources.Start;
            EndDescriptionLabel.Text         = Resources.End;
            ErrorMessageTitleLabel.Text      = Resources.Oops;
            AddProjectTaskLabel.Text         = Resources.AddProjectTask;
            CategorizeWithProjectsLabel.Text = Resources.CategorizeYourTimeWithProjects;
            AddTagsLabel.Text = Resources.AddTags;
            DeleteButton.SetTitle(Resources.Delete, UIControlState.Normal);
            ConfirmButton.SetTitle(Resources.ConfirmChanges, UIControlState.Normal);
        }
Exemplo n.º 15
0
    private void SetButtonEvents()
    {
        EditButton.GetComponent <Button>().onClick.AddListener(() =>
        {
            EditMode(true);
        });

        ConfirmButton.GetComponent <Button>().onClick.AddListener(() =>
        {
            EditMode(false);
            //aarb
            int pos = int.Parse(gameObject.name.Substring(gameObject.name.Length - 1));
            print(pos);
            //agregar nombre en el diccionario
            GameObject.Find("Code").GetComponent <SociedadesController>().SociedadDict[pos].SetName(InputValue.text);
            //aarb
        });
    }
Exemplo n.º 16
0
        //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        private void UpdateButtonValues()
        {
            if (Application.selectedMachine.serviceState.code == MachineServiceStateCodes.Work)
            {
                ConfirmButton.SetTitle("Заявить о неисправности", UIControlState.Normal);
                RejectButton.SetTitle("", UIControlState.Normal);
                RejectButton.Enabled = false;

                confirmState = MachineServiceStateCodes.Broken;
                rejectState  = MachineServiceStateCodes.None;
            }
            else if (Application.selectedMachine.serviceState.code == MachineServiceStateCodes.Broken)
            {
                ConfirmButton.SetTitle("Принять на ремонт", UIControlState.Normal);
                RejectButton.SetTitle("Отказать в ремонте", UIControlState.Normal);
                RejectButton.Enabled = true;

                confirmState = MachineServiceStateCodes.Service;
                rejectState  = MachineServiceStateCodes.Work;
            }
            else if (Application.selectedMachine.serviceState.code == MachineServiceStateCodes.Service)
            {
                ConfirmButton.SetTitle("Вернуть в эксплуатацию", UIControlState.Normal);
                RejectButton.SetTitle("Списать", UIControlState.Normal);
                RejectButton.Enabled = true;

                confirmState = MachineServiceStateCodes.Work;
                rejectState  = MachineServiceStateCodes.Offline;
            }
            else if (Application.selectedMachine.serviceState.code == MachineServiceStateCodes.Offline)
            {
                ConfirmButton.SetTitle("Вернуть в эксплуатацию", UIControlState.Normal);
                RejectButton.SetTitle("", UIControlState.Normal);
                RejectButton.Enabled = false;

                confirmState = MachineServiceStateCodes.Work;
                rejectState  = MachineServiceStateCodes.None;
            }
        }
Exemplo n.º 17
0
        void ReleaseDesignerOutlets()
        {
            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

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

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

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

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

            if (HeaderText != null)
            {
                HeaderText.Dispose();
                HeaderText = null;
            }
        }
Exemplo n.º 18
0
    public async void ValidateInput()
    {
        bool valid = true;

        if (string.IsNullOrEmpty((string)nameInput.GetValue()))
        {
            ConfirmButton.SetInteractivity(false, "Name cannot be empty");
            valid = false;
        }
        else if (string.IsNullOrEmpty(valueInput.Input.text) && selectedType != ProjectParameterTypes.boolean)
        {
            ConfirmButton.SetInteractivity(false, "Value cannot be empty");
            valid = false;
        }

        if (!isNewConstant)
        {
            if (((string)nameInput.GetValue()) == projectParameter.Name && valueInput.Input.text == projectParameter.Value)    //known bug: always false when parameter's type is double or boolean
            {
                ConfirmButton.SetInteractivity(false, "Project parameter unchanged");
                valid = false;
            }
        }

        if (!valid)
        {
            return;
        }

        try {
            await Confirm(true);

            ConfirmButton.SetInteractivity(true);
        } catch (RequestFailedException e) {
            ConfirmButton.SetInteractivity(false, e.Message);
        }
    }
Exemplo n.º 19
0
    // Start is called before the first frame update
    protected override void Start()
    {
        base.Start();
        ClientScene.RegisterPrefab(cardPrefab.gameObject);
        ClientScene.RegisterPrefab(creaturePrefab.gameObject);

        avatar = Resources.LoadAll <Sprite>(GameConstants.PATHS.CARD_IMAGES + GameUtils.GetDatabase().GetAvatarTexture(matchSettings.avatarIndex).name)[1];
        model  = GameUtils.GetDatabase().GetDeckModel(matchSettings.deckModelIndex);

        cardGenerator = new ProceduralCardGenerator(model, imageGlossary, gameSession.creatureModelIndex, nameModel);
        if (isLocalPlayer)
        {
            selectingTextPrompt = GameObject.Find("ScreenUI/SelectPrompt").GetComponent <TextPrompt>();
            selectingTextPrompt.gameObject.SetActive(false);

            ConfirmButton confirmButton = FindObjectOfType <ConfirmButton>();
            confirmButton.localPlayer = this;
            GameOverButton gameOverButton = FindObjectOfType <GameOverButton>();
            gameOverButton.localPlayer = this;
            SurrenderButton surrenderButton = FindObjectOfType <SurrenderButton>();
            surrenderButton.localPlayer = this;
        }
        turnTimer = FindObjectOfType <TurnTimer>();
    }
Exemplo n.º 20
0
 private void Awake()
 {
     instance = this;
     image    = GetComponent <Image>();
 }
Exemplo n.º 21
0
        void ReleaseDesignerOutlets()
        {
            if (AddDescriptionView != null)
            {
                AddDescriptionView.Dispose();
                AddDescriptionView = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

            if (TaskLabel != null)
            {
                TaskLabel.Dispose();
                TaskLabel = null;
            }
        }
        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);
        }
Exemplo n.º 23
0
 private void AddEditPilotForm_Shown(object sender, EventArgs e)
 {
     ConfirmButton.Focus();
 }
Exemplo n.º 24
0
 private void AddRouteForm_Shown(object sender, EventArgs e)
 {
     ConfirmButton.Focus();
 }
 public string GetNameOfButtonType(ConfirmButton type)
 {
     return(type.ToString());
 }
Exemplo n.º 26
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;
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            TitleLabel.Text                  = Resources.Edit;
            BillableLabel.Text               = Resources.Billable;
            StartDateDescriptionLabel.Text   = Resources.Startdate;
            DurationDescriptionLabel.Text    = Resources.Duration;
            StartDescriptionLabel.Text       = Resources.Start;
            EndDescriptionLabel.Text         = Resources.End;
            ErrorMessageTitleLabel.Text      = Resources.Oops;
            AddProjectTaskLabel.Text         = Resources.AddProjectTask;
            CategorizeWithProjectsLabel.Text = Resources.CategorizeYourTimeWithProjects;
            AddTagsLabel.Text                = Resources.AddTags;
            DeleteButton.SetTitle(Resources.Delete, UIControlState.Normal);
            ConfirmButton.SetTitle(Resources.ConfirmChanges, UIControlState.Normal);

            prepareViews();
            prepareOnboarding();

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

            var durationCombiner            = new DurationValueCombiner();
            var dateCombiner                = new DateTimeOffsetDateFormatValueCombiner(TimeZoneInfo.Local);
            var timeCombiner                = new DateTimeOffsetTimeFormatValueCombiner(TimeZoneInfo.Local);
            var visibilityConverter         = new MvxVisibilityValueConverter();
            var invertedBoolConverter       = new BoolToConstantValueConverter <bool>(false, true);
            var inverterVisibilityConverter = new MvxInvertedVisibilityValueConverter();
            var projectTaskClientCombiner   = new ProjectTaskClientValueCombiner(
                ProjectTaskClientLabel.Font.CapHeight,
                Color.EditTimeEntry.ClientText.ToNativeColor(),
                false
                );
            var stopRunningTimeEntryAndSelectStopTimeForStoppedConverter = new BoolToConstantValueConverter <IMvxCommand>(
                ViewModel.StopCommand, ViewModel.SelectStopTimeCommand);

            var isInaccessibleTextColorConverter = new BoolToConstantValueConverter <UIColor>(
                Color.Common.Disabled.ToNativeColor(),
                Color.Common.TextColor.ToNativeColor()
                );

            var showTagsCombiner = new ShowTagsValueCombiner();

            var bindingSet = this.CreateBindingSet <EditTimeEntryViewController, EditTimeEntryViewModel>();

            //Error message view
            bindingSet.Bind(ErrorMessageLabel)
            .For(v => v.Text)
            .To(vm => vm.SyncErrorMessage);

            bindingSet.Bind(ErrorView)
            .For(v => v.BindTap())
            .To(vm => vm.DismissSyncErrorMessageCommand);

            bindingSet.Bind(ErrorView)
            .For(v => v.BindVisible())
            .To(vm => vm.SyncErrorMessageVisible)
            .WithConversion(inverterVisibilityConverter);

            //Text
            bindingSet.Bind(RemainingCharacterCount)
            .To(vm => vm.DescriptionRemainingLength);

            bindingSet.Bind(RemainingCharacterCount)
            .For(v => v.BindVisible())
            .To(vm => vm.DescriptionLimitExceeded);

            bindingSet.Bind(DescriptionTextView)
            .For(v => v.BindText())
            .To(vm => vm.Description);

            bindingSet.Bind(DescriptionTextView)
            .For(v => v.BindDidBecomeFirstResponder())
            .To(vm => vm.StartEditingDescriptionCommand);

            bindingSet.Bind(DurationLabel)
            .ByCombining(durationCombiner,
                         vm => vm.Duration,
                         vm => vm.DurationFormat);

            bindingSet.Bind(ProjectTaskClientLabel)
            .For(v => v.AttributedText)
            .ByCombining(projectTaskClientCombiner,
                         v => v.Project,
                         v => v.Task,
                         v => v.Client,
                         v => v.ProjectColor);

            bindingSet.Bind(StartDateLabel)
            .ByCombining(dateCombiner,
                         vm => vm.StartTime,
                         vm => vm.DateFormat);

            bindingSet.Bind(StartTimeLabel)
            .ByCombining(timeCombiner,
                         vm => vm.StartTime,
                         vm => vm.TimeFormat);

            bindingSet.Bind(EndTimeLabel)
            .ByCombining(timeCombiner,
                         vm => vm.StopTime,
                         vm => vm.TimeFormat);

            //Commands
            bindingSet.Bind(CloseButton).To(vm => vm.CloseCommand);
            bindingSet.Bind(DeleteButton).To(vm => vm.DeleteCommand);
            bindingSet.Bind(ConfirmButton).To(vm => vm.SaveCommand);

            bindingSet.Bind(DurationView)
            .For(v => v.BindTap())
            .To(vm => vm.SelectDurationCommand);

            bindingSet.Bind(StartTimeView)
            .For(v => v.BindTap())
            .To(vm => vm.SelectStartTimeCommand);

            bindingSet.Bind(StopButton)
            .To(vm => vm.StopCommand);

            bindingSet.Bind(EndTimeView)
            .For(v => v.BindTap())
            .To(vm => vm.IsTimeEntryRunning)
            .WithConversion(stopRunningTimeEntryAndSelectStopTimeForStoppedConverter);

            bindingSet.Bind(ProjectTaskClientLabel)
            .For(v => v.BindTap())
            .To(vm => vm.SelectProjectCommand);

            bindingSet.Bind(AddProjectAndTaskView)
            .For(v => v.BindTap())
            .To(vm => vm.SelectProjectCommand);

            bindingSet.Bind(StartDateView)
            .For(v => v.BindTap())
            .To(vm => vm.SelectStartDateCommand);

            bindingSet.Bind(TagsTextView)
            .For(v => v.BindTap())
            .To(vm => vm.SelectTagsCommand);

            bindingSet.Bind(AddTagsView)
            .For(v => v.BindTap())
            .To(vm => vm.SelectTagsCommand);

            bindingSet.Bind(BillableSwitch)
            .For(v => v.BindValueChanged())
            .To(vm => vm.ToggleBillableCommand);

            //End time and the stop button visibility
            bindingSet.Bind(StopButton)
            .For(v => v.BindVisible())
            .To(vm => vm.IsTimeEntryRunning)
            .WithConversion(inverterVisibilityConverter);

            bindingSet.Bind(EndTimeLabel)
            .For(v => v.BindVisible())
            .To(vm => vm.IsTimeEntryRunning)
            .WithConversion(visibilityConverter);

            //Project visibility
            bindingSet.Bind(AddProjectAndTaskView)
            .For(v => v.BindVisible())
            .To(vm => vm.Project)
            .WithConversion(visibilityConverter);

            bindingSet.Bind(ProjectTaskClientLabel)
            .For(v => v.BindVisible())
            .To(vm => vm.Project)
            .WithConversion(inverterVisibilityConverter);

            //Tags visibility
            bindingSet.Bind(AddTagsView)
            .For(v => v.BindVisible())
            .To(vm => vm.HasTags)
            .WithConversion(visibilityConverter);

            bindingSet.Bind(TagsTextView)
            .For(v => v.BindVisible())
            .To(vm => vm.HasTags)
            .WithConversion(inverterVisibilityConverter);

            //Confirm button enabled
            bindingSet.Bind(ConfirmButton)
            .For(v => v.Enabled)
            .To(vm => vm.DescriptionLimitExceeded)
            .WithConversion(invertedBoolConverter);

            bindingSet.Bind(ConfirmButton)
            .For(v => v.Alpha)
            .To(vm => vm.DescriptionLimitExceeded)
            .WithConversion(new BoolToConstantValueConverter <nfloat>(0.5f, 1));

            bindingSet.Bind(BillableView)
            .For(v => v.BindVisibility())
            .To(vm => vm.IsBillableAvailable)
            .WithConversion(visibilityConverter);

            //Regarding inaccessible entries
            getLabelsToChangeColorWhenEditingInaccessibleEntry().ForEach(createTextColorBindingForInaccessibleEntries);

            bindingSet.Bind(DescriptionTextView)
            .For(v => v.TextColor)
            .To(vm => vm.IsInaccessible)
            .WithConversion(isInaccessibleTextColorConverter);

            bindingSet.Bind(DescriptionTextView)
            .For(v => v.UserInteractionEnabled)
            .To(vm => vm.IsInaccessible)
            .WithConversion(invertedBoolConverter);

            bindingSet.Bind(BillableSwitch)
            .For(v => v.Enabled)
            .To(vm => vm.IsInaccessible)
            .WithConversion(invertedBoolConverter);

            bindingSet.Bind(TagsContainerView)
            .For(v => v.Hidden)
            .ByCombining(showTagsCombiner,
                         vm => vm.IsInaccessible,
                         vm => vm.HasTags)
            .WithConversion(invertedBoolConverter);

            bindingSet.Bind(TagsSeparator)
            .For(v => v.Hidden)
            .ByCombining(showTagsCombiner,
                         vm => vm.IsInaccessible,
                         vm => vm.HasTags)
            .WithConversion(invertedBoolConverter);

            bindingSet.Apply();

            void createTextColorBindingForInaccessibleEntries(UILabel label)
            {
                bindingSet.Bind(label)
                .For(v => v.TextColor)
                .To(vm => vm.IsInaccessible)
                .WithConversion(isInaccessibleTextColorConverter);
            }
        }
        /// <summary>
        /// Отображение/скрытие соответсвующих полей окна, загрузка списов из БД (если нужно)
        /// </summary>
        private void AdditionalInitializeComponent()
        {
            const Visibility show = Visibility.Visible;
            const Visibility hide = Visibility.Collapsed;

            // Отображение/скрытие полей
            PeriodWrapperGrid.Visibility                           = _isPeriod ? show : hide;
            MonthOrYearWrapperGrid.Visibility                      = _isMonthOrYear ? show : hide;
            DateWrapperGrid.Visibility                             = _isDate ? show : hide;
            DatePeriodWrapperGrid.Visibility                       = _isDatePeriod ? show : hide;
            KoefTWrapperGrid.Visibility                            = _isKoefT ? show : hide;
            KoefZWrapperGrid.Visibility                            = _isKoefZ ? show : hide;
            CehWrapperGrid.Visibility                              = _isWorkGuild ? show : hide;
            AreaWrapperGrid.Visibility                             = _isArea ? show : hide;
            WorkGuildSpecifiedOrAllWrapperGrid.Visibility          = _isWorkGuildSpecifiedOrAll ? show : hide;
            ProductWrapperGrid.Visibility                          = _isProduct ? show : hide;
            DetailWrapperGrid.Visibility                           = _isDetail ? show : hide;
            ProductSpecifiedOrAllWrapperGrid.Visibility            = _isProductSpecifiedOrAll ? show : hide;
            AssemblyUnitWrapperGrid.Visibility                     = _isAssemblyUnit ? show : hide;
            MonthYearWrapperGrid.Visibility                        = _isMonthYear ? show : hide;
            TimeFundWrapperGrid.Visibility                         = _isTimeFund ? show : hide;
            ProcentageOfLossTimeWrapperGrid.Visibility             = _isProcentageOfLossTime ? show : hide;
            ProcentageOfPerformanceStandartsWrapperGrid.Visibility = _isProcentageOfPerformanceStandarts ? show : hide;
            AreaSpecifiedOrAllWrapperGrid.Visibility               = _isAreaSpecifiedOrAll ? show : hide;

            MessageLabel.Content = _hintMessage;

            // Если вводится [Дата] - значение по-умолчанию сегодняшняя
            if (_isDate)
            {
                DatePicker.SelectedDate = DateTime.Today;
            }

            if (_isWorkGuild)
            {
                try
                {
                    WorkGuildsComboBox.ItemsSource = WorkGuildsService.GetAll();
                }
                catch (StorageException ex)
                {
                    Common.ShowDetailExceptionMessage(ex);
                }
            }

            // Если вводится [Изделие] - загрузка списка из БД и заполнение Textbox
            if (_isProductSpecifiedOrAll)
            {
                try
                {
                    _searchProductStorage             = ProductsService.GetProducts();
                    SearchProductDataGrid.ItemsSource = _searchProductStorage;
                }
                catch (StorageException ex)
                {
                    Common.ShowDetailExceptionMessage(ex);
                    return;
                }
                ProductAllRadioButton.IsChecked = true;
            }

            // Если вводится [Цех] - загрузка списка из БД и заполнение ComboBox
            if (_isWorkGuildSpecifiedOrAll)
            {
                try
                {
                    WorkguildSpecifiedComboBox.ItemsSource = WorkGuildsService.GetAll();
                }
                catch (StorageException ex)
                {
                    Common.ShowDetailExceptionMessage(ex);
                    return;
                }
                WorkguildAllRadioButton.IsChecked = true;
            }

            // Если вводится [Участок] - загрузка списка из БД и заполнение ComboBox
            if (_isAreaSpecifiedOrAll)
            {
                try
                {
                    AreaSpecifiedComboBox.ItemsSource = AreasService.GetAll();
                }
                catch (StorageException ex)
                {
                    Common.ShowDetailExceptionMessage(ex);
                    return;
                }

                AreaAllRadioButton.IsChecked = true;
            }

            if (_isArea)
            {
                try
                {
                    AreaComboBox.ItemsSource = AreasService.GetAll();
                }
                catch (StorageException ex)
                {
                    Common.ShowDetailExceptionMessage(ex);
                }
            }

            // Если вводится [Изделие] - загрузка списка из БД и заполнение Textbox
            if (_isProduct)
            {
                try
                {
                    _searchProductStorage             = ProductsService.GetProducts();
                    SearchProductDataGrid.ItemsSource = _searchProductStorage;
                }
                catch (StorageException ex)
                {
                    Common.ShowDetailExceptionMessage(ex);
                }
            }

            // Если вводится [Деталь] - загрузка списка из БД и заполнение Textbox
            if (_isDetail)
            {
                try
                {
                    _searchDetailStorage             = DetailsService.GetAll();
                    SearchDetailDataGrid.ItemsSource = _searchDetailStorage;
                }
                catch (StorageException ex)
                {
                    Common.ShowDetailExceptionMessage(ex);
                }
            }

            // Если вводится [Сборочноя еденица] - загрузка списка из БД и заполнение Textbox
            if (_isAssemblyUnit)
            {
                try
                {
                    _searchProductStorage = ProductsService.GetAssemblyUnits();
                    SearchAssemblyUnitDataGrid.ItemsSource = _searchProductStorage;
                }
                catch (StorageException ex)
                {
                    Common.ShowDetailExceptionMessage(ex);
                }
            }

            // Если вводится [Месяц/Год] - получение Dictionary месяцев и заполнение ComboBox, год текущий
            // ReSharper disable once InvertIf
            if (_isMonthYear)
            {
                const int monthOffset = 1;
                var       today       = DateTime.Today;
                MonthComboBox.ItemsSource   = Common.MonthsFullNames();
                MonthComboBox.SelectedIndex = today.Month - monthOffset;
                YearIntegerUpDown.Value     = today.Year;
            }

            ConfirmButton.Focus();
        }
Exemplo n.º 29
0
 private void PopupWithTwoButtonsLoaded(object sender, RoutedEventArgs e)
 {
     ConfirmButton.Focus(FocusState.Pointer);
 }
Exemplo n.º 30
0
 public override void Initialize()
 {
     Pane imgPane = RootContext.CreateWidget<Pane>(this);
     fu = RootContext.CreateWidget<FileUpload>(this);
     unsetButton = RootContext.CreateWidget<ConfirmButton>(this);
     unsetButton.Label = "remove image";
     unsetButton.OnConfirm += new EventHandler<ClickEventArgs>( delegate( object sender, ClickEventArgs ea ) {
         img.Visible = false;
         SavePath = null;
         HttpPostedFile = null;
         OnImageUploaded( this, null );
         unsetButton.Visible = false;
     });
     if( string.IsNullOrEmpty( SavePath ) )
         unsetButton.Visible = false;
     fu.OnFileUploaded += new EventHandler( fileUploaded );
     imgPane.ClassName = "Preview";
     img = RootContext.CreateWidget<Image>(imgPane);
     if( ! string.IsNullOrEmpty( SavePath ) )
         img.Url = SavePath + "?" + (uid ?? Util.ConvertToBase32(DateTime.UtcNow.Ticks));
     else
         img.Visible = false;
     //imgPane.SetClientElementAttribute("align", Util.ToJavaScriptString("center") );
     ClassName = "ImageUpload";
 }
Exemplo n.º 31
0
 public void ClickOnConfirmButton()
 {
     ConfirmButton.Click();
 }
Exemplo n.º 32
0
 public IndexPage click_confirm()
 {
     ConfirmButton.Click();
     return(new IndexPage(_driver));
 }