Пример #1
0
        // Add a section to the document
        public static Section AddSection(this Document document, PageFormat pageFormat, ObjectSetup setup = null)
        {
            Section section = document.AddSection();

            section.PageSetup            = document.DefaultPageSetup.Clone();
            section.PageSetup.PageFormat = pageFormat;
            if (setup != null)
            {
                if (setup.Width != null)
                {
                    section.PageSetup.PageWidth = setup.Width.Value;
                }
                if (setup.Height != null)
                {
                    section.PageSetup.PageHeight = setup.Height.Value;
                }

                if (setup.Margin != null)
                {
                    section.PageSetup.TopMargin    = string.Format("{0}cm", setup.Margin.Top);
                    section.PageSetup.LeftMargin   = string.Format("{0}cm", setup.Margin.Left);
                    section.PageSetup.RightMargin  = string.Format("{0}cm", setup.Margin.Right);
                    section.PageSetup.BottomMargin = string.Format("{0}cm", setup.Margin.Bottom);
                }
            }
            return(section);
        }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     _player      = GameObject.Find("Player").GetComponent <Player>();
     _objectSetup = Follow; _objectSetup += CheckSprite;
     DontDestroyOnLoad(gameObject);
 }