示例#1
0
        public void Set_LayoutChoices(IEnumerable <LayoutChoice_Set> layoutOptions)
        {
            // remove any existing options
            if (this.layoutOptions != null)
            {
                foreach (LayoutChoice_Set layout in this.layoutOptions)
                {
                    layout.RemoveParent(this);
                }
            }

            // put the new layout options
            this.layoutOptions = new List <LayoutChoice_Set>();
            if (layoutOptions != null)
            {
                foreach (LayoutChoice_Set layout in layoutOptions)
                {
                    LayoutChoice_Set layoutToAdd = layout;
                    if (layoutOptions.Count() > 1)
                    {
                        layoutToAdd = LayoutCache.For(layout);
                    }
                    this.layoutOptions.Add(layoutToAdd);
                    layoutToAdd.AddParent(this);
                }
            }

            // announce having changed
            this.AnnounceChange(true);
        }
示例#2
0
 public PixelatedLayout(LayoutChoice_Set layoutToManage, double pixelSize)
 {
     this.layoutToManage = layoutToManage;
     pixelWidth          = pixelHeight = pixelSize;
     layoutToManage.AddParent(this);
 }