Beispiel #1
0
        private ThumbnailItem win_DataItemLoadedEvent(string file)
        {
            DrawNumberItem item = DrawNumberData.LoadDrawNumberItem(file);

            item.DataFile = file;
            this.drawNumberCollection.Add(item);
            return(item);
        }
        private ThumbnailItem win_DataItemLoadedEvent(string file)
        {
            DrawNumberItem item = DrawNumberData.LoadDrawNumberItem(file);

            item.DataFile = file;
            string key = item.PointCollection.Count.ToString("000");

            if (this.sortedDrawNumberItemList.ContainsKey(key))
            {
                key += Guid.NewGuid().ToString("N");
            }
            this.sortedDrawNumberItemList.Add(key, item);
            return(item);
        }
        internal void NewDrawNumber()
        {
            this.drawNumberData = new DrawNumberData();

            List <Button> uiElementList = new List <Button>();

            foreach (UIElement ctrl in this.Children)
            {
                if (ctrl is Button)
                {
                    uiElementList.Add(ctrl as Button);
                }
            }

            foreach (Button btn in uiElementList)
            {
                this.Children.Remove(btn);
            }

            this.drawingImage.Source = null;
        }
        private void Update()
        {
            if (!this.update)
            {
                return;
            }

            DrawNumberItem item = ControlMgr.Instance.DataMgr.SelectedItem;

            if (item == null)
            {
                return;
            }

            DrawNumberControl.Instance.SelectedStage = ControlMgr.Instance.DataMgr.CurrentIndex;

            this.drawNumberData = DrawNumberData.Load(item.DataFile);

            Size imgSize = new Size();

            imgSize.Width  = this.drawNumberData.DrawNumberItem.CanvasWidth;
            imgSize.Height = this.drawNumberData.DrawNumberItem.CanvasHeight;
            if (imgSize.Width < 1.0f)
            {
                imgSize.Width = this.drawNumberData.DrawNumberItem.CanvasWidth;
            }
            if (imgSize.Height < 1.0f)
            {
                imgSize.Height = this.drawNumberData.DrawNumberItem.CanvasHeight;
            }
            Vector vec = GC_UIHelper.MatchImageToWnd(imgSize, new Size(panelGrid.ActualWidth, panelGrid.ActualHeight));

            this.drawNumberCanvas.Width  = vec.X; // this.drawNumberData.DrawNumberItem.CanvasWidth;
            this.drawNumberCanvas.Height = vec.Y; // this.drawNumberData.DrawNumberItem.CanvasHeight;

            this.drawNumberCanvas.Data = this.drawNumberData;
            this.update = false;
        }