Beispiel #1
0
        private void forEachShapeOnShapeRange(actionMethod method, corel.ShapeRange sr)
        {
            corel.Shape s;
            while (sr.Count > 0)
            {
                s = sr[1];
                sr.Remove(1);

                // работа в группе
                if (s.Type == Corel.Interop.VGCore.cdrShapeType.cdrGroupShape)
                {
                    groupShape(method, s);
                }

                // работа в PowerClip
                if (s.PowerClip != null)
                {
                    powerClipShape(method, s);
                }

                // текст обрабатывается своими методами
                if (s.Type == corel.cdrShapeType.cdrTextShape)
                {
                    textShape(method, s);
                }

                else
                {
                    method(s);
                }
            }
        }
Beispiel #2
0
        private void beginAction(actionMethod method)
        {
            if (corelApp.Documents.Count == 0)
            {
                return;
            }

            corelApp.Optimization = true;

            corelApp.ActiveDocument.Unit = corel.cdrUnit.cdrMillimeter;

            if (chxOnAllPage.IsChecked ?? false)
            {
                foreach (corel.Page page in corelApp.ActiveDocument.Pages)
                {
                    forEachShapeOnShapeRange(method, page.Shapes.All());
                }
            }
            else
            {
                forEachShapeOnShapeRange(method, corelApp.ActivePage.Shapes.All());
            }

            corelApp.ActiveDocument.ClearSelection();
            corelApp.Optimization = false;
            corelApp.ActiveWindow.Refresh();
            corelApp.Application.Refresh();
        }
Beispiel #3
0
 private void powerClipShape(actionMethod method, corel.Shape s)
 {
     corel.ShapeRange sr = s.PowerClip.Shapes.All();
     s.PowerClip.EnterEditMode();
     forEachShapeOnShapeRange(method, sr);
     s.PowerClip.LeaveEditMode();
 }
Beispiel #4
0
 // какогото хрена идет двойной вызов
 // закаментил else
 private void textShape(actionMethod method, corel.Shape s)
 {
     if (method == textToCurves)
     {
         method(s);
     }
     if (method == uniformFillToCMYK)
     {
         textUniformFillToCMYK(s.Text.Story.Characters);
     }
     if (method == outlineFillToCMYK)
     {
         textOutlineFillToCMYK(s.Text.Story.Characters);
     }
     //else method(s);
 }
Beispiel #5
0
 private void groupShape(actionMethod method, corel.Shape s)
 {
     forEachShapeOnShapeRange(method, s.Shapes.All());
 }