Ejemplo n.º 1
0
        public void FillActorTypes()
        {
            int noOfActors = PInvokeDeclarations.GetNoOfActorTypes();

            //Clear currently all the resources
            var items = ActorTypesComboBox.Items;

            items.Clear();


            m_actorTypeList = new string[noOfActors];

            GameActorInfo actorInfo = new GameActorInfo();
            int           sizeofRP  = Marshal.SizeOf(typeof(GameActorInfo));
            IntPtr        pRP       = Marshal.AllocHGlobal(sizeofRP * noOfActors);

            Marshal.StructureToPtr(actorInfo, pRP, false);
            PInvokeDeclarations.GetAllActorTypes(pRP);

            for (int index = 0; index < noOfActors; index++)
            {
                actorInfo = (GameActorInfo)Marshal.PtrToStructure(pRP + (index * Marshal.SizeOf(typeof(GameActorInfo))), typeof(GameActorInfo));
                m_actorTypeList[index] = actorInfo.actorName;
                m_actorList.AddItem(actorInfo.actorName);
            }

            Marshal.FreeHGlobal(pRP);
        }
Ejemplo n.º 2
0
        public void FillWorldViewerListView()
        {
            int noOfActors = PInvokeDeclarations.GetNoOfActors();

            var items = WorldViewerListView.Items;

            items.Clear();
        }
        protected override System.Runtime.InteropServices.HandleRef BuildWindowCore(System.Runtime.InteropServices.HandleRef hwndParent)
        {
            //Create a child window
            m_hwndHost = PInvokeDeclarations.CreateWindowEx(0, "static", "",
                                                            ConstantDefinitions.WS_CHILD | ConstantDefinitions.WS_VISIBLE,
                                                            0, 0,
                                                            m_clientWidth, m_clientHeight,
                                                            hwndParent.Handle,
                                                            (IntPtr)ConstantDefinitions.HOST_ID,
                                                            IntPtr.Zero,
                                                            0);

            //Set the host window handle to the XC_Framework and launch the game, the game will be rendered in the border area assigned.
            IntPtr hInstance = Marshal.GetHINSTANCE(typeof(App).Module);

            PInvokeDeclarations.Launch_AppFramework_Editor(hInstance, m_hwndHost, m_clientWidth, m_clientHeight);

            return(new HandleRef(this, m_hwndHost));
        }
 public virtual Boolean DeleteService(IntPtr serviceHandle)
 {
     return(PInvokeDeclarations.DeleteService(serviceHandle));
 }
 public virtual Boolean CloseServiceHandle(IntPtr handle)
 {
     return(PInvokeDeclarations.CloseServiceHandle(handle));
 }
 public virtual IntPtr OpenService(IntPtr databaseHandle, String serviceName, Int32 access)
 {
     return(PInvokeDeclarations.OpenService(databaseHandle, serviceName, access));
 }
 public virtual IntPtr OpenSCManager(String machineName, String databaseName, Int32 access)
 {
     return(PInvokeDeclarations.OpenSCManager(machineName, databaseName, access));
 }