Example #1
0
        private void btnProperties_Click(object sender, EventArgs e)
        {
            PropertiesEditor propForm = new PropertiesEditor(defaultProperties, defaultPropertiesXMLfileName);

            propForm.FormClosed += new FormClosedEventHandler(PropertiesFormClosed);
            propForm.ShowDialog();
        }
Example #2
0
        public void OpenPreferencesEditor()
        {
            PropertiesEditor pe = new PropertiesEditor();

            pe.TransientFor = mainWindow as Gtk.Window;
            pe.Run();
            pe.Destroy();
        }
Example #3
0
 public SolutionController(Solution solution, SolutionWindow solutionWindow, AnomalyController controller, PropertiesEditor objectEditor)
 {
     this.controller     = controller;
     this.solution       = solution;
     this.solutionWindow = solutionWindow;
     solutionWindow.setSolution(solution);
     this.objectEditor = objectEditor;
     solutionWindow.InterfaceChosen += solutionWindow_InterfaceChosen;
     controller.SelectionController.OnSelectionChanged += SelectionController_OnSelectionChanged;
 }
        public EditInterfaceRendererController(RendererPlugin renderer, UpdateTimer timer, SceneController sceneController, PropertiesEditor mainEditor)
        {
            this.renderer   = renderer;
            this.timer      = timer;
            this.mainEditor = mainEditor;
            sceneController.OnSceneLoaded    += new SceneControllerEvent(sceneController_OnSceneLoaded);
            sceneController.OnSceneUnloading += new SceneControllerEvent(sceneController_OnSceneUnloading);
            timer.addUpdateListener(this);

            mainEditor.ActiveInterfaceChanged += new PropertiesEditorEvent(mainEditor_ActiveInterfaceChanged);
            mainEditor.FieldChanged           += new PropertiesEditorEvent(mainEditor_FieldChanged);
            mainEditor.MainInterfaceChanged   += new PropertiesEditorEvent(mainEditor_MainInterfaceChanged);
        }
Example #5
0
        private void ExecuteOpenVariables(object parameter)
        {
            var view      = new PropertiesEditor();
            var viewModel = new VariablesViewModel();

            view.DataContext = viewModel;

            if (!base.ShowDialog(Translator.Translate("UI_VARIABLES"), view))
            {
                return;
            }

            viewModel.SaveChanges();
        }
Example #6
0
        private void ExecuteOpenSettings(object parameter)
        {
            var view      = new PropertiesEditor();
            var viewModel = new SettingsViewModel();

            view.DataContext = viewModel;

            if (!base.ShowDialog(Translator.Translate("UI_SETTINGS"), view))
            {
                return;
            }

            viewModel.SaveChanges();
        }
        /// <summary>
        /// Parses the input properties <see cref="System.String"/> into a valid
        /// <see cref="Spring.Transaction.Interceptor.ITransactionAttributeSource"/>
        /// instance
        /// </summary>
        /// <param name="attributeSource">The properties string to be parsed.</param>
        public void SetAsText(string attributeSource)
        {
            MethodMapTransactionAttributeSource source = new MethodMapTransactionAttributeSource();

            if (attributeSource == null || attributeSource.Length == 0)
            {
                _attributeSource = null;
            }
            else
            {
                PropertiesEditor           editor = new PropertiesEditor(attributeSource);
                TransactionAttributeEditor tae    = new TransactionAttributeEditor();

                foreach (string name in editor.Keys)
                {
                    string value = editor[name];
                    tae.SetAsText(value);
                    ITransactionAttribute transactionAttribute = tae.Value;
                    source.AddTransactionalMethod(name, transactionAttribute);
                }
            }
            _attributeSource = source;
        }
Example #8
0
        private IEnumerable <IdleStatus> finishInitialization()
        {
            splashScreen.updateStatus(10, "Loading Solution");
            yield return(IdleStatus.Ok);

            //Load the config file and set the resource root up.
            VirtualFileSystem.Instance.addArchive(solution.ResourceRoot);

            resourceController = new ResourceController(this);

            solution.loadExternalFiles(this);

            MyGUIPlugin.ResourceManager.Instance.load("Anomaly.Resources.AnomalyImagesets.xml");

            //Initialize controllers
            instanceBuilder = new InstanceBuilder();
            sceneController.initialize(this);
            sceneController.OnSceneLoaded    += sceneController_OnSceneLoaded;
            sceneController.OnSceneUnloading += sceneController_OnSceneUnloading;
            simObjectController = new SimObjectController(this);

            fixedUpdate = new FullSpeedUpdateListener(sceneController);
            mainTimer.addUpdateListener(fixedUpdate);

            splashScreen.updateStatus(60, "Creating GUI");
            yield return(IdleStatus.Ok);

            propertiesEditor = new PropertiesEditor("Properties", "Anomaly.GUI.Properties", false);
            guiManager.addManagedDialog(propertiesEditor);

            interfaceRenderer = new EditInterfaceRendererController(pluginManager.RendererPlugin, mainTimer, sceneController, propertiesEditor);

            solutionWindow = new SolutionWindow();
            guiManager.addManagedDialog(solutionWindow);

            mainObjectEditor = new PropertiesEditor("Object Editor", "Anomaly.GUI.ObjectEditor", true);
            mainObjectEditor.AllowedDockLocations = DockLocation.Floating;
            mainObjectEditor.CurrentDockLocation  = DockLocation.Floating;
            guiManager.addManagedDialog(mainObjectEditor);

            solutionController = new SolutionController(solution, solutionWindow, this, propertiesEditor);

            //Initialize the windows
            propertiesEditor.AutoExpand = true;

            //Create GUI
            consoleWindow = new LogWindow();
            guiManager.addManagedDialog(consoleWindow);
            Log.Default.addLogListener(consoleWindow);

            debugVisualizer = new DebugVisualizer(pluginManager, sceneController);
            guiManager.addManagedDialog(debugVisualizer);


            if (File.Exists(AnomalyConfig.WindowsFile))
            {
                ConfigFile configFile = new ConfigFile(AnomalyConfig.WindowsFile);
                configFile.loadConfigFile();
                guiManager.loadSavedUI(configFile, new Version("1.0.0.0"));

                //Show Windows Default
                solutionWindow.Visible   = true;
                propertiesEditor.Visible = true;
                consoleWindow.Visible    = true;
                debugVisualizer.Visible  = true;
            }
            else
            {
                //Show Windows Default
                solutionWindow.Visible = true;
                propertiesEditor.showRelativeTo(solutionWindow, WindowAlignment.Right);
                consoleWindow.Visible   = true;
                debugVisualizer.Visible = true;
            }

            yield return(IdleStatus.Ok);

            splashScreen.updateStatus(80, "Building Scene");

            buildScene();
            yield return(IdleStatus.Ok);

            splashScreen.updateStatus(100, "Loaded");

            splashScreen.hide();
            yield return(IdleStatus.Ok);

            if (FullyLoaded != null)
            {
                FullyLoaded.Invoke(this);
            }
        }
		/// <summary>
		/// Parses the input properties <see cref="System.String"/> into a valid
		/// <see cref="Spring.Transaction.Interceptor.ITransactionAttributeSource"/>
		/// instance
		/// </summary>
		/// <param name="attributeSource">The properties string to be parsed.</param>
		public void SetAsText( string attributeSource )
		{
			MethodMapTransactionAttributeSource source = new MethodMapTransactionAttributeSource();
			if ( attributeSource == null || attributeSource.Length == 0 )
			{
				_attributeSource = null;
			} else
			{
				PropertiesEditor editor = new PropertiesEditor(attributeSource);
				TransactionAttributeEditor tae = new TransactionAttributeEditor();

				foreach ( string name in editor.Keys )
				{
					string value = editor[name];
					tae.SetAsText( value );
					ITransactionAttribute transactionAttribute = tae.Value;
					source.AddTransactionalMethod( name, transactionAttribute );
				}
			}
			_attributeSource = source;
		}