Example #1
0
        public ComponentDrawing(
            IDebugDrawing drawing,
            DrawingElement page,
            DebugComponent debugComponent,
            int headingLevel,
            bool showButtons)
            : base(
                page,
                "Component '" + debugComponent.Name + "'",
                headingLevel)
        {
            CssClass = "component";

            var details = new List <string>();

            AddDebugInfo(details, debugComponent);

            if (details.Count > 0)
            {
                if (showButtons)
                {
                    AddDetails(details, AddHeaderButton(page, "Detail"));
                }
                else
                {
                    AddDetails(details, this);
                }
            }

            if (showButtons && !ReferenceEquals(debugComponent.Element, null))
            {
                var elementDebugInfo = debugComponent.Element.GetDebugInfo <DebugComponent>();
                if (elementDebugInfo != null && elementDebugInfo.HasData())
                {
                    AddHeaderButton(page, "Definition")
                    .AddChild(new ComponentDrawing(
                                  drawing,
                                  page,
                                  elementDebugInfo,
                                  headingLevel + 1,
                                  false));
                }
            }
        }
        public override void Initialize(SharpDX.Direct3D11.DeviceContext context)
        {
            var guiManager          = _iocContainer.Get <GuiManager>();
            var inputManager        = _iocContainer.Get <InputsManager>();
            var generalSoundManager = _iocContainer.Get <GeneralSoundManager>();
            var watermark           = _iocContainer.Get <VersionWatermark>();

            DebugComponent debugComponent = null;

            if (Program.ShowDebug)
            {
                debugComponent = _iocContainer.Get <DebugComponent>(new ConstructorArgument("withDisplayInfoActivated", true));
            }

            //Init Common GUI Menu resources
            var commonResources = _iocContainer.Get <SandboxCommonResources>();

            commonResources.LoadFontAndMenuImages(_iocContainer.Get <D3DEngine>());

            //Init MSAA list
            InitMSAASystemList();

            //Init RuntimeVariables
            var vars = _iocContainer.Get <RealmRuntimeVariables>();

            vars.ApplicationDataPath = XmlSettingsManager.GetFilePath("", SettingsStorage.ApplicationData);

            //"Late Binding" of IVoxelModelStorage, must be done after vars is initialized
            _iocContainer.Bind <IVoxelModelStorage>().To <ModelSQLiteStorage>().InSingletonScope().WithConstructorArgument("fileName", Path.Combine(vars.ApplicationDataPath, "Common", "models.db"));

            var storage = (ModelSQLiteStorage)_iocContainer.Get <IVoxelModelStorage>();

            storage.ImportFromPath("Models");

            AddComponent(watermark);
            AddComponent(debugComponent);
            AddComponent(guiManager);
            AddComponent(inputManager);
            AddComponent(generalSoundManager);
            base.Initialize(context);
        }
 private void WriteHtml(IHtmlWriter html, DebugComponent component, int depth)
 {
 }