Пример #1
0
        /// <summary>
        /// Initialize this instance.
        /// </summary>
        public void Initialize()
        {
            // Wire-up events
            NameField.EditingEnded += (sender, e) =>
            {
                // Save undo point
                DesignSurface.SaveUndoPoint();

                // Save and validate
                SelectedPortfolio.Name = NameField.StringValue;
                SelectedPortfolio.Name = Kimono.MakeValidItemName("Portfolio", SelectedPortfolio.Name);

                // Update UI
                NameField.StringValue = SelectedPortfolio.Name;
                RaisePortfolioModified();
            };

            NamespaceField.EditingEnded += (sender, e) =>
            {
                // Save undo point
                DesignSurface.SaveUndoPoint();

                SelectedPortfolio.Namespace = NamespaceField.StringValue;
                RaisePortfolioModified();
            };

            AuthorField.EditingEnded += (sender, e) =>
            {
                // Save undo point
                DesignSurface.SaveUndoPoint();

                SelectedPortfolio.Author = AuthorField.StringValue;
                RaisePortfolioModified();
            };

            CopyrightField.TextChanged += (text) =>
            {               // Save undo point based on edit state
                if (FirstChange)
                {
                    DesignSurface.SaveUndoPoint();
                    FirstChange = false;
                }
                else
                {
                    DesignSurface.ReplaceUndoPoint();
                }

                SelectedPortfolio.Copyright = text;
                RaisePortfolioModified();
            };
        }
Пример #2
0
        /// <summary>
        /// Initialize this instance.
        /// </summary>
        public void Initialize()
        {
            Contents.TextChanged += (text) =>
            {               // Save undo point based on edit state
                if (FirstChange)
                {
                    DesignSurface.SaveUndoPoint();
                    FirstChange = false;
                }
                else
                {
                    DesignSurface.ReplaceUndoPoint();
                }

                SelectedShape.Text = text;
                RaiseShapeModified();
            };
        }
        /// <summary>
        /// Initialize this instance.
        /// </summary>
        public void Initialize()
        {
            // Wireup events
            Contents.TextChanged += (text) =>
            {               // Save undo point based on edit state
                if (FirstChange)
                {
                    DesignSurface.SaveUndoPoint();
                    FirstChange = false;
                }
                else
                {
                    DesignSurface.ReplaceUndoPoint();
                }

                SelectedText.Value = text;
                RaisePropertyModified();
            };
        }