Ejemplo n.º 1
0
        public DrawingPage()
        {
            InitializeComponent();

            _saveXaml                = true;
            _wpfSettings             = new WpfDrawingSettings();
            _wpfSettings.CultureInfo = _wpfSettings.NeutralCultureInfo;

            _fileReader          = new FileSvgReader(_wpfSettings);
            _fileReader.SaveXaml = _saveXaml;
            _fileReader.SaveZaml = false;

            _mouseHandlingMode = ZoomPanMouseHandlingMode.None;

            string workDir = Path.Combine(Path.GetDirectoryName(
                                              System.Reflection.Assembly.GetExecutingAssembly().Location), TemporalDirName);

            _workingDir = new DirectoryInfo(workDir);

            _embeddedImages = new List <EmbeddedImageSerializerArgs>();

            _embeddedImageVisitor = new EmbeddedImageSerializerVisitor(true);
            _wpfSettings.Visitors.ImageVisitor = _embeddedImageVisitor;

            _embeddedImageVisitor.ImageCreated += OnEmbeddedImageCreated;

            this.Loaded      += OnPageLoaded;
            this.Unloaded    += OnPageUnloaded;
            this.SizeChanged += OnPageSizeChanged;
        }
Ejemplo n.º 2
0
        public DrawingPage()
        {
            InitializeComponent();

            _saveXaml                = true;
            _wpfSettings             = new WpfDrawingSettings();
            _wpfSettings.CultureInfo = _wpfSettings.NeutralCultureInfo;

            _fileReader          = new FileSvgReader(_wpfSettings);
            _fileReader.SaveXaml = _saveXaml;
            _fileReader.SaveZaml = false;

            _mouseHandlingMode = ZoomPanMouseHandlingMode.SelectPoint;

            //string workDir = Path.Combine(Path.GetDirectoryName(
            //    System.Reflection.Assembly.GetExecutingAssembly().Location), TemporalDirName);
            string workDir = Path.Combine(Path.GetFullPath("..\\"), TemporalDirName);

            _workingDir = new DirectoryInfo(workDir);

            _embeddedImages = new List <EmbeddedImageSerializerArgs>();

            _embeddedImageVisitor = new EmbeddedImageSerializerVisitor(true);
            _wpfSettings.Visitors.ImageVisitor = _embeddedImageVisitor;

            _embeddedImageVisitor.ImageCreated += OnEmbeddedImageCreated;

            textEditor.SyntaxHighlighting = HighlightingManager.Instance.GetDefinition("XML");
            TextEditorOptions options = textEditor.Options;

            if (options != null)
            {
                //options.AllowScrollBelowDocument = true;
                options.EnableHyperlinks      = true;
                options.EnableEmailHyperlinks = true;
                options.EnableVirtualSpace    = false;
                options.HighlightCurrentLine  = true;
                options.ShowSpaces            = true;
                options.ShowTabs      = true;
                options.ShowEndOfLine = true;
            }

            textEditor.ShowLineNumbers = true;
            textEditor.WordWrap        = true;

            _foldingManager  = FoldingManager.Install(textEditor.TextArea);
            _foldingStrategy = new XmlFoldingStrategy();

            this.Loaded      += OnPageLoaded;
            this.Unloaded    += OnPageUnloaded;
            this.SizeChanged += OnPageSizeChanged;
        }