示例#1
0
        private string GetActiveTitleBlockPlacement(TitleBlockLocationEnum titleBlockLocationEnum)
        {
            string currentTitleBlockLocation;

            switch (titleBlockLocationEnum)
            {
            case TitleBlockLocationEnum.kBottomLeftPosition:
                currentTitleBlockLocation = "Lower Left";
                break;

            case TitleBlockLocationEnum.kBottomRightPosition:
                currentTitleBlockLocation = "Lower Right";
                break;

            case TitleBlockLocationEnum.kTopLeftPosition:
                currentTitleBlockLocation = "Upper Left";
                break;

            case TitleBlockLocationEnum.kTopRightPosition:
                currentTitleBlockLocation = "Upper Right";
                break;

            default:
                currentTitleBlockLocation = "Lower Right";
                break;
            }
            return(currentTitleBlockLocation);
        }
示例#2
0
        private void AddSheetMetaData(Sheet sheet)
        {
            if (sheet.TitleBlock != null)
            {
                sheet.TitleBlock.Delete();
            }

            if (sheet.Border != null)
            {
                sheet.Border.Delete();
            }

            TitleBlockDefinition   tempTitleBlockDef  = GetTitleBlock();
            TitleBlockLocationEnum titleBlockLocation = GetTitleBlockLocation();

            string[] promptStrings = new string[] { "", "", "", "", "", "", "", "", "", "", "", "",
                                                    "", "", "", "", "", "", "", "", "", "", "", "", "", "" };

            TitleBlock titleBlockForCreatedSheet =
                sheet.AddTitleBlock(tempTitleBlockDef, titleBlockLocation, promptStrings);

            if (SelectedBorder.Equals("Default Border"))
            {
                sheet.AddDefaultBorder();
            }
            else
            {
                sheet.AddBorder(BorderDefinition: GetBorderDefinition(SelectedBorder));
            }

            sheet.ExcludeFromCount    = ExcludeFromCount;
            sheet.ExcludeFromPrinting = ExcludeFromPrinting;
            sheet.Name        = SheetName;
            sheet.Orientation = this.GetPageOrientation();

            if (drawDoc.ActiveSheet != sheet)
            {
                sheet.Activate();
            }
        }