OpenDatabase() public method

Open a database. This function opens the specified database and updates the user interface.
public OpenDatabase ( IOConnectionInfo ioConnection, CompositeKey cmpKey, bool bOpenLocal ) : void
ioConnection IOConnectionInfo
cmpKey CompositeKey
bOpenLocal bool
return void
Beispiel #1
0
        public static void ProcessGlobalMessage(int nId, MainForm mf)
        {
            if(mf == null) throw new ArgumentNullException("mf");

            IpcParamEx ipcMsg = LoadIpcInfoFile(nId);
            if(ipcMsg == null) return;

            if(ipcMsg.Message == CmdOpenDatabase)
            {
                mf.UIBlockAutoUnlock(true);
                mf.EnsureVisibleForegroundWindow(true, true);
                mf.UIBlockAutoUnlock(false);

                string[] vArgs = CommandLineArgs.SafeDeserialize(ipcMsg.Param0);
                if(vArgs == null) { Debug.Assert(false); return; }

                CommandLineArgs args = new CommandLineArgs(vArgs);
                Program.CommandLineArgs.CopyFrom(args);

                mf.OpenDatabase(IOConnectionInfo.FromPath(args.FileName),
                    KeyUtil.KeyFromCommandLine(Program.CommandLineArgs), true);
            }
            else if(ipcMsg.Message == CmdOpenEntryUrl) OpenEntryUrl(ipcMsg, mf);
            else { Debug.Assert(false); }
        }
Beispiel #2
0
        public static void ProcessGlobalMessage(int nId, MainForm mf)
        {
            if(mf == null) throw new ArgumentNullException("mf");

            IpcParamEx ipcMsg = LoadIpcInfoFile(nId);
            if(ipcMsg == null) return;

            if(ipcMsg.Message == CmdOpenDatabase)
            {
                mf.UIBlockAutoUnlock(true);
                mf.EnsureVisibleForegroundWindow(true, true);
                mf.UIBlockAutoUnlock(false);

                // Don't try to open another database while a dialog
                // is displayed (3489098)
                if(GlobalWindowManager.WindowCount > 0) return;

                string[] vArgs = CommandLineArgs.SafeDeserialize(ipcMsg.Param0);
                if(vArgs == null) { Debug.Assert(false); return; }

                CommandLineArgs args = new CommandLineArgs(vArgs);
                Program.CommandLineArgs.CopyFrom(args);

                mf.OpenDatabase(mf.IocFromCommandLine(), KeyUtil.KeyFromCommandLine(
                    Program.CommandLineArgs), true);
            }
            else if(ipcMsg.Message == CmdOpenEntryUrl) OpenEntryUrl(ipcMsg, mf);
            else { Debug.Assert(false); }
        }