public HostViewContext() { RootPath = GlobalCommon.HostCommon.RootPath; RunTimeLibPath = GlobalCommon.HostCommon.RootPath + HostJsConstants.COMPILED_ROOT_PATH; CommonLibPath = GlobalCommon.HostCommon.RootPath; var viewdoc = new ViewDocument(_currentjse); _hostobject.Add(viewdoc.Name, viewdoc); var console = new ConsoleObject(); _hostobject.Add(console.Name, console); var document = new JsDocument(_currentjse, RootPath); _hostobject.Add(document.Name, document); var loadtag = new LoadParser(); var reftag = new RefParser(); var copytag = new CopyParser(); var outtag = new OutTag(); var hjstag = new HjsTag(); //按照先后处理标签的顺序进行标签处理 _hosttag.Add(loadtag.TagName, loadtag); _hosttag.Add(reftag.TagName, reftag); _hosttag.Add(copytag.TagName, copytag); //out会变为hjs标签 _hosttag.Add(outtag.TagName, outtag); _hosttag.Add(hjstag.TagName, hjstag); }
static void Main(string[] args) { var console = new ConsoleObject(125, 30, "Sample Console"); var section1 = new Section(console, Size.FromRatio(1), Layout.Horizontal); new Section(section1, Size.FromRatio(1), "Section 1A"); new Section(section1, Size.FromRatio(1), "Section 1B"); var section2 = new Section(console, Size.FromRatio(1), "Section 2"); new Section(section2, Size.FromValues(20, 10), "Section 2A"); console.Flush(); while (true) { Thread.Sleep(1000); } }
public static void RegisterAll() { BreakExpression.Register(); ContinueExpression.Register(); ReturnFunctionExpression.Register(); AbsFunction.Register(); ExecuteFile.Register(); PowFunction.Register(); ProductFunction.Register(); HelpFunction.Register(); SqrtFunction.Register(); SumDeepFunction.Register(); SumFunction.Register(); LengthFunction.Register(); ConsoleObject.Register(); TrigonometryObject.Register(); ThisConstant.Register(); BooleanValue.Register(); ComplexValue.Register(); DecimalValue.Register(); NullValue.Register(); }
/// <summary> /// The on context created. /// </summary> /// <param name="browser"> /// The browser. /// </param> /// <param name="frame"> /// The frame. /// </param> /// <param name="context"> /// The context. /// </param> protected override void OnContextCreated(CefBrowser browser, CefFrame frame, CefV8Context context) { #region Initialize var global = context.GetGlobal(); #endregion #region Exposed CefV8Value exposed = CefV8Value.CreateObject(); global.SetValue("exposed", exposed, CefV8PropertyAttribute.None); #endregion #region Cef Assembly var extension = new CefAssembly(browser, frame, context); extension.CreateObject(global, new List <string>() { "mscorlib", "System", "System.Core" }); //extension.CreateObject(global, AppDomain.CurrentDomain.GetAssemblies().Where(s => //{ // if (s.GetName().Name.StartsWith("blis")) return true; // return false; //}) //.Select(s => s.GetName().Name).ToList()); #endregion #region Custom XHR var xhr = new xhrObject(browser, frame, context); global.SetValue("xHttpRequest", xhr.CreateObject(), CefV8PropertyAttribute.None); #endregion #region V8 Engine API var v8Engine = new V8EngineObject(browser, frame, context); global.SetValue("V8Engine", v8Engine.CreateObject(), CefV8PropertyAttribute.None); #endregion #region Database API var database = new DatabaseObject(browser, frame, context); global.SetValue("DB", database.CreateObject(), CefV8PropertyAttribute.None); #endregion #region Console API var console = new ConsoleObject(browser, frame, context); global.SetValue("Console", database.CreateObject(), CefV8PropertyAttribute.None); #endregion #region Window API var window = new WindowObject(browser, frame, context); global.SetValue("Window", window.CreateObject(), CefV8PropertyAttribute.None); #endregion #region Server API var server = new ServerObject(browser, frame, context, this); global.SetValue("Server", server.CreateObject(), CefV8PropertyAttribute.None); #endregion #region ChromeDevToosProtocol Object var chromeDevToolsProtocol = new ChromeDevToolsProtocol(browser, frame, context); global.SetValue("DevTools", chromeDevToolsProtocol.CreateObject(), CefV8PropertyAttribute.None); #endregion #region OnContextCreated MessageRouter.OnContextCreated(browser, frame, context); context.Dispose(); #endregion }
/// <summary> /// Container Class for all the properties for organization. /// </summary> /// <param name="c"></param> public TorqueScriptTemplate(ref dnTorque c) { m_ts = c; _mConsoleobject = new ConsoleObject(ref c); _mMathobject = new tMath(ref c); _mUtil = new UtilObject(ref c); _mHTTPObject = new HTTPObjectObject(ref c); _mTCPObject = new TCPObjectObject(ref c); _mDynamicConsoleMethodComponent = new DynamicConsoleMethodComponentObject(ref c); _mSimComponent = new SimComponentObject(ref c); _mArrayObject = new ArrayObjectObject(ref c); _mConsoleLogger = new ConsoleLoggerObject(ref c); _mFieldBrushObject = new FieldBrushObjectObject(ref c); _mPersistenceManager = new PersistenceManagerObject(ref c); _mSimDataBlock = new SimDataBlockObject(ref c); _mSimObject = new SimObjectObject(ref c); _mSimPersistSet = new SimPersistSetObject(ref c); _mSimSet = new SimSetObject(ref c); _mSimXMLDocument = new SimXMLDocumentObject(ref c); _mFileObject = new FileObjectObject(ref c); _mFileStreamObject = new FileStreamObjectObject(ref c); _mStreamObject = new StreamObjectObject(ref c); _mZipObject = new ZipObjectObject(ref c); _mDecalRoad = new DecalRoadObject(ref c); _mMeshRoad = new MeshRoadObject(ref c); _mRiver = new RiverObject(ref c); _mScatterSky = new ScatterSkyObject(ref c); _mSkyBox = new SkyBoxObject(ref c); _mSun = new SunObject(ref c); _mGuiRoadEditorCtrl = new GuiRoadEditorCtrlObject(ref c); _mForest = new ForestObject(ref c); _mForestWindEmitter = new ForestWindEmitterObject(ref c); _mForestBrush = new ForestBrushObject(ref c); _mForestBrushTool = new ForestBrushToolObject(ref c); _mForestEditorCtrl = new ForestEditorCtrlObject(ref c); _mForestSelectionTool = new ForestSelectionToolObject(ref c); _mCubemapData = new CubemapDataObject(ref c); _mDebugDrawer = new DebugDrawerObject(ref c); _mGuiTSCtrl = new GuiTSCtrlObject(ref c); _mGuiBitmapButtonCtrl = new GuiBitmapButtonCtrlObject(ref c); _mGuiButtonBaseCtrl = new GuiButtonBaseCtrlObject(ref c); _mGuiCheckBoxCtrl = new GuiCheckBoxCtrlObject(ref c); _mGuiIconButtonCtrl = new GuiIconButtonCtrlObject(ref c); _mGuiSwatchButtonCtrl = new GuiSwatchButtonCtrlObject(ref c); _mGuiToolboxButtonCtrl = new GuiToolboxButtonCtrlObject(ref c); _mGuiAutoScrollCtrl = new GuiAutoScrollCtrlObject(ref c); _mGuiDynamicCtrlArrayControl = new GuiDynamicCtrlArrayControlObject(ref c); _mGuiFormCtrl = new GuiFormCtrlObject(ref c); _mGuiFrameSetCtrl = new GuiFrameSetCtrlObject(ref c); _mGuiPaneControl = new GuiPaneControlObject(ref c); _mGuiRolloutCtrl = new GuiRolloutCtrlObject(ref c); _mGuiScrollCtrl = new GuiScrollCtrlObject(ref c); _mGuiStackControl = new GuiStackControlObject(ref c); _mGuiTabBookCtrl = new GuiTabBookCtrlObject(ref c); _mGuiBitmapCtrl = new GuiBitmapCtrlObject(ref c); _mGuiColorPickerCtrl = new GuiColorPickerCtrlObject(ref c); _mGuiDirectoryFileListCtrl = new GuiDirectoryFileListCtrlObject(ref c); _mGuiFileTreeCtrl = new GuiFileTreeCtrlObject(ref c); _mGuiGameListMenuCtrl = new GuiGameListMenuCtrlObject(ref c); _mGuiGameListOptionsCtrl = new GuiGameListOptionsCtrlObject(ref c); _mGuiGradientCtrl = new GuiGradientCtrlObject(ref c); _mGuiListBoxCtrl = new GuiListBoxCtrlObject(ref c); _mGuiMaterialCtrl = new GuiMaterialCtrlObject(ref c); _mGuiMLTextCtrl = new GuiMLTextCtrlObject(ref c); _mGuiPopUpMenuCtrl = new GuiPopUpMenuCtrlObject(ref c); _mGuiPopUpMenuCtrlEx = new GuiPopUpMenuCtrlExObject(ref c); _mGuiSliderCtrl = new GuiSliderCtrlObject(ref c); _mGuiTabPageCtrl = new GuiTabPageCtrlObject(ref c); _mGuiTextCtrl = new GuiTextCtrlObject(ref c); _mGuiTextEditCtrl = new GuiTextEditCtrlObject(ref c); _mGuiTextListCtrl = new GuiTextListCtrlObject(ref c); _mGuiTreeViewCtrl = new GuiTreeViewCtrlObject(ref c); _mGuiCanvas = new GuiCanvasObject(ref c); _mGuiControl = new GuiControlObject(ref c); _mGuiControlProfile = new GuiControlProfileObject(ref c); _mDbgFileView = new DbgFileViewObject(ref c); _mGuiEditCtrl = new GuiEditCtrlObject(ref c); _mGuiFilterCtrl = new GuiFilterCtrlObject(ref c); _mGuiGraphCtrl = new GuiGraphCtrlObject(ref c); _mGuiImageList = new GuiImageListObject(ref c); _mGuiInspector = new GuiInspectorObject(ref c); _mGuiInspectorTypeFileName = new GuiInspectorTypeFileNameObject(ref c); _mGuiInspectorTypeBitMask32 = new GuiInspectorTypeBitMask32Object(ref c); _mGuiMenuBar = new GuiMenuBarObject(ref c); _mGuiParticleGraphCtrl = new GuiParticleGraphCtrlObject(ref c); _mGuiShapeEdPreview = new GuiShapeEdPreviewObject(ref c); _mGuiInspectorDynamicField = new GuiInspectorDynamicFieldObject(ref c); _mGuiInspectorDynamicGroup = new GuiInspectorDynamicGroupObject(ref c); _mGuiInspectorField = new GuiInspectorFieldObject(ref c); _mGuiVariableInspector = new GuiVariableInspectorObject(ref c); _mGuiMessageVectorCtrl = new GuiMessageVectorCtrlObject(ref c); _mGuiProgressBitmapCtrl = new GuiProgressBitmapCtrlObject(ref c); _mGuiTickCtrl = new GuiTickCtrlObject(ref c); _mGuiTheoraCtrl = new GuiTheoraCtrlObject(ref c); _mMessageVector = new MessageVectorObject(ref c); _mEditTSCtrl = new EditTSCtrlObject(ref c); _mGuiMissionAreaCtrl = new GuiMissionAreaCtrlObject(ref c); _mMECreateUndoAction = new MECreateUndoActionObject(ref c); _mMEDeleteUndoAction = new MEDeleteUndoActionObject(ref c); _mWorldEditor = new WorldEditorObject(ref c); _mLangTable = new LangTableObject(ref c); _mPathedInterior = new PathedInteriorObject(ref c); _mMaterial = new MaterialObject(ref c); _mSimResponseCurve = new SimResponseCurveObject(ref c); _mMenuBar = new MenuBarObject(ref c); _mPopupMenu = new PopupMenuObject(ref c); _mFileDialog = new FileDialogObject(ref c); _mPostEffect = new PostEffectObject(ref c); _mRenderBinManager = new RenderBinManagerObject(ref c); _mRenderPassManager = new RenderPassManagerObject(ref c); _mRenderPassStateToken = new RenderPassStateTokenObject(ref c); _mSceneObject = new SceneObjectObject(ref c); _mSFXController = new SFXControllerObject(ref c); _mSFXParameter = new SFXParameterObject(ref c); _mSFXProfile = new SFXProfileObject(ref c); _mSFXSource = new SFXSourceObject(ref c); _mActionMap = new ActionMapObject(ref c); _mNetConnection = new NetConnectionObject(ref c); _mNetObject = new NetObjectObject(ref c); _mAIClient = new AIClientObject(ref c); _mAIConnection = new AIConnectionObject(ref c); _mAIPlayer = new AIPlayerObject(ref c); _mCamera = new CameraObject(ref c); _mDebris = new DebrisObject(ref c); _mGroundPlane = new GroundPlaneObject(ref c); _mGuiMaterialPreview = new GuiMaterialPreviewObject(ref c); _mGuiObjectView = new GuiObjectViewObject(ref c); _mItem = new ItemObject(ref c); _mLightBase = new LightBaseObject(ref c); _mLightDescription = new LightDescriptionObject(ref c); _mLightFlareData = new LightFlareDataObject(ref c); _mMissionArea = new MissionAreaObject(ref c); _mSpawnSphere = new SpawnSphereObject(ref c); _mPathCamera = new PathCameraObject(ref c); _mPhysicalZone = new PhysicalZoneObject(ref c); _mPlayer = new PlayerObject(ref c); _mPortal = new PortalObject(ref c); _mProjectile = new ProjectileObject(ref c); _mProximityMine = new ProximityMineObject(ref c); _mShapeBaseData = new ShapeBaseDataObject(ref c); _mShapeBase = new ShapeBaseObject(ref c); _mStaticShape = new StaticShapeObject(ref c); _mTrigger = new TriggerObject(ref c); _mTSStatic = new TSStaticObject(ref c); _mZone = new ZoneObject(ref c); _mRenderMeshExample = new RenderMeshExampleObject(ref c); _mLightning = new LightningObject(ref c); _mParticleData = new ParticleDataObject(ref c); _mParticleEmitterData = new ParticleEmitterDataObject(ref c); _mParticleEmitterNode = new ParticleEmitterNodeObject(ref c); _mPrecipitation = new PrecipitationObject(ref c); _mGameBase = new GameBaseObject(ref c); _mGameConnection = new GameConnectionObject(ref c); _mPhysicsDebrisData = new PhysicsDebrisDataObject(ref c); _mPhysicsForce = new PhysicsForceObject(ref c); _mPhysicsShape = new PhysicsShapeObject(ref c); _mAITurretShape = new AITurretShapeObject(ref c); _mTurretShape = new TurretShapeObject(ref c); _mFlyingVehicle = new FlyingVehicleObject(ref c); _mWheeledVehicle = new WheeledVehicleObject(ref c); _mTerrainBlock = new TerrainBlockObject(ref c); _mSettings = new SettingsObject(ref c); _mCompoundUndoAction = new CompoundUndoActionObject(ref c); _mUndoManager = new UndoManagerObject(ref c); _mUndoAction = new UndoActionObject(ref c); _mEventManager = new EventManagerObject(ref c); _mMessage = new MessageObject(ref c); }
/// <summary> /// Remove a child (and all of its sub-children) /// </summary> public void RemoveChild(ConsoleObject consoleObject) { Children.Remove(consoleObject); try { consoleObject.Clear(); consoleObject.Parent = null; Draw(); } catch { } }
/// <summary> /// Add and draw a child object (if object chain is valid) /// </summary> public void AddChild(ConsoleObject consoleObject) { Children.Add(consoleObject); consoleObject.Parent = this; try { Draw(); } catch {} }