Пример #1
0
        public void AddPhoto(string n, WriteableBitmap photo)
        {
            LPhotoHeaderItem LP = new LPhotoHeaderItem();

            LP.TargetPhoto = photo;
            LP.TabName     = n;
            //CurrentPhoto = photo;
            TargetControl.setPhoto(photo);
            comboBoxControl.Items.Add(LP);
            comboBoxControl.SelectedItem = LP;
        }
Пример #2
0
        private void comboBoxControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            LPhotoHeaderItem ti = e.AddedItems[0] as LPhotoHeaderItem;

            if (ti != null)
            {
                if (ti.TargetPhoto != null)
                {
                    TargetControl.setPhoto(ti.TargetPhoto);
                }
            }
        }
Пример #3
0
        string getNextName()
        {
            string s = "UnNamed";

            for (int i = 0; i < 1000; i++)
            {
                LPhotoHeaderItem ti = getItem(s + i.ToString());
                if (ti == null)
                {
                    return(s + i.ToString());
                }
            }
            return(Guid.NewGuid().ToString());
        }
Пример #4
0
        public void RemovePhoto(string n)
        {
            LPhotoHeaderItem ti = getItem(n);

            if (ti != null)
            {
                comboBoxControl.Items.Remove(ti);
                comboBoxControl.SelectedItem = null;
                if (TargetControl.getPhoto() == ti.TargetPhoto)
                {
                    TargetControl.Clear();
                }
                ti.Clear();
            }
        }
Пример #5
0
        public void RemovePhoto(WriteableBitmap b)
        {
            if (b == null)
            {
                return;
            }
            LPhotoHeaderItem ti = getItem(b);

            if (ti != null)
            {
                comboBoxControl.Items.Remove(ti);
                comboBoxControl.SelectedItem = null;
                if (TargetControl.getPhoto() == ti.TargetPhoto)
                {
                    TargetControl.Clear();
                }
                ti.Clear();
            }
        }