Example #1
0
        private void goodsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ReadCountStage stage     = this.stageListBox.SelectedItem as ReadCountStage;
            ReadCountItem  goodsItem = this.goodsListBox.SelectedItem as ReadCountItem;

            this.removeGoodsButton.IsEnabled = stage != null && goodsItem != null;
        }
        private ReadCountStage CreateReadCountStage(string backgroundImage, ReadCountItem[] items)
        {
            ReadCountStage stage = new ReadCountStage(backgroundImage);

            stage.AddItems(items);
            return(stage);
        }
Example #3
0
        private void addStageButton_Click(object sender, RoutedEventArgs e)
        {
            ReadCountStage stage = new ReadCountStage();

            stage.Title = string.Format("Stage {0}", this.stageCollection.Count);
            this.stageCollection.Add(stage);
        }
Example #4
0
 private void SaveImages(string backgroundPath, string goodsPath, ReadCountStage stage)
 {
     this.CopyFile(backgroundPath, stage.BackgroundImage);
     stage.BackgroundImage = System.IO.Path.GetFileName(stage.BackgroundImage);
     foreach (ReadCountItem item in stage.Items)
     {
         this.CopyFile(goodsPath, item.GoodsImage);
         item.GoodsImage = System.IO.Path.GetFileName(item.GoodsImage);
     }
 }
Example #5
0
        private void removeStageButton_Click(object sender, RoutedEventArgs e)
        {
            ReadCountStage stage = this.stageListBox.SelectedItem as ReadCountStage;

            if (stage == null)
            {
                return;
            }

            this.stageCollection.Remove(stage);
        }
Example #6
0
        private void stageListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ReadCountStage stage     = this.stageListBox.SelectedItem as ReadCountStage;
            ReadCountItem  goodsItem = this.goodsListBox.SelectedItem as ReadCountItem;

            //this.backgroundImageButton.IsEnabled = stage != null;
            //this.addGoodsButton.IsEnabled = stage != null;
            //this.removeGoodsButton.IsEnabled = stage != null && goodsItem != null;

            this.stageInfoPanel.DataContext = stage;
        }
        private void UpdateBackgroundImage()
        {
            ReadCountStage stage = ReadCountDataMgr.Instance.CurrentStage;

            if (stage == null)
            {
                return;
            }

            if (!System.IO.Path.IsPathRooted(stage.BackgroundImage))
            {
                stage.BackgroundImage = System.IO.Path.Combine(this.backgroundImagePath, stage.BackgroundImage);
            }
        }
Example #8
0
        private void removeGoodsItemButton_Click(object sender, RoutedEventArgs e)
        {
            ReadCountStage stage = this.stageListBox.SelectedItem as ReadCountStage;

            if (stage == null)
            {
                return;
            }

            ReadCountItem item = this.goodsListBox.SelectedItem as ReadCountItem;

            if (item != null)
            {
                stage.Items.Remove(item);
            }
        }
Example #9
0
        private void addToCurrentStageButton_Click(object sender, RoutedEventArgs e)
        {
            ReadCountStage stage = this.stageListBox.SelectedItem as ReadCountStage;

            if (stage == null)
            {
                return;
            }

            ImageItem imageItem = this.goodsImageListBox.SelectedItem as ImageItem;

            if (imageItem != null)
            {
                ReadCountItem item = new ReadCountItem(imageItem.File, 0, 9, true);
                stage.Items.Add(item);
            }
        }
Example #10
0
        private void setAsBackgroundImageButton_Click(object sender, RoutedEventArgs e)
        {
            ReadCountStage stage = this.stageListBox.SelectedItem as ReadCountStage;

            if (stage == null)
            {
                return;
            }

            ImageItem imageItem = this.backgroundImageListBox.SelectedItem as ImageItem;

            if (imageItem == null)
            {
                return;
            }

            stage.BackgroundImage = imageItem.File;
        }