Beispiel #1
0
        private void DeleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedItem != null)
            {
                ITransformable itemToDelete = (ITransformable)SelectedItem;
                foreach (ITransformable item in Items)
                {
                    if (item == SelectedItem)
                    {
                        itemToDelete = item;
                        break;
                    }
                }
                if (SelectedItem.GetType().Name == "GroupOfItems")
                {
                    this.groupOfItems = null;
                }

                Items.Remove(itemToDelete);
                graphicsProcessor.SelectedItem = null;
                SelectedItem = null;

                this.CustomRefresh();
            }
        }
Beispiel #2
0
 private void NewToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.Items               = new List <ITransformable>();
     this.SelectedItem        = null;
     this.groupOfItems        = null;
     this.copied              = null;
     graphicsProcessor        = new GraphicsProcessor(HelpSelectedItem);
     openFileDialog1.FileName = String.Empty;
     saveFileDialog1.FileName = String.Empty;
     this.CustomRefresh();
 }
        private int AddSwitchTab(int iterator, GroupOfItems group)
        {
            SwitchTab.ColumnDefinitions.Add(new ColumnDefinition());
            var tapGestureRecognizer = new TapGestureRecognizer();

            tapGestureRecognizer.Tapped += (s, e) =>
            {
                UpdateGrid(group.Items);
            };
            group.Image.GestureRecognizers.Add(tapGestureRecognizer);
            SwitchTab.Children.Add(group.Image, iterator++, 0);
            return(iterator);
        }
Beispiel #4
0
        void Ok_clicked(object sender, EventArgs e)
        {
            if (image.Source == null)
            {
                return;
            }
            var item = new GroupOfItems {
                Image = new Image {
                    Source = image.Source
                }, Title = TextField.Text
            };

            DisplayAlert("Dodano Grupe!", "Prawdopodobnie prawidłowo dodano grupe", "OK");
            MessagingCenter.Send(this, "AddGroup", item);
        }
Beispiel #5
0
        private void BreakToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SelectedItem != null && SelectedItem.GetType().Name == "GroupOfItems")
            {
                GroupOfItems tempGroup = (GroupOfItems)SelectedItem;

                this.Items.Remove(tempGroup);
                SelectedItem = null;

                foreach (ITransformable item in tempGroup.Items)
                {
                    this.Items.Add(item);
                }
                this.graphicsProcessor.SelectedItem = this.Items.Last();
                this.groupOfItems = null;
                this.CustomRefresh();
            }
        }
Beispiel #6
0
        private void OpenFileDialog1_FileOk(object sender, CancelEventArgs e)
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read, FileShare.None);

            Items = (List <ITransformable>)formatter.Deserialize(stream);
            foreach (ITransformable item in this.Items)
            {
                if (item.GetType().Name == "GroupOfItems")
                {
                    this.groupOfItems = (GroupOfItems)item;
                }
            }
            stream.Close();

            ToggleSelection          = 1;
            SelectedItem             = null;
            graphicsProcessor        = new GraphicsProcessor(HelpSelectedItem);
            saveFileDialog1.FileName = openFileDialog1.FileName;
            this.CustomRefresh();
        }