Esempio n. 1
0
 void Start()
 {
     sizeX = Screen.width/12;
     sizeY = Screen.height;
     m = GetComponent<Music>();
     pb = GetComponent<PauseButton>();
     sb = GetComponent<SaveButton>();
     m.sizeX = pb.sizeX = sb.sizeX = sizeX;
     m.sizeY = pb.sizeY = sb.sizeY = sizeY/5;
     m.offsetX = pb.offsetX = sb.offsetX = 10;
     sb.offsetY = 10 + sizeY/5;
     pb.offsetY = 20 + sizeY/5*2;
     m.offsetY = 30 + sizeY/5*3;
 }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Details);

            // Retrieve navigation parameter and set as current "DataContext"
            Vm = GlobalNavigation.GetAndRemoveParameter <FlowerViewModel>(Intent);

            var headerView = LayoutInflater.Inflate(Resource.Layout.CommentsListHeaderView, null);

            _nameText = headerView.FindViewById <TextView>(Resource.Id.NameText);

            _bindings.Add(
                this.SetBinding(
                    () => Vm.Model.Name,
                    () => _nameText.Text));

            _bindings.Add(
                this.SetBinding(
                    () => Vm.Model.Name,
                    () => EditNameText.Text,
                    BindingMode.TwoWay));

            headerView.FindViewById <TextView>(Resource.Id.DescriptionText).Text
                = Vm.Model.Description;

            CommentsList.AddHeaderView(headerView);
            CommentsList.Adapter = Vm.Model.Comments.GetAdapter(GetCommentTemplate);

            ImageDownloader.AssignImageAsync(FlowerImageView, Vm.Model.Image, this);

            AddCommentButton.SetCommand(Vm.AddCommentCommand);
            EditNameButton.Click += EditNameButtonClick;
            SaveButton.SetCommand(Vm.SaveFlowerCommand);

            // Subscribing to events to avoid linker issues in release mode ---------------------------------

            // This "fools" the linker into believing that the events are used.
            // In fact we don't even subscribe to them.
            // See https://developer.xamarin.com/guides/android/advanced_topics/linking/

            if (_falseFlag)
            {
                AddCommentButton.Click += (s, e) => { };
                SaveButton.Click       += (s, e) => { };
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Override sharepoint save method.
        /// Create and temporary save a "create account request".
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CustomSaveHandler(object sender, EventArgs e)
        {
            CurrentItem[FieldsName.ResourceLibrary.InternalName.CategoryId]   = ddlCategory.SelectedValue;
            CurrentItem[FieldsName.ResourceLibrary.InternalName.CategoryName] = Utilities.GetValueByField(CurrentWeb, ListsName.InternalName.CategoryList,
                                                                                                          FieldsName.CategoryList.InternalName.CategoryID, ddlCategory.SelectedValue, "Text", FieldsName.CategoryList.InternalName.Title);
            CurrentWeb.AllowUnsafeUpdates = true;
            List <string> fileNames = new List <string>();

            if (fuImgThumb.HasFile)
            {
                var    fuThumbName = string.Format(CultureInfo.InvariantCulture, "{0}_{1}", Utilities.GetPreByTime(DateTime.Now), fuImgThumb.FileName);
                SPFile file        = Utilities.UploadFileToDocumentLibrary(CurrentWeb, fuImgThumb.PostedFile.InputStream, string.Format(CultureInfo.InvariantCulture,
                                                                                                                                        "{0}/{1}/{2}", WebUrl, ListsName.InternalName.GalleryImagesList, fuThumbName));
                CurrentItem[FieldsName.ResourceLibrary.InternalName.ImgThumb] = file.Url;
                fileNames.Add(fuImgThumb.FileName);
            }
            if (fuFileUrl.HasFile)
            {
                var    fileUrl = string.Format(CultureInfo.InvariantCulture, "{0}_{1}", Utilities.GetPreByTime(DateTime.Now), fuFileUrl.FileName);
                SPFile file    = Utilities.UploadFileToDocumentLibrary(CurrentWeb, fuFileUrl.PostedFile.InputStream, string.Format(CultureInfo.InvariantCulture,
                                                                                                                                   "{0}/{1}/{2}", WebUrl, ListsName.InternalName.GalleryImagesList, fileUrl));
                CurrentItem[FieldsName.ResourceLibrary.InternalName.FileUrl] = file.Url;
                fileNames.Add(fuFileUrl.FileName);
            }



            CurrentWeb.AllowUnsafeUpdates = true;
            SaveButton.SaveItem(SPContext.Current, false, string.Empty);
            if (fileNames.Count > 0)
            {
                foreach (var fileName in fileNames)
                {
                    try
                    {
                        CurrentWeb.AllowUnsafeUpdates = true;
                        CurrentItem.Attachments.Delete(fileName);
                    }
                    catch (Exception ex)
                    {
                        Utilities.LogToULS(ex);
                    }
                }
                CurrentWeb.AllowUnsafeUpdates = true;
                CurrentItem.SystemUpdate(false);
            }
        }
Esempio n. 4
0
        private void Form1_FormClosing(object sender, FormClosingEventArgs e) // closing SW
        {
            if (first == true)                                                // if connection still on send Stop command
            {
                sensport.Write(StpData);
            }
            Plothandle = true;
            if (LogScreen.Text != string.Empty)        // if there is data ask for save
            {
                DialogResult result1 = MessageBox.Show("Do you want to save the data before exit?", "Save Data", MessageBoxButtons.YesNo);

                if (result1 == DialogResult.Yes)
                {
                    SaveButton.PerformClick();
                }
            }
        }
Esempio n. 5
0
        private void AddFileControls()
        {
            var loadButton = new LoadButton();

            AddComponent(loadButton);
            AddControl(loadButton);

            var saveButton = new SaveButton();

            AddComponent(saveButton);
            AddControl(saveButton);

            var fileNameEditor = new FileNameEditor();

            AddComponent(fileNameEditor);
            AddTextControl(fileNameEditor);
        }
Esempio n. 6
0
 public void Common_methods()
 {
     Global.Driver.wait(5);
     //Click on the Owners tab
     ServiceSupplier.Click();
     //click MyQuote
     MyQuote.Click();
     //Edit
     EditButton.Click();
     //Text
     Text.Clear();
     //enter in text
     Text2.SendKeys(ExcelLib.ReadData(3, "TestData"));
     SaveButton.Click();
     ServiceSupplier2.Click();
     MyQuote2.Click();
 }
 public MainSearchForm()
 {
     InitializeComponent();
     TitleBoostBox.Enabled      = false;
     AuthorBoostBox.Enabled     = false;
     BibliBoostBox.Enabled      = false;
     AbstractBoostBox.Enabled   = false;
     LoadDatabaseButton.Enabled = false;
     TitleBoostBox.Text         = "1.0";
     AuthorBoostBox.Text        = "1.0";
     BibliBoostBox.Text         = "1.0";
     AbstractBoostBox.Text      = "1.0";
     PreviousButton.Hide();
     NextButton.Hide();
     SaveButton.Hide();
     DisplayItenButton.Hide();
 }
Esempio n. 8
0
    public async void SaveScene()
    {
        SaveButton.SetInteractivity(false, "Saving scene...");
        IO.Swagger.Model.SaveSceneResponse saveSceneResponse = await Base.GameManager.Instance.SaveScene();

        if (!saveSceneResponse.Result)
        {
            saveSceneResponse.Messages.ForEach(Debug.LogError);
            Notifications.Instance.ShowNotification("Scene save failed", saveSceneResponse.Messages.Count > 0 ? saveSceneResponse.Messages[0] : "Failed to save scene");
            return;
        }
        else
        {
            SaveButton.SetInteractivity(false, "There are no unsaved changes");
            UpdateBuildAndSaveBtns();
        }
    }
Esempio n. 9
0
 void ReleaseDesignerOutlets()
 {
     if (SaveButton != null)
     {
         SaveButton.Dispose();
         SaveButton = null;
     }
     if (taskNameField != null)
     {
         taskNameField.Dispose();
         taskNameField = null;
     }
     if (taskNotesField != null)
     {
         taskNotesField.Dispose();
         taskNotesField = null;
     }
 }
Esempio n. 10
0
    void Start()
    {
        heallight = GameObject.FindGameObjectWithTag("effect").GetComponent <Renderer>();
        gep       = GameObject.FindGameObjectWithTag("station").GetComponent <GiveEnergy2Player>();
        cdp       = GameObject.FindGameObjectWithTag("stationpoint").GetComponent <CalDistancePlayer>();
        cd        = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharacterData>();
        cm        = GameObject.FindGameObjectWithTag("Cha1").GetComponent <CharMove>();
        sccu      = GameObject.Find("SavingCoinCounter").GetComponent <SavingCoinCounterUI>();
        wc        = GameObject.Find("GameSaveWindow").GetComponent <WindowCol>();
        cl        = GameObject.Find("ColForStation").GetComponent <ColforLand>();
        sb        = GameObject.Find("SaveButton").GetComponent <SaveButton>();
        sctu      = GameObject.Find("CoinShooter").GetComponent <SootingCoinsToUI>();
        asct      = GameObject.Find("AddOrSubCoinsText");
        A         = GameObject.FindGameObjectWithTag("legpoint");

        v      = this.transform.position;
        callwa = true;
    }
Esempio n. 11
0
 private void RegisterCommands()
 {
     // bind the default commands to the buttons
     zoomInButton.SetCommand(Commands.IncreaseZoom, graphControl);
     zoomOutButton.SetCommand(Commands.DecreaseZoom, graphControl);
     zoom100Button.SetCommand(Commands.Zoom, 1, graphControl);
     fitContentButton.SetCommand(Commands.FitContent, graphControl);
     undoButton.SetCommand(Commands.Undo, graphControl);
     redoButton.SetCommand(Commands.Redo, graphControl);
     GroupSelectionButton.SetCommand(Commands.GroupSelection, graphControl);
     UngroupSelectionButton.SetCommand(Commands.UngroupSelection, graphControl);
     CutButton.SetCommand(Commands.Cut, graphControl);
     copyButton.SetCommand(Commands.Copy, graphControl);
     PasteButton.SetCommand(Commands.Paste, graphControl);
     openButton.SetCommand(Commands.Open, graphControl);
     SaveButton.SetCommand(Commands.SaveAs, graphControl);
     DeleteButton.SetCommand(Commands.Delete, graphControl);
 }
Esempio n. 12
0
 void ReleaseDesignerOutlets()
 {
     if (CancelButton != null)
     {
         CancelButton.Dispose();
         CancelButton = null;
     }
     if (SaveButton != null)
     {
         SaveButton.Dispose();
         SaveButton = null;
     }
     if (UrlTextField != null)
     {
         UrlTextField.Dispose();
         UrlTextField = null;
     }
 }
Esempio n. 13
0
        /// <summary>
        /// method,where webdriver comes to settings, and paste got before user name
        /// </summary>
        /// <param name="newName"></param>
        public void SettingsNickName(string newName)
        {
            Wait.Until(t => Driver.FindElements(By.XPath(Locator.SettingsSelectionPanelLocator)).Any());
            Panel = Driver.FindElement(By.XPath(Locator.SettingsSelectionPanelLocator));
            Panel.Click();

            Wait.Until(t => Driver.FindElements(By.XPath(Locator.PersonalDataButtonLocator)).Any());
            PersonalData = Driver.FindElement(By.XPath(Locator.SettingsSelectionPanelLocator));
            PersonalData.Click();

            Wait.Until(t => Driver.FindElements(By.XPath(Locator.NickNameLocator)).Any());
            NewNickName = Driver.FindElement(By.XPath(Locator.NickNameLocator));
            NewNickName.SendKeys(newName);

            Wait.Until(t => Driver.FindElements(By.XPath(Locator.SaveButtonLocator)).Any());
            SaveButton = Driver.FindElement(By.XPath(Locator.SaveButtonLocator));
            SaveButton.Click();
        }
Esempio n. 14
0
        void ReleaseDesignerOutlets()
        {
            if (CloseButton != null)
            {
                CloseButton.Dispose();
                CloseButton = null;
            }

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

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

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

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

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

            if (BottomConstraint != null)
            {
                BottomConstraint.Dispose();
                BottomConstraint = null;
            }
        }
        protected override async Task OnAppearingAnimationEndAsync()
        {
            if (!IsAnimationEnabled)
            {
                return;
            }

            var translateLength = 400u;

            await Task.WhenAll(
                HabitEntry.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                HabitEntry.FadeTo(1),
                DescriptionLabel.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                DescriptionLabel.FadeTo(1),
                DescriptionEditor.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                DescriptionEditor.FadeTo(1),
                StartPicker.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                StartPicker.FadeTo(1),
                EndPicker.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                EndPicker.FadeTo(1),
                AmountEntry.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                AmountEntry.FadeTo(1),
                UnitEntry.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                UnitEntry.FadeTo(1)

                //(new Func<Task>(async () =>
                //{
                //    await Task.Delay(300);
                //    await Task.WhenAll(
                //            //RememberCheckBox.TranslateTo(0, 0, easing: Easing.SpringOut, length: translateLength),
                //            //RememberCheckBox.FadeTo(1)
                //        );
                //}))()
                );

            await Task.WhenAll(
                EditButton.ScaleTo(1),
                EditButton.FadeTo(1),
                SaveButton.ScaleTo(1),
                SaveButton.FadeTo(1),
                DeleteButton.ScaleTo(1),
                DeleteButton.FadeTo(1)
                );
        }
Esempio n. 16
0
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();
            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            this.AddConstraints(
                FirstNameLabel.AtLeftOf(this, Theme.Dimensions.Inset2x),
                FirstNameLabel.AtTopOfSafeArea(this, Theme.Dimensions.Inset2x),
                FirstNameLabel.AtRightOf(this, Theme.Dimensions.Inset2x),
                FirstNameLabel.Height().EqualTo(Theme.Dimensions.LabelBodyHeight));
            this.AddConstraints(
                FirstName.AtLeftOf(this, Theme.Dimensions.Inset3x),
                FirstName.Below(FirstNameLabel, Theme.Dimensions.Inset1x),
                FirstName.AtRightOf(this, Theme.Dimensions.Inset2x),
                FirstName.Height().EqualTo(Theme.Dimensions.TextFieldRegularHeight));

            this.AddConstraints(
                LastNameLabel.AtLeftOf(this, Theme.Dimensions.Inset2x),
                LastNameLabel.Below(FirstName, Theme.Dimensions.Inset1x),
                LastNameLabel.AtRightOf(this, Theme.Dimensions.Inset2x),
                LastNameLabel.Height().EqualTo(Theme.Dimensions.LabelBodyHeight));
            this.AddConstraints(
                LastName.AtLeftOf(this, Theme.Dimensions.Inset3x),
                LastName.Below(LastNameLabel, Theme.Dimensions.Inset1x),
                LastName.AtRightOf(this, Theme.Dimensions.Inset2x),
                LastName.Height().EqualTo(Theme.Dimensions.TextFieldRegularHeight));

            this.AddConstraints(
                EmailLabel.AtLeftOf(this, Theme.Dimensions.Inset2x),
                EmailLabel.Below(LastName, Theme.Dimensions.Inset1x),
                EmailLabel.AtRightOf(this, Theme.Dimensions.Inset2x),
                EmailLabel.Height().EqualTo(Theme.Dimensions.LabelBodyHeight));
            this.AddConstraints(
                Email.AtLeftOf(this, Theme.Dimensions.Inset3x),
                Email.Below(EmailLabel, Theme.Dimensions.Inset1x),
                Email.AtRightOf(this, Theme.Dimensions.Inset2x),
                Email.Height().EqualTo(Theme.Dimensions.TextFieldRegularHeight));

            this.AddConstraints(
                SaveButton.Width().EqualTo(80),
                SaveButton.Below(Email, Theme.Dimensions.Inset2x),
                SaveButton.AtRightOf(this, Theme.Dimensions.Inset2x),
                SaveButton.Height().EqualTo(Theme.Dimensions.ButtonRegularHeight));
        }
Esempio n. 17
0
        void ReleaseDesignerOutlets()
        {
            if (CloseButton != null)
            {
                CloseButton.Dispose();
                CloseButton = null;
            }

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

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

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

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

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

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }
        }
Esempio n. 18
0
        public void CreateBooking(Booking bookingData)
        {
            FirstName.SendKeys(bookingData.FirstName);
            Surname.SendKeys(bookingData.Surname);
            Price.SendKeys(bookingData.Price.ToString());
            DepositPaid.SelectByText(bookingData.Deposit.ToString().ToLower());
            CheckIn.SendKeys(bookingData.CheckIn.ToString("yyyy-MM-dd"));
            CheckOut.SendKeys(bookingData.CheckOut.ToString("yyyy-MM-dd"));
            int oldBookingcount = bookingListItems.Count();

            SaveButton.Click();

            var wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(10));

            wait.Until(d =>
                       FirstName.GetAttribute("value") == "" &&
                       bookingListItems.Count() != oldBookingcount
                       );
        }
Esempio n. 19
0
 private void EditorForm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         Clipper.Terminate();
     }
     if (e.KeyCode == Keys.Z && e.Modifiers == Keys.Control && UndoToolStripButton.Enabled)
     {
         UndoToolStripButton.PerformClick();
     }
     if (e.KeyCode == Keys.C && e.Modifiers == Keys.Control)
     {
         ClipboardBbutton.PerformClick();
     }
     if (e.KeyCode == Keys.S && e.Modifiers == Keys.Control)
     {
         SaveButton.PerformClick();
     }
 }
Esempio n. 20
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem == null)
            {
                TranslationGrid.Hide();
                InformationBox.Show();
                InformationBox.Text = "this is not a valid list";
                return;
            }

            FileName = listBox1.SelectedItem.ToString();
            var wordList = WordList.LoadList(FileName);

            if (wordList == null)
            {
                return;
            }
            TranslationGrid.Show();
            AddButton.Show();
            NewListButton.Show();
            RemoveButton.Show();
            SaveButton.Show();
            PracticeButton.Show();
            AddButton.Enabled    = true;
            SaveButton.Enabled   = true;
            RemoveButton.Enabled = true;
            InformationBox.Hide();
            var languageArray = wordList.Languages;
            var sortBy        = 0;

            CountLabel.Text = $"There are {wordList.Count()} words in the list";
            TranslationGrid.Rows.Clear();
            TranslationGrid.Columns.Clear();
            TranslationGrid.Refresh();
            foreach (var languages in languageArray)
            {
                TranslationGrid.Columns.Add("newColumnName", languages.ToUpper());
            }
            TranslationGrid.Rows.Clear();

            wordList.List(sortBy, x => { TranslationGrid.Rows.Add(x); });
        }
        void ReleaseDesignerOutlets()
        {
            if (DescriptionTextField != null)
            {
                DescriptionTextField.Dispose();
                DescriptionTextField = null;
            }

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

            if (TitleTextField != null)
            {
                TitleTextField.Dispose();
                TitleTextField = null;
            }
        }
Esempio n. 22
0
        public void ChangesMade()
        {
            SaveButton.Visible    = true;
            DiscardButton.Visible = true;

            int height = MainSplit.Panel1.Height;

            PlanStructure.Height = height - PlanStructure.Top - SaveButton.Height - 8;


            if (GuiUtils.IsRunningOnMono())
            {
                // buttons aren't positioned when they aren't visible
                SaveButton.Location    = new Point(Width - 156, height - 22);
                DiscardButton.Location = new Point(Width - 86, height - 22);
            }

            SaveButton.BringToFront();
            DiscardButton.BringToFront();
        }
Esempio n. 23
0
        /// <summary>
        /// Creates the default set of editor buttons.
        /// </summary>
        /// <param name="table">A layout table.</param>
        /// <param name="row">A row, at which this textbox should be created.</param>
        protected void CreateButtons(TableLayoutPanel table, int row)
        {
            var buttonsPanel = new FlowLayoutPanel()
            {
                Anchor       = AnchorStyles.Right,
                AutoSize     = true,
                AutoSizeMode = AutoSizeMode.GrowAndShrink,
                Margin       = new Padding(Font.Height),
            };

            var saveOperationButton = new SaveButton(buttonsPanel, Font);

            saveOperationButton.Click += new EventHandler(SaveOperationButton_Click);

            var cancelOperationButton = new CancelButton(buttonsPanel, Font);

            cancelOperationButton.Click += new EventHandler(CancelButton_Click);

            table.Controls.Add(buttonsPanel, 1, row);
        }
        public void Do_survey()
        {
            var listSurvey = ListSurvey;

            foreach (var survey in listSurvey)
            {
                var surveyRadioButton = new MobileRadioButton(survey);
                surveyRadioButton.TouchNoScroll();
                ProcessButton.TouchNoScroll();

                var listQuestion = ListQuestion;
                foreach (var question in listQuestion)
                {
                    var isRadioButtonQuestion = question.FindElementsByClassName("android.widget.RadioButton").ToList();
                    var isCheckboxQuestion    = question.FindElementsByClassName("android.widget.CheckBox").ToList();
                    if (isRadioButtonQuestion.Count > 0)
                    {
                        var answerRadioButton = new MobileRadioButton(isRadioButtonQuestion.First());
                        answerRadioButton.TouchNoScroll();
                    }
                    else if (isCheckboxQuestion.Count > 0)
                    {
                        var answerCheckbox = new MobileCheckbox(isCheckboxQuestion.First());
                        answerCheckbox.Check();
                    }
                    else
                    {
                        Question = "Test Mobile Sale Order";
                    }
                }

                SaveButton.TouchNoScroll();
                using (var Alert = new AlertPage())
                {
                    Alert.Click_ok_button();
                }
            }

            Base_touch_to_button(Button.Back);
        }
        private bool SaveChanges()
        {
            SaveButton.Focus();
            video.Artist       = video.Artist.Trim();
            video.Album        = video.Album.Trim();
            video.Title        = video.Title.Trim();
            video.DownloadName = video.DownloadName.Trim();
            video.DownloadUrl  = video.DownloadUrl.Trim();
            video.BuyUrl       = video.BuyUrl.Trim();

            ErrorText.Text = "";
            if (TitleText.Text.Length == 0)
            {
                ErrorText.Text = "Title is required.";
                return(false);
            }
            if (business.IsTitleDuplicate(video))
            {
                ErrorText.Text = "Artist and title already exist in the database.";
                return(false);
            }

            // Only update EditedOn when directly editing from the Edit window.
            if (!isPopup)
            {
                video.EditedOn = DateTime.UtcNow;
            }

            ratingBusiness.UpdateChanges();
            business.Save();
            isFormSaved = true;

            // Update grid when in popup mode. Otherwise Callback is called in Window_Closing.
            if (isPopup)
            {
                callback(video);
            }

            return(true);
        }
Esempio n. 26
0
        public bool SaveSwitchSpec(string name, string description)
        {
            if (name.Length > 8 || name.Length < 1)
            {
                throw new ArgumentOutOfRangeException("name length should not greater than 8");
            }
            mainWindow.ActivateWindow();
            SaveButton.Click();
            bool result = true;

            Window.HandleModelWindow(saveWin =>
            {
                var titleText = (wi.TextBox)saveWin.Get(wi.Finders.SearchCriteria.ByAutomationId("6"));
                var descText  = (wi.TextBox)saveWin.Get(wi.Finders.SearchCriteria.ByAutomationId("5"));
                titleText.SetValue(name);
                if (description.Length != 0)
                {
                    descText.SetValue(description);
                }
                saveWin.ClickOK();
                return(true);
            });
            Window.HandleModelWindow(w =>
            {
                var desc = w.Get(wi.Finders.SearchCriteria.ByControlType(ControlType.Text));
                Console.WriteLine(desc.Name);
                if (desc.Name.Contains("Exists"))
                {
                    w.Get(wi.Finders.SearchCriteria.ByText("是(Y)")).Click();
                    result = true;
                }
                else if (desc.Name.Contains("Missing"))
                {
                    w.Close();
                    result = false;
                }
                return(true);
            });
            return(result);
        }
        private bool SaveChanges()
        {
            SaveButton.Focus();
            video.Artist       = video.Artist.Trim();
            video.Album        = video.Album.Trim();
            video.Title        = video.Title.Trim();
            video.DownloadName = video.DownloadName.Trim();
            video.DownloadUrl  = video.DownloadUrl.Trim();
            video.BuyUrl       = video.BuyUrl.Trim();

            ErrorText.Text = "";
            if (TitleText.Text.Length == 0)
            {
                ErrorText.Text = "Title is required.";
                return(false);
            }
            if (business.IsTitleDuplicate(video))
            {
                ErrorText.Text = "Artist and title already exist in the database.";
                return(false);
            }

            if (!isUrlValid && StartDownloadCheckBox.IsChecked == true)
            {
                ErrorText.Text = "Please enter a valid URL";
                return(false);
            }

            if (SessionCore.Instance.Business.DownloadManager.IsDownloadDuplicate(video.DownloadUrl))
            {
                ErrorText.Text = "You are already downloading this video.";
                return(false);
            }

            video.EditedOn = DateTime.UtcNow;
            business.Save();

            return(true);
        }
        public void EditReservationSelecting3Seats(int userId)
        {
            //Get user e-mail needed for Reservation button locator
            var currentUser = _userRepository.GetUserById(userId);
            _userEmail = currentUser.Email.ToString();

            Navigate();
            EditUserReservationButton.Click();

            //Get screening id for current user's reservation for Date drop-down menu locator
            var currentScreening = _screeningRepository.GetScreeningById(_returnedScreeningId);
            _userScreeningDate = currentScreening.DateTime.ToString("dd.MM.yyyy");

            DateDropDownMenu.Click();

            //Set time for Time drop-down menu locator
            _userScreeningTime = currentScreening.DateTime.ToString("HH:mm:ss");
            TimeDropDownMenu.Click();

            Select3Seats.Click();
            SaveButton.Click();
        }
Esempio n. 29
0
    public static bool setSaveButton(SaveButton toSet)
    {
        bool savedInSlot = true;

        if (File.Exists(Application.dataPath + "/savedGame" + toSet.slotNumber.ToString() + ".gd"))
        {
            SavedState state = Load(toSet.slotNumber);
            toSet.Title.enabled = false;
            toSet.Date.enabled  = true;
            toSet.Level.enabled = true;
            toSet.Date.text     = state.date;
            toSet.Level.text    = "Level " + state.level.ToString();
        }
        else
        {
            savedInSlot         = false;
            toSet.Title.enabled = true;
            toSet.Date.enabled  = false;
            toSet.Level.enabled = false;
        }
        return(savedInSlot);
    }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var tableViewSource = new SelectTagsTableViewSource(TagsTableView);

            tableViewSource.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectTag.Inputs)
            .DisposedBy(DisposeBag);

            ViewModel.Tags
            .Subscribe(TagsTableView.Rx().ReloadItems(tableViewSource))
            .DisposedBy(DisposeBag);

            ViewModel.IsEmpty
            .Subscribe(EmptyStateImage.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.IsEmpty
            .Subscribe(EmptyStateLabel.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.FilterText
            .Subscribe(TextField.Rx().TextObserver())
            .DisposedBy(DisposeBag);

            CloseButton.Rx()
            .BindAction(ViewModel.Close)
            .DisposedBy(DisposeBag);

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

            TextField.Rx().Text()
            .Subscribe(ViewModel.FilterText)
            .DisposedBy(DisposeBag);
        }
Esempio n. 31
0
        void ReleaseDesignerOutlets()
        {
            if (TitleText != null)
            {
                TitleText.Dispose();
                TitleText = null;
            }

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

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

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

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

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