Exemplo n.º 1
0
        void OnComponentNameChanged(object s, Stetic.ComponentNameEventArgs args)
        {
            try {
                // Make sure the fields in the partial class are up to date.
                // Provide the args parameter to GenerateSteticCodeStructure, in this
                // way the component that has been renamed will be generated with the
                // old name, and UpdateField will be able to find it (to rename the
                // references to the field, it needs to have the old name).
                if (gproject.Project.UsePartialTypes)
                {
                    GuiBuilderService.GenerateSteticCodeStructure((DotNetProject)gproject.Project, designer.RootComponent, args, false, false);
                }

                codeBinder.UpdateField(args.Component, args.OldName);
            }
            catch (Exception ex) {
                MessageService.ShowException(ex);
            }
        }