Ejemplo n.º 1
0
        public void ReplaceBy(FilmingControlCell newCell, bool needReferesh, ActionType curAction)
        {
            if (newCell.IsEmpty)
            {
                Image.Clear();
                Refresh();
            }
            var  displaydata = newCell.Image.CurrentPage;
            bool flag        = this.IsEmpty;

            this.Image.Clear();
            this.Image.AddPage(displaydata);
            this.IsSelected = newCell.IsSelected;
            if (flag)
            {
                FilmPageUtil.SetAllActions(this, curAction);
            }
            if (needReferesh)
            {
                Refresh();
            }
            else
            {
                this.Image.CurrentPage.IsDirty = true;
            }
        }
Ejemplo n.º 2
0
        public void ReplaceBy(FilmingLayoutCell replaceCell, bool needReferesh, ActionType curAction)
        {
            int cellCount = replaceCell.Rows * replaceCell.Columns;

            if (Rows != replaceCell.Rows || Columns != replaceCell.Columns)
            {
                RemoveAll();
                SetLayout(replaceCell.Rows, replaceCell.Columns);
                IsMultiformatLayoutCell = replaceCell.IsMultiformatLayoutCell;
                for (int i = 0; i < cellCount; i++)
                {
                    AddCell(new FilmingControlCell());
                }
                Refresh();
            }
            for (int i = 0; i < replaceCell.Children.Count(); i++)
            {
                var filmingControlCell = replaceCell.Children.ElementAt(i) as FilmingControlCell;
                var tempcell           = this.Children.ElementAt(i) as FilmingControlCell;
                if (filmingControlCell == null || filmingControlCell.IsEmpty)
                {
                    if (tempcell != null && tempcell.Image != null && tempcell.Image.CurrentPage != null)
                    {
                        tempcell.Image.Clear();
                        tempcell.Refresh();
                    }
                    continue;
                }
                var displaydata = filmingControlCell.Image.CurrentPage;
                if (tempcell != null)
                {
                    bool flag = tempcell.IsEmpty;
                    tempcell.Image.Clear();
                    tempcell.Image.AddPage(displaydata);
                    tempcell.IsSelected = filmingControlCell.IsSelected;
                    if (flag)
                    {
                        FilmPageUtil.SetAllActions(tempcell, curAction);
                    }
                    if (needReferesh)
                    {
                        tempcell.Refresh();
                    }
                    else
                    {
                        tempcell.Image.CurrentPage.IsDirty = true;
                    }
                }
            }
        }