void ReleaseDesignerOutlets()
        {
            if (FlowerImage != null)
            {
                FlowerImage.Dispose();
                FlowerImage = null;
            }

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

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

            if (SeeCommentsButton != null)
            {
                SeeCommentsButton.Dispose();
                SeeCommentsButton = null;
            }
        }
Пример #2
0
 private void NameText_Enter(object sender, EventArgs e)
 {
     BeginInvoke((Action) delegate
     {
         NameText.SelectAll();
     });
 }
Пример #3
0
        public FeatDialog(Context context, Feat editFeat) : base(context)
        {
            feat = (Feat)editFeat.Clone();

            RequestWindowFeature((int)WindowFeatures.NoTitle);

            SetContentView(Resource.Layout.FeatDialog);
            SetCanceledOnTouchOutside(true);

            OKButton.Click += (sender, e) =>
            {
                Dismiss();
                FeatComplete?.Invoke(this, feat);
            };

            CancelButton.Click += (sender, e) =>
            {
                Dismiss();
            };

            NameText.AttachEditTextString(feat, "Name");
            TypesButton.AttachButtonStringList(feat, "Type", new List <string>(Feat.FeatTypes));
            PrerequisitesText.AttachEditTextString(feat, "Prerequistites");
            BenefitText.AttachEditTextString(feat, "Benefit");
            NormalText.AttachEditTextString(feat, "Normal");
            SpecialText.AttachEditTextString(feat, "Special");

            feat.PropertyChanged += Feat_PropertyChanged;

            EnableOK();
        }
Пример #4
0
        private void AddPart_Click(object sender, RoutedEventArgs e)
        {
            noError = true;
            string[] Data = new string[4];
            Data[0] = SerialNumberText.GetLineText(0);
            Data[1] = VINText.GetLineText(0);
            Data[2] = NameText.GetLineText(0);
            Data[3] = ManufacturerText.GetLineText(0);

            MakePart P = new MakePart(Data, cn);

            try
            {
                P.CreatePart();
            }
            catch (OleDbException ex)
            {
                noError = false;
                ErrorWindow Error = new ErrorWindow(ex.Message);
                Error.ShowDialog();
            }
            if (noError)
            {
                this.Close();
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AgeText != null)
            {
                AgeText.Dispose();
                AgeText = null;
            }

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

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

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

            if (RegistratButton != null)
            {
                RegistratButton.Dispose();
                RegistratButton = null;
            }
        }
 void ReleaseDesignerOutlets()
 {
     if (CancelButton != null)
     {
         CancelButton.Dispose();
         CancelButton = null;
     }
     if (DoneSwitch != null)
     {
         DoneSwitch.Dispose();
         DoneSwitch = null;
     }
     if (ForText != null)
     {
         ForText.Dispose();
         ForText = null;
     }
     if (NameText != null)
     {
         NameText.Dispose();
         NameText = null;
     }
     if (NotesText != null)
     {
         NotesText.Dispose();
         NotesText = null;
     }
     if (SaveButton != null)
     {
         SaveButton.Dispose();
         SaveButton = null;
     }
 }
Пример #7
0
        public bool Validate()
        {
            if (ExtensionText != null && NameText != null && !NameText.EndsWith(ExtensionText))
            {
                return(false);
            }

            if (NameText != null && PathText != null && !PathText.EndsWith(NameText))
            {
                return(false);
            }

            if (PathText != null)
            {
                FsNode parent = Parent;

                // Stop before the root node
                while (parent?.Parent != null)
                {
                    if (!PathText.StartsWith(parent.PathText))
                    {
                        return(false);
                    }

                    parent = parent.Parent;
                }
            }

            return(true);
        }
Пример #8
0
        /// <summary>
        /// Получить текст
        /// </summary>
        /// <param name="nameText">Название текста</param>
        /// <param name="language">Язык</param>
        /// <returns></returns>
        public Content GetText(NameText nameText, Language language)
        {
            switch (language)
            {
            case Language.Russian:
            {
                if (RussianTextDictionary.ContainsKey(nameText))
                {
                    return(RussianTextDictionary[nameText]);
                }
            }
            break;

            case Language.English:
            {
                if (EnglishTextDictionary.ContainsKey(nameText))
                {
                    return(EnglishTextDictionary[nameText]);
                }
            }
            break;
            }
            //На случай отсутвия текста
            var defaultContent = new Content()
            {
                Text = "Not Text Dictionary"
            };

            return(defaultContent);
        }
Пример #9
0
 /// <summary>
 /// Очистка полей ввода
 /// </summary>
 private void ClearText()
 {
     NameText.Clear();
     SurnameText.Clear();
     PosText.Clear();
     BirthdayText.Clear();
     DepComboEdit.SelectedIndex = -1;
 }
Пример #10
0
        public RenameDocumentWindow(Document doc)
        {
            InitializeComponent();
            this.vm     = new RenameDocumentWindowViewModel(doc, this);
            DataContext = vm;

            NameText.Focus();
        }
Пример #11
0
        private void AddProject_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (AllPrListBox.SelectedItem.ToString() != NameText.Text)
                {
                    Customer customer = null;
                    lc.Cust = new List <Customer>();

                    lc = Serialization.Deserialze(lc);
                    foreach (var item in lc.Cust)
                    {
                        if (CustomerComboBox.SelectedItem.ToString() == item.Name)
                        {
                            customer = item;
                        }
                    }



                    Project proj = new Project(NameText.Text, Description.Text, ManagerComboBox.Text, customer, int.Parse(People.Text), int.Parse(Money.Text), Date.Text);

                    lp.Proj.Add(proj);
                    Log.logging("Добавлен проект: " + proj.Name + " " + DateTime.Now);

                    Serialization.Serialize_proj(lp);

                    lp = Serialization.Deserialze_proj(lp);

                    MessageBox.Show("Сохранено!");


                    AllPrListBox.Items.Clear();
                    foreach (var item in lp.Proj)
                    {
                        AllPrListBox.Items.Add(item.Name);
                    }
                }
                else
                {
                    MessageBox.Show("Такой проект уже существует");
                }

                AllPrListBox.SelectedItem = -1;
                NameText.Clear();
                Description.Clear();
                ManagerComboBox.SelectedIndex  = -1;
                CustomerComboBox.SelectedIndex = -1;
                People.Clear();
                Money.Clear();
                Date.Clear();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Log.logging("Ошибка: " + ex);
            }
        }
Пример #12
0
        public override void ViewDidLoad()
        {
            if (NavigationParameter == null)
            {
                throw new InvalidOperationException("No parameter found after navigation");
            }

            Vm = (FlowerViewModel)NavigationParameter;

            DescriptionText = new UILabel(new CGRect(0, 0, 300, 235))
            {
                LineBreakMode = UILineBreakMode.WordWrap,
                Lines         = 0,
            };
            Scroll.Add(DescriptionText);

            FlowerImage.SetImage(
                new NSUrl(Vm.ImageUri.AbsoluteUri),
                UIImage.FromBundle("flower_256_magenta.png"));

            this.SetBinding(
                () => Vm.Model.Name)
            .WhenSourceChanges(
                () =>
            {
                // iOS is quite primitive and requires layout recalculation when the content
                // of UI elements changes. This is a good place to do that.

                NameText.Text = Vm.Model.Name;
                NameText.SizeToFit();
                NameText.Frame = new CGRect(140, 75, 170, NameText.Bounds.Height);
            });

            this.SetBinding(
                () => Vm.Model.Description)
            .WhenSourceChanges(
                () =>
            {
                DescriptionText.Text = Vm.Model.Description;
                DescriptionText.SizeToFit();
                DescriptionText.Frame = new CGRect(
                    0,
                    0,
                    Scroll.Bounds.Width - 20,
                    DescriptionText.Bounds.Height);

                Scroll.ContentSize = new CGSize(Scroll.Bounds.Width - 20, DescriptionText.Bounds.Height + 20);
                Scroll.SetNeedsLayout();
            });

            SeeCommentsButton.TouchUpInside += (s, e) =>
            {
                var nav = ServiceLocator.Current.GetInstance <INavigationService>();
                nav.NavigateTo(AppDelegate.SeeCommentsPageKey, Vm);
            };

            base.ViewDidLoad();
        }
Пример #13
0
 private void ClearForm()
 {
     UserNameText.Clear();
     EmailText.Clear();
     NameText.Clear();
     PasswordText.Clear();
     ChangePasswordChk.Checked = false;
     ActiveChk.Checked         = false;
 }
 /// <summary>
 /// Gets the Name
 /// </summary>
 /// <returns>name</returns>
 public string GetNameAttributeValue()
 {
     NameText.Wait(2);
     if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
     {
         NameText.FakeAttributeValue = FakeText;
     }
     return(NameText.GetAttribute("value").Trim());
 }
 /// <summary>
 /// Gets the Name
 /// </summary>
 /// <returns>name</returns>
 public string GetName()
 {
     NameText.Wait(2);
     if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
     {
         NameText.Text = FakeText;
     }
     return(NameText.Text.Trim());
 }
Пример #16
0
        public override void ViewDidLoad()
        {
            View = new UniversalView();
            base.ViewDidLoad();
            InitializeComponent();

            Title = "Details";

            FlowerImage.SetImage(
                new NSUrl(Vm.ImageUri.AbsoluteUri),
                UIImage.FromBundle("flower_256_magenta.png"));

            this.SetBinding(
                () => Vm.Model.Name)
            .WhenSourceChanges(
                () =>
            {
                // iOS is quite primitive and requires layout recalculation when the content
                // of UI elements changes. This is a good place to do that.

                NameText.Text = Vm.Model.Name;
                NameText.SizeToFit();
                NameText.Frame = new CGRect(140, 75, 170, NameText.Bounds.Height);
            });

            this.SetBinding(
                () => Vm.Model.Description)
            .WhenSourceChanges(
                () =>
            {
                DescriptionText.Text = Vm.Model.Description;
                DescriptionText.SizeToFit();
                DescriptionText.Frame = new CGRect(0, 0, 300, DescriptionText.Bounds.Height);

                Scroll.ContentSize = new CGSize(300, DescriptionText.Bounds.Height);
                Scroll.SetNeedsLayout();
            });

            SeeCommentButton.Clicked += (s, e) =>
            {
                // iOS is the only framework where we decided to split the comments
                // on a different page. This is a good example that you can easily
                // have different UI experience even though the ViewModel and Model are the same

                var controller = Vm.Model.Comments.GetController(
                    CreateCommentCell,
                    BindCommentCell);
                controller.Title = "Comments";

                var addCommentButton = new UIBarButtonItem(UIBarButtonSystemItem.Add, null);
                addCommentButton.SetCommand("Clicked", Vm.AddCommentCommand);
                controller.NavigationItem.SetRightBarButtonItem(addCommentButton, false);

                AppDelegate.MainNavigationController.PushViewController(controller, true);
            };
        }
Пример #17
0
        public void Test_Name_Generation()
        {
            Sampling.SetSeedFromSystemTime();
            NameText text = new NameText();

            for (int i = 0; i < 100; i++)
            {
                Console.WriteLine(text.Create(4, 7));
            }
        }
Пример #18
0
 private void Clear_Click(object sender, RoutedEventArgs e)
 {
     NameText.Clear();
     Description.Clear();
     ManagerComboBox.SelectedIndex  = -1;
     CustomerComboBox.SelectedIndex = -1;
     People.Clear();
     Money.Clear();
     Date.Clear();
 }
Пример #19
0
 private void button1_Click(object sender, EventArgs e)
 {
     NameText.Clear();
     PhoneText.Clear();
     EmailText.Clear();
     INNText.Clear();
     ScoreText.Clear();
     AddressText.Clear();
     Close();
 }
Пример #20
0
 private void EditClientForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     NameText.Clear();
     PhoneText.Clear();
     EmailText.Clear();
     INNText.Clear();
     ScoreText.Clear();
     AddressText.Clear();
     bsToShow = null;
 }
Пример #21
0
        public void Generate_Name()
        {
            Sampling.SetSeedFromSystemTime();
            NameText text = new NameText();

            for (int i = 0; i < 50; i++)
            {
                Console.WriteLine(text.Create(4, 5));
            }
        }
Пример #22
0
        /// <summary>
        /// Returns true if the character name starts with the specified string. Case insensitive.
        /// </summary>
        public virtual bool NameStartsWith(string matchString)
        {
#if NETFX_CORE
            return(name.StartsWith(matchString, StringComparison.CurrentCultureIgnoreCase) ||
                   nameText.StartsWith(matchString, StringComparison.CurrentCultureIgnoreCase));
#else
            return(name.StartsWith(matchString, true, System.Globalization.CultureInfo.CurrentCulture) ||
                   NameText.StartsWith(matchString, true, System.Globalization.CultureInfo.CurrentCulture));
#endif
        }
 private void Return_Click(object sender, EventArgs e)
 {
     // Reset the fields
     Age.Value = 0;
     Membership.ResetText();
     FirstName.ResetText();
     Surname.ResetText();
     NameText.ResetText();
     PasswordBox.ResetText();
     m_controller.LoadView();
 }
Пример #24
0
 //move left
 private void moveLeftToolStripMenuItem_Click(object sender, EventArgs e)
 {
     save();
     if (clickedTab > 0)
     {
         //swap 2 elements
         NameText nt = ntl[clickedTab];
         ntl[clickedTab]     = ntl[clickedTab - 1];
         ntl[clickedTab - 1] = nt;
     }
     display();
 }
Пример #25
0
        private void DeleteProject_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                foreach (Project pr in lp.Proj)
                {
                    if (AllPrListBox.SelectedItem != null)
                    {
                        if (pr.Name == AllPrListBox.SelectedItem.ToString())
                        {
                            NameText.Text         = pr.Name;
                            Description.Text      = pr.Description;
                            ManagerComboBox.Text  = pr.Employee;
                            CustomerComboBox.Text = pr.Customer.Name;
                            People.Text           = pr.People.ToString();
                            Money.Text            = pr.Money.ToString();
                            Date.Text             = pr.Date.ToString();

                            Log.logging("Удален проект: " + pr.Name + " " + DateTime.Now);


                            lp.Proj.Remove(pr);
                            break;
                        }
                    }
                }
                Serialization.Serialize_proj(lp);

                AllPrListBox.Items.Clear();

                foreach (var item in lp.Proj)
                {
                    AllPrListBox.Items.Add(item.Name);
                }

                NameText.Clear();
                Description.Clear();
                ManagerComboBox.SelectedIndex  = -1;
                CustomerComboBox.SelectedIndex = -1;
                People.Clear();
                Money.Clear();
                Date.Clear();


                MessageBox.Show("Удалено!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Log.logging("Ошибка: " + ex);
            }
        }
Пример #26
0
        void ReleaseDesignerOutlets()
        {
            if (NameText != null)
            {
                NameText.Dispose();
                NameText = null;
            }

            if (StreatsText != null)
            {
                StreatsText.Dispose();
                StreatsText = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (BuscarButton != null)
            {
                BuscarButton.Dispose();
                BuscarButton = null;
            }

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

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

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

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

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

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

            if (ValidarButton != null)
            {
                ValidarButton.Dispose();
                ValidarButton = null;
            }
        }
Пример #28
0
        private void AddLeagueButton_Click(object sender, RoutedEventArgs e)
        {
            foreach (var item in Base.Leagues)
            {
                if (item.Name == NameText.Text)
                {
                    MessageBox.Show("Ошибка. Лига с таким названием уже существует!\nВведите другое название!");
                    NameText.Clear();
                    return;
                }
            }
            if (string.IsNullOrEmpty(CoText.Text) || string.IsNullOrEmpty(NameText.Text) || string.IsNullOrWhiteSpace(CoText.Text) || string.IsNullOrWhiteSpace(NameText.Text))
            {
                MessageBox.Show("Некорректный ввод. Пустая строка или введен пробел!");
                NameText.Clear();
                CoText.Clear();
                return;
            }
            League league = new League(NameText.Text, CoText.Text, _clubs: null, _logoPath: LogoText.Text);

            if (ClubsBox.SelectedIndex != 1)
            {
                var list = new List <Club>();
                for (int i = 2, j = ClubsBox.Items.Count; i < j; i++)
                {
                    CheckBox o = (CheckBox)ClubsBox.Items.GetItemAt(i);
                    if (o.IsChecked == true)
                    {
                        foreach (var it in Base.Clubs)
                        {
                            if (it.Name == (string)o.Content)
                            {
                                it.League = league;
                                Base.freeLeague.Clubs.Remove(it);
                                list.Add(it);
                                break;
                            }
                        }
                    }
                }
                league.Clubs = list;
                Base.Leagues.Add(league);
            }
            else
            {
                Base.Leagues.Add(league);
            }
            MessageBox.Show("Лига добавлена");
            DialogResult = true;
        }
Пример #29
0
        private void AddCustomerSubmit_Click(object sender, RoutedEventArgs e)
        {
            string[] Data = new string[7];
            Data[0] = IDText.GetLineText(0);
            Data[1] = NameText.GetLineText(0);
            Data[2] = PhoneText.GetLineText(0);
            Data[3] = AddressText.GetLineText(0);
            Data[4] = SexText.GetLineText(0);
            Data[5] = Data[0];
            Data[6] = TypeText.GetLineText(0);

            acc.createCustomer(Data).ShowDialog();

            this.Close();
        }
Пример #30
0
        private void UpdateBTN_Click(object sender, EventArgs e)
        {
            connect.Open();
            SqlCommand command = new SqlCommand("update Customer set CustomerID='" + CustomerIDText.Text.ToString() + "',Name='" + NameText.Text.ToString() + "',Surname='" + SurnameText.Text.ToString() + "',Address='" + AddressText.Text.ToString() + "',Telephone='" + TelephoneText.Text.ToString() + "',Email='" + EmailText.Text.ToString() + "'where CustomerID=" + CustomerID + "", connect);

            command.ExecuteNonQuery();
            connect.Close();
            viewdetails();
            CustomerIDText.Clear();
            NameText.Clear();
            SurnameText.Clear();
            AddressText.Clear();
            TelephoneText.Clear();
            EmailText.Clear();
        }