Beispiel #1
0
        private string GetPrefix(PBPATargetType targetType, PBPALocationType locationType)
        {
            string prefix = "";

            switch (locationType)
            {
            case PBPALocationType.Center:
                prefix = SettingTextMemo.CenterPrefix;
                break;

            case PBPALocationType.Top:
                prefix = SettingTextMemo.TopPrefix;
                break;

            case PBPALocationType.Bottom:
                prefix = SettingTextMemo.BottomPrefix;
                break;

            default:
                break;
            }
            return(prefix);
        }
Beispiel #2
0
        private void RegenerateAllFor_Prefix(Document doc, PBPAModelCollection collection, PBPATargetType targetType, PBPALocationType locationType)
        {
            string prefix       = GetPrefix(targetType, locationType);
            var    dataToChange = collection.Data.Where(c => c.TargetType == targetType && c.LocationType == locationType).ToList();

            for (int i = dataToChange.Count - 1; i >= 0; i--)
            {
                var model = dataToChange[i];
                model.Document         = doc;
                model.IsRegenerate     = true;
                model.AnnotationPrefix = prefix;
                var element = doc.GetElement(model.TargetId);
                element.GetParameters(PBPAContext.SharedParameterPL).FirstOrDefault().Set(model.GetFull_L(element));
                if (!PBPAContext.Creator.Regenerate(model))
                {
                    collection.Data.Remove(model);
                }
            }
        }