예제 #1
0
 private static object ImageGetter(ILogMessage message)
 {
     if (message.Severity == ELogMessageSeverity.Error)
     {
         return(ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.error_button));
     }
     else
     {
         return(ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.Warning));
     }
 }
예제 #2
0
        public MainWindow()
        {
            Current.MainWindow = this;
            GuiCommands.Init(this);
            InitializeComponent();
            this.Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.ExolutioIcon);

            DiagramTabManager = new DiagramTabManager(this);
            ConfigurationManager.LoadConfiguration();

            this.Loaded        += MainWindow_Loaded;
            dockManager.Loaded += dockManager_Loaded;
            Current.RecentFile += OnRecentFile;
            ExolutioRibbon.FillRecent(ConfigurationManager.Configuration.RecentFiles, ConfigurationManager.Configuration.RecentDirectories);

            Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
        }
예제 #3
0
        public override void Execute(object parameter = null)
        {
            if (Current.ActiveDiagram != null && Current.ActiveDiagram is PSMDiagram)
            {
                XDocument schematronSchemaDocument;
                ILog      log;

                TranslationSettings settings = new TranslationSettings();
                settings.Functional  = true;
                settings.SchemaAware = true;

                GenerateSchema((PSMSchema)Current.ActiveDiagram.Schema, settings, out schematronSchemaDocument, out log);

                FilePresenterButtonInfo[] additionalButtonsInfo = new[] {
                    new FilePresenterButtonInfo()
                    {
                        ButtonName = "SA", Text = "Schema aware", Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.refresh), UpdateFileContentAction = RegenerateSchema, ToggleButton = true, IsToggled = true
                    },
                    new FilePresenterButtonInfo()
                    {
                        ButtonName = "F", Text = "Functional", Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.refresh), UpdateFileContentAction = RegenerateSchema, ToggleButton = true, IsToggled = true
                    },
                };

                ExpressionTweakingPanel tweakingPanel = new ExpressionTweakingPanel();

                TagClass tag = new TagClass();
                tag.settings      = settings;
                tag.tweakingPanel = tweakingPanel;

                IFilePresenterTab filePresenterTab
                    = Current.MainWindow.FilePresenter.DisplayFile(schematronSchemaDocument, EDisplayedFileType.SCH, Current.ActiveDiagram.Caption + ".sch", log, sourcePSMSchema: (PSMSchema)Current.ActiveDiagram.Schema,
                                                                   additionalActions: additionalButtonsInfo, tag: tag);
                filePresenterTab.RefreshCallback += RegenerateSchema;
                if (settings.SubexpressionTranslations.TranslationOptionsWithMorePossibilities.Any())
                {
                    tweakingPanel.Bind(settings.SubexpressionTranslations);
                    tweakingPanel.FilePresenterTab = filePresenterTab;
                    filePresenterTab.DisplayAdditionalControl(tweakingPanel, "Expression Tweaking");
                    tweakingPanel.TranslationTweaked += tweakingPanel_TranslationTweaked;
                }
            }
        }
예제 #4
0
        public override void Execute(object parameter = null)
        {
            if (Current.ActiveDiagram != null && Current.ActiveDiagram is PSMDiagram)
            {
                FilePresenterButtonInfo[] additionalButtonsInfo = new[] {
                    new FilePresenterButtonInfo()
                    {
                        ButtonName = "bXML", Text = "XML Syntax", Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.relaxNG), UpdateFileContentAction = RegenerateSchema, RadioToggleButton = true, IsToggled = true
                    },
                    new FilePresenterButtonInfo()
                    {
                        ButtonName = "bCompact", Text = "Compact Syntax", Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.relaxNG_compact), UpdateFileContentAction = RegenerateSchema, RadioToggleButton = true, IsToggled = false
                    },
                };

                XDocument xmlSchemaDocument;
                var       schemaGenerator = GenerateXmlSyntax(out xmlSchemaDocument, (PSMSchema)Current.ActiveDiagram.Schema);

                IFilePresenterTab filePresenterTab = Current.MainWindow.FilePresenter.DisplayFile(xmlSchemaDocument, EDisplayedFileType.RNG, Current.ActiveDiagram.Caption + ".rng", schemaGenerator.Log, sourcePSMSchema: schemaGenerator.PSMSchema,
                                                                                                  additionalActions: additionalButtonsInfo);
                filePresenterTab.RefreshCallback += RegenerateSchema;
            }
        }
예제 #5
0
        public static void Init(IMainWindow mainWindow)
        {
            #region project
            NewProjectCommand       = new guiNewProjectCommand();
            OpenProjectCommand      = new guiOpenProjectCommand();
            CloseApplicationCommand = new guiCloseAppCommand();
            CloseProjectCommand     = new guiCloseProjectCommand();
            SaveProjectCommand      = new guiSaveProjectCommand();
            SaveAsProjectCommand    = new guiSaveAsProjectCommand();
            XSDtoPSM = new guiXSDtoPSM();
#if SILVERLIGHT
            OpenWebProjectCommand = new guiOpenWebProjectCommand();
#endif
            UndoCommand = new guiUndoCommand();
            RedoCommand = new guiRedoCommand();
            Delete      = new guiDelete();
            HelpCommand = new guiShowHelpCommand();
            //RenameProjectCommand = new guiControllerCommand
            //                           {
            //                               ControllerCommandFactoryMethod = CommandFactory<cmdRenameProject>.Factory,
            //                               ControllerCommandType = typeof(cmdRenameProject),
            //                               NoScope = true,
            //                               OpenDialog = true,
            //                               Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.pencil)
            //                           };
            RenamePSMSchemaCommand = new guiControllerCommand
            {
                ControllerCommandFactoryMethod = CommandFactory <cmdRenamePSMSchema> .Factory,
                ControllerCommandType          = typeof(cmdRenamePSMSchema),
                ScopeObjectConvertor           = guiControllerCommandScopeConvertors.DiagramToSchema,
                OpenDialog = true,
                Icon       = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.pencil)
            };
            RemovePSMSchemaCommand = new guiControllerCommand
            {
                ControllerCommandFactoryMethod = CommandFactory <Controller.Commands.Complex.PSM.cmdDeletePSMSchema> .Factory,
                ControllerCommandType          = typeof(Controller.Commands.Complex.PSM.cmdDeletePSMSchema),
                ScopeObjectConvertor           = guiControllerCommandScopeConvertors.DiagramToSchema,
                OpenDialog = false,
                Icon       = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.delete2)
            };

            RenameComponentCommand = new guiControllerCommand
            {
                Text = "Rename...",
                Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.note_edit),
                ControllerCommandFactoryMethod = CommandFactory <cmdRenameComponent> .Factory,
                ControllerCommandType          = typeof(cmdRenameComponent),
                Gesture    = KeyGestures.F2,
                OpenDialog = true,
                AcceptedSelectedComponentType = typeof(Component),
                ScopeIsSelectedComponent      = true
            };

            NewPSMSchema = new guiControllerCommand
            {
                Text    = "New PSM schema",
                Icon    = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.GenericDocument),
                NoScope = true,
                ControllerCommandFactoryMethod = CommandFactory <cmdNewPSMSchema> .Factory,
                ControllerCommandType          = typeof(cmdNewPSMSchema)
            };

            OpenAttributeTypesDialog = new guiOpenAttributeTypesDialogCommand();

            #endregion

            #region grammar

            NormalizeSchemaCommandCommand   = new guiNormalizeSchemaCommand();
            TestNormalizationCommand        = new guiTestNormalizationCommand();
            GenerateGrammarCommand          = new guiGenerateGrammarCommand();
            GenerateXsdCommand              = new guiGenerateXsdCommand();
            GenerateSchematronSchemaCommand = new guiGenerateSchematronSchemaCommand();
            CreateSampleDocumentCommand     = new guiSampleDocumentCommand();
            SuggestConstraintsCommand       = new guiSuggestConstraintsCommand();
            GenerateRngCommand              = new guiGenerateRngCommand();

            #endregion

            #region versioning

            BranchCurrentVersionCommand = new guiBranchCurrentVersion();
            SaveAsSingleVersionCommand  = new guiSaveAsSingleVersion();
            RemoveCurrentVersionCommand = new guiRemoveCurrentVersion();
            #if SILVERLIGHT
            #else
            FindChangesCommand              = new guiFindChanges();
            CreateVersionLinkCommand        = new guiCreateVersionLink();
            RemoveVersionLinkCommand        = new guiRemoveVersionLink();
            AdaptationCommand               = new guiAdaptationCommand();
            VisualizeLinksCommand           = new guiVisualizeLinks();
            RemoveVersionLinkBetweenSchemas = new guiRemoveVersionLinkBetweenSchemas();
            CreateVersionLinkBetweenSchemas = new guiCreateVersionLinkBetweenSchemas();
            #endif

            #endregion

            #region PIM

            AddPIMClassCommand = new guiControllerCommand
            {
                Text = "Add class",
                ControllerCommandFactoryMethod = CommandFactory <cmdCreateNewPIMClass> .Factory,
                ControllerCommandType          = typeof(cmdCreateNewPIMClass),
                NoScope = true,
                PIMOnly = true,
                Icon    = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.@class)
            };

            AddPIMAttributeCommand = new guiControllerCommand
            {
                Text = "Add attribute",
                ControllerCommandFactoryMethod = CommandFactory <cmdNewPIMAttribute> .Factory,
                ControllerCommandType          = typeof(cmdNewPIMAttribute),
                AcceptedSelectedComponentType  = typeof(PIMClass),
                ScopeIsSelectedComponent       = true,
                PIMOnly = true,
                Icon    = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.AddAttributes)
            };

            AddPIMAssociationCommand = new guiControllerCommand
            {
                Text = "Add association",
                ControllerCommandFactoryMethod = CommandFactory <cmdNewPIMAssociation> .Factory,
                ControllerCommandType          = typeof(cmdNewPIMAssociation),
                NoScope    = true,
                PIMOnly    = true,
                OpenDialog = true,
                Icon       = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.assocclass)
            };
            AddPIMGeneralizationCommand = new guiControllerCommand
            {
                Text = "Add generalization",
                ControllerCommandFactoryMethod = CommandFactory <cmdNewPIMGeneralization> .Factory,
                ControllerCommandType          = typeof(cmdNewPIMGeneralization),
                NoScope    = true,
                PIMOnly    = true,
                OpenDialog = true,
                Icon       = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.gen)
            };
            SplitPIMAttributeCommand   = new guiSplitPIMAttribute();
            SplitPIMAssociationCommand = new guiSplitPIMAssociation();
            SplitPIMAttribute3Command  = new guiSplitPIMAttribute()
            {
                Count = 3
            };
            SplitPIMAssociation3Command = new guiSplitPIMAssociation()
            {
                Count = 3
            };
            SplitPIMAttribute4Command = new guiSplitPIMAttribute()
            {
                Count = 4
            };
            SplitPIMAssociation4Command = new guiSplitPIMAssociation()
            {
                Count = 4
            };
            SplitPIMAttributeMoreCommand = new guiControllerCommand
            {
                Text = "More...",
                ControllerCommandFactoryMethod = CommandFactory <Controller.Commands.Complex.PIM.cmdSplitPIMAttribute> .Factory,
                ControllerCommandType          = typeof(Controller.Commands.Complex.PIM.cmdSplitPIMAttribute),
                PIMOnly    = true,
                OpenDialog = true,
                ScopeIsSelectedComponent      = true,
                AcceptedSelectedComponentType = typeof(PIMAttribute),
                Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.AddAttributes)
            };
            SplitPIMAssociationMoreCommand = new guiControllerCommand
            {
                Text = "More...",
                ControllerCommandFactoryMethod = CommandFactory <Controller.Commands.Complex.PIM.cmdSplitPIMAssociation> .Factory,
                ControllerCommandType          = typeof(Controller.Commands.Complex.PIM.cmdSplitPIMAssociation),
                PIMOnly    = true,
                OpenDialog = true,
                ScopeIsSelectedComponent      = true,
                AcceptedSelectedComponentType = typeof(PIMAssociation),
                Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.split_pim_assoc)
            };
            DerivePSMRootCommand = new guiControllerCommand
            {
                Text = "Derive new PSM root",
                ControllerCommandFactoryMethod = CommandFactory <Controller.Commands.Complex.PIM.cmdDerivePSMRoot> .Factory,
                ControllerCommandType          = typeof(Controller.Commands.Complex.PIM.cmdDerivePSMRoot),
                PIMOnly = true,
                ScopeIsSelectedComponent      = true,
                AcceptedSelectedComponentType = typeof(PIMClass),
                Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.XmlSchema)
            };
            PIMShiftUp = new guiShiftPIMAttributeCommand()
            {
                Up = true
            };
            PIMShiftDown = new guiShiftPIMAttributeCommand()
            {
                Up = false
            };
            Associate2              = new guiAssociate2();
            PIMDelete               = new guiPIMDelete();
            PIMDeleteAssociation    = new guiPIMDeleteAssociation();
            PIMDeleteAttribute      = new guiPIMDeleteAttribute();
            PIMDeleteClass          = new guiPIMDeleteClass();
            PIMDeleteGeneralization = new guiPIMDeleteGeneralization();
            #endregion

            #region PSM

            AddPSMSchemaCommand = new guiControllerCommand
            {
                ControllerCommandFactoryMethod = CommandFactory <cmdNewPSMSchema> .Factory,
                ControllerCommandType          = typeof(cmdNewPSMSchema),
                NoScope = true
            };

            AddPSMClassCommand = new guiControllerCommand
            {
                Text = "Add class",
                ControllerCommandFactoryMethod = CommandFactory <cmdNewPSMClass> .Factory,
                ControllerCommandType          = typeof(cmdNewPSMClass),
                NoScope = true,
                PSMOnly = true,
                Icon    = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.@class)
            };

            AddPSMContentModel = new guiControllerCommand
            {
                Text = "Add content model",
                ControllerCommandFactoryMethod = CommandFactory <cmdNewPSMContentModel> .Factory,
                ControllerCommandType          = typeof(cmdNewPSMContentModel),
                NoScope = true,
                PSMOnly = true,
                Icon    = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.ContentChoice)
            };


            AddPSMAttributeCommand = new guiControllerCommand
            {
                Text = "Add attribute",
                ControllerCommandFactoryMethod = CommandFactory <Exolutio.Controller.Commands.Atomic.PSM.MacroWrappers.cmdCreateNewPSMAttribute> .Factory,
                ControllerCommandType          = typeof(Exolutio.Controller.Commands.Atomic.PSM.MacroWrappers.cmdCreateNewPSMAttribute),
                AcceptedSelectedComponentType  = typeof(PSMClass),
                ScopeIsSelectedComponent       = true,
                PSMOnly = true,
                Icon    = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.AddAttributes)
            };

            AddPSMAssociationCommand = new guiControllerCommand
            {
                Text = "Add association",
                ControllerCommandFactoryMethod = CommandFactory <cmdNewPSMAssociation> .Factory,
                ControllerCommandType          = typeof(cmdNewPSMAssociation),
                NoScope    = true,
                PSMOnly    = true,
                OpenDialog = true,
                Icon       = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.AddChildren),
            };

            AddPSMGeneralizationCommand = new guiControllerCommand
            {
                Text = "Add generalization",
                ControllerCommandFactoryMethod = CommandFactory <cmdNewPSMGeneralization> .Factory,
                ControllerCommandType          = typeof(cmdNewPSMGeneralization),
                NoScope    = true,
                PSMOnly    = true,
                OpenDialog = true,
                Icon       = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.gen),
            };

            AddPSMChildInterpreted = new guiControllerCommand
            {
                Text = "Add interpreted child",
                ControllerCommandFactoryMethod = CommandFactory <Controller.Commands.Complex.PSM.cmdCreateNewPSMClassAsIntChild> .Factory,
                ControllerCommandType          = typeof(Controller.Commands.Complex.PSM.cmdCreateNewPSMClassAsIntChild),
                PSMOnly    = true,
                OpenDialog = true,
                Icon       = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.AddChildren),
                AcceptedSelectedComponentType = typeof(PSMClass),
                ScopeIsSelectedComponent      = true
            };
            AddPSMChildUnInterpreted = new guiControllerCommand
            {
                Text = "Add uninterpreted child",
                ControllerCommandFactoryMethod = CommandFactory <cmdCreateNewPSMClassAsUnintChild> .Factory,
                ControllerCommandType          = typeof(Exolutio.Controller.Commands.Complex.PSM.cmdCreateNewPSMClassAsUnintChild),
                PSMOnly    = true,
                OpenDialog = false,
                Icon       = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.AddChildren),
                AcceptedSelectedComponentType = typeof(PSMClass),
                ScopeIsSelectedComponent      = true
            };

            ValidateXMLFile     = new guiValidateCommand();
            ValidateAllXMLFiles = new guiValidateAllCommand();

            SplitPSMAttributeCommand   = new guiSplitPSMAttribute();
            SplitPSMAssociationCommand = new guiSplitPSMAssociation();
            SplitPSMAttribute3Command  = new guiSplitPSMAttribute()
            {
                Count = 3
            };
            SplitPSMAssociation3Command = new guiSplitPSMAssociation()
            {
                Count = 3
            };
            SplitPSMAttribute4Command = new guiSplitPSMAttribute()
            {
                Count = 4
            };
            SplitPSMAssociation4Command = new guiSplitPSMAssociation()
            {
                Count = 4
            };
            SplitPSMAttributeMoreCommand = new guiControllerCommand
            {
                Text = "More...",
                ControllerCommandFactoryMethod = CommandFactory <cmdSplitPSMAttribute> .Factory,
                ControllerCommandType          = typeof(cmdSplitPSMAttribute),
                PSMOnly    = true,
                OpenDialog = true,
                Icon       = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.AddAttributes),
                ScopeIsSelectedComponent      = true,
                AcceptedSelectedComponentType = typeof(PSMAttribute)
            };
            SplitPSMAssociationMoreCommand = new guiControllerCommand
            {
                Text = "More...",
                ControllerCommandFactoryMethod = CommandFactory <cmdSplitPSMAttribute> .Factory,
                ControllerCommandType          = typeof(cmdSplitPSMAttribute),
                PSMOnly    = true,
                OpenDialog = true,
                Icon       = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.split_psm_assoc),
                ScopeIsSelectedComponent      = true,
                AcceptedSelectedComponentType = typeof(PSMAssociation)
            };
            CreateSequenceContentModelCommand = new guiCreateContentModelCommand()
            {
                Type = PSMContentModelType.Sequence
            };
            CreateChoiceContentModelCommand = new guiCreateContentModelCommand()
            {
                Type = PSMContentModelType.Choice
            };
            CreateSetContentModelCommand = new guiCreateContentModelCommand()
            {
                Type = PSMContentModelType.Set
            };
            ShiftLeft = new guiShiftCommand()
            {
                Left = true
            };
            ShiftRight = new guiShiftCommand()
            {
                Left = false
            };
            PSMShiftUp = new guiShiftPSMAttributeCommand()
            {
                Up = true
            };
            PSMShiftDown = new guiShiftPSMAttributeCommand()
            {
                Up = false
            };
            LeaveOutUnintAM = new guiLeaveOutUnintAM();
            InsertPSMClass  = new guiInsertPSMClass();
            //CutAssociation = new guiCutAssociation();
            //DeletePSMAttribute = new guiDeletePSMAttribute();
            PSMDelete       = new guiPSMDelete();
            DeleteSubtree   = new guiDeleteSubtree();
            DeletePSMSchema = new guiDeletePSMSchema();

            MappingV = new guiMappingV();

            #endregion

            #region other

            VerifyModelCommand         = new guiVerifyModelCommand();
            LocateInterpretedComponent = new guiLocateInterpretedComponent();

            #endregion

            #region align

            List <guiAlignCommand> alignCommands = new List <guiAlignCommand>();

            AlignLeftCommand = new guiAlignCommand {
                Alignment = EAlignment.Left, AllAlignCommands = alignCommands
            };
            AlignRightCommand = new guiAlignCommand {
                Alignment = EAlignment.Right, AllAlignCommands = alignCommands
            };
            AlignTopCommand = new guiAlignCommand {
                Alignment = EAlignment.Top, AllAlignCommands = alignCommands
            };
            AlignBottomCommand = new guiAlignCommand {
                Alignment = EAlignment.Bottom, AllAlignCommands = alignCommands
            };

            CenterVerticallyCommand = new guiAlignCommand {
                Alignment = EAlignment.CenterV, AllAlignCommands = alignCommands
            };
            CenterHorizontallyCommand = new guiAlignCommand {
                Alignment = EAlignment.CenterH, AllAlignCommands = alignCommands
            };
            DistributeVerticallyCommand = new guiAlignCommand {
                Alignment = EAlignment.DistributeV, AllAlignCommands = alignCommands
            };
            DistributeHorizontallyCommand = new guiAlignCommand {
                Alignment = EAlignment.DistributeH, AllAlignCommands = alignCommands
            };

            alignCommands.Add(AlignLeftCommand);
            alignCommands.Add(AlignRightCommand);
            alignCommands.Add(AlignTopCommand);
            alignCommands.Add(AlignBottomCommand);
            alignCommands.Add(CenterVerticallyCommand);
            alignCommands.Add(CenterHorizontallyCommand);
            alignCommands.Add(DistributeVerticallyCommand);
            alignCommands.Add(DistributeHorizontallyCommand);

            #endregion

            #region traversing

            SelectNextCommand = new guiSelectNextCommand();
            SelectPrevCommand = new guiSelectNextCommand();

            #endregion

            #region OCL

            CreateOCLValidationScriptCommand = new guiCreateOCLScriptCommand()
            {
                CreatedScriptType = OCLScript.EOclScriptType.Validation
            };
            CreateOCLEvolutionScriptCommand = new guiCreateOCLScriptCommand()
            {
                CreatedScriptType = OCLScript.EOclScriptType.Evolution
            };
            OCLSyntaxCheckCommand     = new guiOCLSyntaxCheckCommand();
            RemoveOCLScriptCommand    = new guiRemoveOCLScriptCommand();
            RenameOCLScriptCommand    = new guiRenameOCLScriptCommand();
            SuggestConstraintsCommand = new guiSuggestConstraintsCommand();

            #endregion

            #region XRX

            CreateXRXPSMSchemaCommand       = new guiCreateXRXPSMSchemaCommand();
            GenerateXRXRestInterfaceCommand = new guiGenerateXRXRestInterfaceCommand();
            GenerateXRXXFormsCommand        = new guiGenerateXRXXFormsCommand();

            #endregion
        }
예제 #6
0
        public override void Execute(object parameter)
        {
            SampleDataGenerator g = new SampleDataGenerator();

            g.MinimalTree = true;
            g.EmptyValues = true;
            g.UseAttributesDefaultValues = false;
            if (ScopeObject != null)
            {
                g.RootForGeneration = (PSMAssociationMember)ScopeObject;
            }
            XDocument xmlDocument = g.Translate((PSMSchema)Current.ActiveDiagram.Schema);

            FilePresenterButtonInfo[] additionalButtonsInfo = new [] { new FilePresenterButtonInfo()
                                                                       {
                                                                           Text = "Generate another file", Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.xmlIcon), UpdateFileContentAction = GenerateAnotherFile
                                                                       } };
            Current.MainWindow.FilePresenter.DisplayFile(xmlDocument, EDisplayedFileType.XML, Current.ActiveDiagram.Caption + "_sample.xml", g.Log, (PSMSchema)Current.ActiveDiagram.Schema, null, additionalButtonsInfo);
        }