private void btnAddNew_Click(object sender, EventArgs e)
 {
     editMode = EditMode.AddNew;
     CurrentlySelectedStyle    = null;
     currentlyEditedStyle      = new style();
     groupBoxStyleList.Visible = false;
 }
 private void lvStyles_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lvStyles.SelectedItems.Count <= 0 || lvStyles.SelectedItems[0].Tag == null)
     {
         return;                                                                             //nic nie jest zaznaczone
     }
     editMode = EditMode.Edit;
     CurrentlySelectedStyle = lvStyles.SelectedItems[0].Tag as style;
 }
        private void btnCancel_Click(object sender, EventArgs e)
        {
            //wypada dać potwierdzenie
            DialogResult dialogResult = MessageBox.Show("Czy na pewno chcesz odrzucić wprowadzone zmiany?", "Potwierdzenie odrzucenia zmian", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.No)
            {
                return;
            }

            groupBoxStyleList.Visible = true;
            currentlyEditedStyle      = null;
            CurrentlySelectedStyle    = CurrentlySelectedStyle; //odswiezenie
        }
 private void DisplaySingleStyle(style c)
 {
     if (editMode != EditMode.AddNew)
     {
         currentlyEditedStyle = c;
     }
     if (c != null)
     {
         tbName.Text = c.name;
         tbID.Text   = c.id.ToString();
     }
     else
     {
         //wyswietlanie pustego koloru
         tbName.Text = "";
         tbID.Text   = "";
     }
     return;
 }
Beispiel #5
0
 private void StyleEditorWindow_insertStyle(IErrorable arg1, ICommunicative arg3, style arg2)
 {
     insertStyle(arg1, arg3, arg2);
 }
Beispiel #6
0
 private void StyleEditorWindow_removeStyle(IErrorable arg1, ICommunicative arg3, style arg2)
 {
     removeStyle(arg1, arg3, arg2);
 }
        public event Action <IErrorable, ICommunicative, style> removeStyle; //usuwa kolor. Istotne jest tylko style.id. Zwraca bool czy się udało


        #region PUBLIC
        public StyleEditor()
        {
            InitializeComponent();
            currentlySelectedStyle = null;
            currentlyEditedStyle   = new style();
        }