Esempio n. 1
0
        public MembersInSafe()
        {
            InitializeComponent();

            // Подключаем шрифты
            UseFonts();

            // Риссуем форму
            FormStyleTwo.PaintForm(this);

            this.Activated += (f, a) =>
            {
                // Заполняем список участников
                membersList.Clear();
                listView1.Items.Clear();
                membersList = DateBase.GetListMembersInSafe((this.Owner as Main).activeSafe.SafeID);

                // Если пользователь не создатель сейфа
                if ((this.Owner as Main).activeSafe.Creator != Properties.Settings.Default.userEmail)
                {
                    leave.Visible = false;
                }

                foreach (var item in membersList)
                {
                    var list = new ListViewItem(item.MemberID.ToString());
                    list.SubItems.Add(item.Email);
                    list.ForeColor = Color.White;

                    listView1.Items.Add(list);
                }
            };
        }
Esempio n. 2
0
        /// <summary>
        /// Конструктор
        /// </summary>
        public EditSafe(Safe safe)
        {
            InitializeComponent();

            // Подключаем шрифты
            UseFonts();

            // Риссуем форму
            FormStyleTwo.PaintForm(this);

            // Событие при наведении на кнопки
            saveButton.MouseEnter += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(30, 215, 96);
            };
            saveButton.MouseLeave += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(29, 185, 84);
            };
            saveButton.MouseDown += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(20, 131, 59);
            };
            saveButton.MouseUp += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(29, 185, 84);
            };

            cancel.MouseEnter += (f, a) =>
            {
                cancel.Back = Color.FromArgb(30, 215, 96);
            };
            cancel.MouseLeave += (f, a) =>
            {
                cancel.Back = Color.FromArgb(29, 185, 84);
            };
            cancel.MouseDown += (f, a) =>
            {
                cancel.Back = Color.FromArgb(20, 131, 59);
            };
            cancel.MouseUp += (f, a) =>
            {
                cancel.Back = Color.FromArgb(29, 185, 84);
            };

            cancel.Click     += (f, a) => this.Close();
            saveButton.Click += (f, a) => UpdateData();

            this.Load += (f, a) =>
            {
                safeName.Text = safe.SafeName;

                for (int i = 1; i <= safe.Fields.Count; i++)
                {
                    this.Controls["fieldText" + i].Text = safe.Fields[i - 1];
                }
            };
        }
Esempio n. 3
0
        public InviteForm()
        {
            InitializeComponent();

            // Подключаем шрифты
            UseFonts();

            // Риссуем форму
            FormStyleTwo.PaintForm(this);

            // Ставим плейсхолдер для имени сейфа
            Animation.Placeholder.addPlaceholder(Email, "Введите Email", Color.FromArgb(210, 210, 210), Color.FromArgb(120, 120, 120));

            invite.MouseEnter += (f, a) =>
            {
                invite.Back = Color.FromArgb(30, 215, 96);
            };
            invite.MouseLeave += (f, a) =>
            {
                invite.Back = Color.FromArgb(29, 185, 84);
            };
            invite.MouseDown += (f, a) =>
            {
                invite.Back = Color.FromArgb(20, 131, 59);
            };
            invite.MouseUp += (f, a) =>
            {
                invite.Back = Color.FromArgb(29, 185, 84);
            };

            cancel.MouseEnter += (f, a) =>
            {
                cancel.Back = Color.FromArgb(30, 215, 96);
            };
            cancel.MouseLeave += (f, a) =>
            {
                cancel.Back = Color.FromArgb(29, 185, 84);
            };
            cancel.MouseDown += (f, a) =>
            {
                cancel.Back = Color.FromArgb(20, 131, 59);
            };
            cancel.MouseUp += (f, a) =>
            {
                cancel.Back = Color.FromArgb(29, 185, 84);
            };

            cancel.Click += (f, a) =>
            {
                (this.Owner as Main).safeMenuIsOpen    = false;
                (this.Owner as Main).countOpenSafeMenu = 0;
                (this.Owner as Main).CloseSafeMenu();
                this.Close();
            };
            invite.Click += (f, a) => this.InviteInSafe((this.Owner as Main).activeSafe);
        }
Esempio n. 4
0
        /// <summary>
        /// Конструктор
        /// </summary>
        public NotificationForm()
        {
            InitializeComponent();

            // Риссуем форму
            FormStyleTwo.PaintForm(this);

            UseFonts();

            this.Activated += (f, a) => LoadNotification();
        }
Esempio n. 5
0
        public RightSideMenu()
        {
            InitializeComponent();

            this.Focus();

            // Подключаем шрифты
            UseFonts();

            // Риссуем форму
            FormStyleTwo.PaintForm(this);

            // Событие при наведении на кнопку выйти
            exit.MouseEnter += (f, a) => 
            {
                exit.ForeColor = Color.FromArgb(29, 185, 84);
            };
            exit.MouseLeave += (f, a) =>
            {
                exit.ForeColor = Color.FromArgb(120, 120, 120);
            };
            exit.MouseDown += (f, a) => 
            {
                exit.ForeColor = Color.FromArgb(70, 70, 70);
            };
            exit.MouseUp += (f, a) =>
            {
                exit.ForeColor = Color.FromArgb(29, 185, 84);
            };

            // Событие при наведении на кнопку настройки
            settings.MouseEnter += (f, a) =>
            {
                settings.ForeColor = Color.FromArgb(29, 185, 84);
            };
            settings.MouseLeave += (f, a) =>
            {
                settings.ForeColor = Color.FromArgb(120, 120, 120);
            };
            settings.MouseDown += (f, a) =>
            {
                settings.ForeColor = Color.FromArgb(70, 70, 70);
            };
            settings.MouseUp += (f, a) =>
            {
                settings.ForeColor = Color.FromArgb(29, 185, 84);
            };
        }
Esempio n. 6
0
        /// <summary>
        /// Конструктор
        /// </summary>
        public SafeMenu()
        {
            InitializeComponent();

            this.Focus();

            UseFonts();

            // Риссуем форму
            FormStyleTwo.PaintForm(this);

            this.Activated += (f, a) =>
            {
                safeID.Text = (this.Owner as Main).GetSafeID().ToString();
            };

            deleteSafe.MouseEnter += (f, a) => deleteSafe.ForeColor = Color.FromArgb(226, 33, 52);
            deleteSafe.MouseLeave += (f, a) => deleteSafe.ForeColor = Color.FromArgb(120, 120, 120);
            deleteSafe.MouseDown  += (f, a) => deleteSafe.ForeColor = Color.FromArgb(148, 19, 32);
            deleteSafe.MouseUp    += (f, a) => deleteSafe.ForeColor = Color.FromArgb(226, 33, 52);

            editSafe.MouseEnter += (f, a) =>
            {
                editSafe.ForeColor = Color.FromArgb(29, 185, 84);
            };
            editSafe.MouseLeave += (f, a) =>
            {
                editSafe.ForeColor = Color.FromArgb(120, 120, 120);
            };
            editSafe.MouseDown += (f, a) =>
            {
                editSafe.ForeColor = Color.FromArgb(70, 70, 70);
            };
            editSafe.MouseUp += (f, a) =>
            {
                editSafe.ForeColor = Color.FromArgb(29, 185, 84);
            };

            inviteToSafe.MouseEnter += (f, a) =>
            {
                inviteToSafe.ForeColor = Color.FromArgb(29, 185, 84);
            };
            inviteToSafe.MouseLeave += (f, a) =>
            {
                inviteToSafe.ForeColor = Color.FromArgb(120, 120, 120);
            };
            inviteToSafe.MouseDown += (f, a) =>
            {
                inviteToSafe.ForeColor = Color.FromArgb(70, 70, 70);
            };
            inviteToSafe.MouseUp += (f, a) =>
            {
                inviteToSafe.ForeColor = Color.FromArgb(29, 185, 84);
            };

            this.Activated += (f, a) =>
            {
                foreach (var item in this.Controls)
                {
                    if (item is Label)
                    {
                        (item as Label).ForeColor = Color.FromArgb(120, 120, 120);
                    }
                }
            };

            deleteSafe.Click += (f, a) =>
            {
                (this.Owner as Main).DeleteSafe((this.Owner as Main).activeSafe);
                (this.Owner as Main).safeMenuIsOpen    = false;
                (this.Owner as Main).countOpenSafeMenu = 0;
                this.Hide();
            };
            editSafe.Click += (f, a) =>
            {
                (this.Owner as Main).OpenEditSafeMenu((this.Owner as Main).activeSafe);
            };
            inviteToSafe.Click += (f, a) =>
            {
                (this.Owner as Main).OpenInviteForm();
            };
        }
Esempio n. 7
0
 // Событие при загрузке формы
 private void CreateSafeForm_Load(object sender, EventArgs e)
 {
     // Рисуем форму
     FormStyleTwo.PaintForm(this);
 }
Esempio n. 8
0
        // Конструктор
        public CreateSafeForm()
        {
            InitializeComponent();

            // Подключаем шрифты
            UseFonts();

            // Риссуем форму
            FormStyleTwo.PaintForm(this);

            // Событие при клике на данную форму
            this.Click += (f, a) => logoLabel.Focus();

            // Событие при изменении размеров формы
            this.Resize += (f, a) =>
            {
                this.Location = new Point(this.Location.X,
                                          (this.Owner as Main).Location.Y + (this.Owner as Main).Height / 2 - this.Height / 2);
            };

            // Событие при наведении на кнопки
            saveButton.MouseEnter += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(30, 215, 96);
            };
            saveButton.MouseLeave += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(29, 185, 84);
            };
            saveButton.MouseDown += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(20, 131, 59);
            };
            saveButton.MouseUp += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(29, 185, 84);
            };

            cancel.MouseEnter += (f, a) =>
            {
                cancel.Back = Color.FromArgb(30, 215, 96);
            };
            cancel.MouseLeave += (f, a) =>
            {
                cancel.Back = Color.FromArgb(29, 185, 84);
            };
            cancel.MouseDown += (f, a) =>
            {
                cancel.Back = Color.FromArgb(20, 131, 59);
            };
            cancel.MouseUp += (f, a) =>
            {
                cancel.Back = Color.FromArgb(29, 185, 84);
            };

            // Ставим плейсхолдер для имени сейфа
            Animation.Placeholder.addPlaceholder(safeName, "Название", Color.FromArgb(210, 210, 210), Color.FromArgb(120, 120, 120));

            // Ставим плейсхолдеры для полей
            Animation.Placeholder.addPlaceholder(fieldText1, "Поле", Color.FromArgb(210, 210, 210), Color.FromArgb(120, 120, 120));
            Animation.Placeholder.addPlaceholder(fieldText2, "Поле", Color.FromArgb(210, 210, 210), Color.FromArgb(120, 120, 120));
            Animation.Placeholder.addPlaceholder(fieldText3, "Поле", Color.FromArgb(210, 210, 210), Color.FromArgb(120, 120, 120));
            Animation.Placeholder.addPlaceholder(fieldText4, "Поле", Color.FromArgb(210, 210, 210), Color.FromArgb(120, 120, 120));
            Animation.Placeholder.addPlaceholder(fieldText5, "Поле", Color.FromArgb(210, 210, 210), Color.FromArgb(120, 120, 120));
            Animation.Placeholder.addPlaceholder(fieldText6, "Поле", Color.FromArgb(210, 210, 210), Color.FromArgb(120, 120, 120));

            // Событие при получении и потере фокуса
            safeName.Enter += (f, a) =>
            {
                safeName.Focus();
                safeNameSeparator.BackColor = Color.FromArgb(65, 65, 65);
            };
            safeName.Leave += (f, a) =>
            {
                safeNameSeparator.BackColor = Color.FromArgb(40, 40, 40);
            };

            // Событие, строиящие визуал кнопки добавить поле
            addField.MouseEnter += (f, a) =>
            {
                addField.ForeColor = Color.FromArgb(29, 185, 84);
                addFieldIcon.Image = Properties.Resources.addFieldGreen;
            };
            addField.MouseLeave += (f, a) =>
            {
                addField.ForeColor = Color.FromArgb(120, 120, 120);
                addFieldIcon.Image = Properties.Resources.addFieldGray;
            };
            addFieldIcon.MouseEnter += (f, a) =>
            {
                addField.ForeColor = Color.FromArgb(29, 185, 84);
                addFieldIcon.Image = Properties.Resources.addFieldGreen;
            };
            addFieldIcon.MouseLeave += (f, a) =>
            {
                addField.ForeColor = Color.FromArgb(120, 120, 120);
                addFieldIcon.Image = Properties.Resources.addFieldGray;
            };
            addField.MouseDown += (f, a) =>
            {
                addField.ForeColor = Color.FromArgb(70, 70, 70);
                addFieldIcon.Image = Properties.Resources.addFieldDarkGray;
            };
            addField.MouseUp += (f, a) =>
            {
                addField.ForeColor = Color.FromArgb(29, 185, 84);
                addFieldIcon.Image = Properties.Resources.addFieldGreen;
            };
            addFieldIcon.MouseDown += (f, a) =>
            {
                addField.ForeColor = Color.FromArgb(70, 70, 70);
                addFieldIcon.Image = Properties.Resources.addFieldDarkGray;
            };
            addFieldIcon.MouseUp += (f, a) =>
            {
                addField.ForeColor = Color.FromArgb(29, 185, 84);
                addFieldIcon.Image = Properties.Resources.addFieldGreen;
            };

            // Событие клика по "Добавить поле"
            addField.Click     += (f, a) => createField();
            addFieldIcon.Click += (f, a) => createField();


            // Событие, строиящие визуал кнопки удалить поле
            removeField.MouseEnter += (f, a) =>
            {
                removeField.ForeColor = Color.FromArgb(29, 185, 84);
                removeFieldIcon.Image = Properties.Resources.removeFieldGreen;
            };
            removeField.MouseLeave += (f, a) =>
            {
                removeField.ForeColor = Color.FromArgb(120, 120, 120);
                removeFieldIcon.Image = Properties.Resources.removeFieldGray;
            };
            removeFieldIcon.MouseEnter += (f, a) =>
            {
                removeField.ForeColor = Color.FromArgb(29, 185, 84);
                removeFieldIcon.Image = Properties.Resources.removeFieldGreen;
            };
            removeFieldIcon.MouseLeave += (f, a) =>
            {
                removeField.ForeColor = Color.FromArgb(120, 120, 120);
                removeFieldIcon.Image = Properties.Resources.removeFieldGray;
            };
            removeField.MouseDown += (f, a) =>
            {
                removeField.ForeColor = Color.FromArgb(70, 70, 70);
                removeFieldIcon.Image = Properties.Resources.removeFieldDarkGray;
            };
            removeField.MouseUp += (f, a) =>
            {
                removeField.ForeColor = Color.FromArgb(29, 185, 84);
                removeFieldIcon.Image = Properties.Resources.removeFieldGreen;
            };
            removeFieldIcon.MouseDown += (f, a) =>
            {
                removeField.ForeColor = Color.FromArgb(70, 70, 70);
                removeFieldIcon.Image = Properties.Resources.removeFieldDarkGray;
            };
            removeFieldIcon.MouseUp += (f, a) =>
            {
                removeField.ForeColor = Color.FromArgb(29, 185, 84);
                removeFieldIcon.Image = Properties.Resources.removeFieldGreen;
            };

            // Событие при клике по "Удалить поле"
            removeField.Click     += (f, a) => hideField();
            removeFieldIcon.Click += (f, a) => hideField();


            // Событие изменения текста на полях категории
            // Используется при добавлении полей
            fieldText1.TextChanged += (f, a) =>
            {
                if (fieldText1.Text != "Поле" && fieldText1.Text != string.Empty)
                {
                    addField.Visible     = true;
                    addFieldIcon.Visible = true;
                }
                else
                {
                    addField.Visible     = false;
                    addFieldIcon.Visible = false;
                }
            };
            fieldText2.TextChanged += (f, a) =>
            {
                if (fieldText2.Text != "Поле" && fieldText2.Text != string.Empty)
                {
                    addField.Visible     = true;
                    addFieldIcon.Visible = true;
                }
                else
                {
                    addField.Visible     = false;
                    addFieldIcon.Visible = false;
                }
            };
            fieldText3.TextChanged += (f, a) =>
            {
                if (fieldText3.Text != "Поле" && fieldText3.Text != string.Empty)
                {
                    addField.Visible     = true;
                    addFieldIcon.Visible = true;
                }
                else
                {
                    addField.Visible     = false;
                    addFieldIcon.Visible = false;
                }
            };
            fieldText4.TextChanged += (f, a) =>
            {
                if (fieldText4.Text != "Поле" && fieldText4.Text != string.Empty)
                {
                    addField.Visible     = true;
                    addFieldIcon.Visible = true;
                }
                else
                {
                    addField.Visible     = false;
                    addFieldIcon.Visible = false;
                }
            };
            fieldText5.TextChanged += (f, a) =>
            {
                if (fieldText5.Text != "Поле" && fieldText5.Text != string.Empty)
                {
                    addField.Visible     = true;
                    addFieldIcon.Visible = true;
                }
                else
                {
                    addField.Visible     = false;
                    addFieldIcon.Visible = false;
                }
            };
        }
Esempio n. 9
0
        public AddItem(List <string> Field)
        {
            InitializeComponent();

            // Подключаем шрифты
            UseFonts();

            // Риссуем форму
            FormStyleTwo.PaintForm(this);

            // Событие при наведении на кнопки
            saveButton.MouseEnter += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(30, 215, 96);
            };
            saveButton.MouseLeave += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(29, 185, 84);
            };
            saveButton.MouseDown += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(20, 131, 59);
            };
            saveButton.MouseUp += (f, a) =>
            {
                saveButton.Back = Color.FromArgb(29, 185, 84);
            };

            cancel.MouseEnter += (f, a) =>
            {
                cancel.Back = Color.FromArgb(30, 215, 96);
            };
            cancel.MouseLeave += (f, a) =>
            {
                cancel.Back = Color.FromArgb(29, 185, 84);
            };
            cancel.MouseDown += (f, a) =>
            {
                cancel.Back = Color.FromArgb(20, 131, 59);
            };
            cancel.MouseUp += (f, a) =>
            {
                cancel.Back = Color.FromArgb(29, 185, 84);
            };

            cancel.Click += (f, a) => this.Close();

            this.Load += (f, a) =>
            {
                int index = 0;
                foreach (var item in Field)
                {
                    this.Controls["fieldText" + (index + 1)].Text    = item;
                    this.Controls["fieldText" + (index + 1)].Visible = true;
                    this.Controls["separator" + (index + 1)].Visible = true;
                    this.Height += 40;
                    index++;
                }
            };

            saveButton.Click += (f, a) =>
            {
                int           index      = 0;
                bool          result     = true;
                List <string> rightField = new List <string>();

                foreach (var item in this.Controls)
                {
                    if (item is TextBox)
                    {
                        if ((item as TextBox).Visible)
                        {
                            if ((item as TextBox).Text == string.Empty || (item as TextBox).Text == Field[index])
                            {
                                result = false;
                            }

                            index++;
                        }
                    }
                }

                rightField.Add(fieldText1.Visible ? fieldText1.Text : string.Empty);
                rightField.Add(fieldText2.Visible ? fieldText2.Text : string.Empty);
                rightField.Add(fieldText3.Visible ? fieldText3.Text : string.Empty);
                rightField.Add(fieldText4.Visible ? fieldText4.Text : string.Empty);
                rightField.Add(fieldText5.Visible ? fieldText5.Text : string.Empty);
                rightField.Add(fieldText6.Visible ? fieldText6.Text : string.Empty);

                if (!result)
                {
                    ShowError("Заполните поля");
                }
                else
                {
                    //rightField.OrderBy(n => n);
                    (this.Owner as Main).CreateItem(new WorkingScripts.Item(Properties.Settings.Default.userEmail, rightField));
                    this.Close();
                }
            };
        }
Esempio n. 10
0
 private void AddFolder_Load(object sender, EventArgs e)
 {
     // Рисуем форму
     FormStyleTwo.PaintForm(this);
 }