Пример #1
0
        /// <summary>
        /// Initialize the MetaTableFactory
        /// </summary>

        public static void Initialize()
        {
            if (ServiceFacade.UseRemoteServices)
            {
                Services.Native.INativeSession nativeClient = ServiceFacade.CreateNativeSessionProxy();
                Services.Native.NativeMethodTransportObject resultObject =
                    nativeClient.InvokeNativeMethod(
                        (int)Services.Native.ServiceCodes.MobiusMetaTableService,
                        (int)Services.Native.ServiceOpCodes.MobiusMetaTableService.Initialize,
                        new Mobius.Services.Native.NativeMethodTransportObject(new object[] { false }));
                ((System.ServiceModel.IClientChannel)nativeClient).Close();
                return;
            }

            else
            {
                Mfn.MetaTableFactory.Initialize();
            }
        }
Пример #2
0
        /// <summary>
        /// Load/reload from specified file
        /// </summary>

        public void BuildFromFile(string fileName)
        {
            if (ServiceFacade.UseRemoteServices)
            {
                MetaTableCollection.Reset();                 // reset local collection

                string serverFile = ServerFile.GetTempFileName(".xml", true);
                ServerFile.CopyToServer(fileName, serverFile);
                Services.Native.INativeSession nativeClient = ServiceFacade.CreateNativeSessionProxy();
                Services.Native.NativeMethodTransportObject resultObject =
                    nativeClient.InvokeNativeMethod(
                        (int)Services.Native.ServiceCodes.MobiusMetaTableService,
                        (int)Services.Native.ServiceOpCodes.MobiusMetaTableService.BuildFromFile,
                        new Mobius.Services.Native.NativeMethodTransportObject(new object[] { serverFile }));
                ((System.ServiceModel.IClientChannel)nativeClient).Close();
            }

            else             // just do local build
            {
                Mobius.MetaFactoryNamespace.MetaTableFactory.BuildFromXmlFile(fileName);
            }
        }