Exemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            //Anytime we work with the Maestro API, we require an IServerConnection
            //reference. The Maestro.Login.LoginDialog provides a UI to obtain such a
            //reference.

            //If you need to obtain an IServerConnection reference programmatically and
            //without user intervention, use the ConnectionProviderRegistry class
            var login = new Maestro.Login.LoginDialog();

            if (login.ShowDialog() == DialogResult.OK)
            {
                _conn = login.Connection;

                //Connections carry a capability property that tells you what is and isn't supported.
                //Here we need to check if this connection supports the IDrawingService interface. If
                //it doesn't we can't continue.
                if (Array.IndexOf(_conn.Capabilities.SupportedServices, (int)ServiceType.Drawing) < 0)
                {
                    MessageBox.Show("This particular connection does not support the Drawing Service API");
                    Application.Exit();
                    return;
                }

                //For any non-standard service interface, we call GetService() passing in the service type and casting
                //it to the required service interface.
                _dwSvc = (IDrawingService)_conn.GetService((int)ServiceType.Drawing);
            }
            else //This sample does not work without an IServerConnection
            {
                Application.Exit();
            }
        }
Exemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            //Anytime we work with the Maestro API, we require an IServerConnection
            //reference. The Maestro.Login.LoginDialog provides a UI to obtain such a
            //reference.

            //If you need to obtain an IServerConnection reference programmatically and
            //without user intervention, use the ConnectionProviderRegistry class
            var login = new Maestro.Login.LoginDialog();

            if (login.ShowDialog() == DialogResult.OK)
            {
                _conn = login.Connection;
            }
            else //This sample does not work without an IServerConnection
            {
                Application.Exit();
            }
        }
Exemplo n.º 3
0
        protected override void OnLoad(EventArgs e)
        {
            //This call is a one-time only call that will instantly register all known resource
            //version types and validators. This way you never have to manually reference a
            //ObjectModels assembly of the desired resource type you want to work with
            ModelSetup.Initialize();

            //Anytime we work with the Maestro API, we require an IServerConnection
            //reference. The Maestro.Login.LoginDialog provides a UI to obtain such a
            //reference.

            //If you need to obtain an IServerConnection reference programmatically and
            //without user intervention, use the ConnectionProviderRegistry class
            var login = new Maestro.Login.LoginDialog();
            if (login.ShowDialog() == DialogResult.OK)
            {
                _conn = login.Connection;
            }
            else //This sample does not work without an IServerConnection
            {
                Application.Exit();
            }
        }
Exemplo n.º 4
0
        protected override void OnLoad(EventArgs e)
        {
            //This call is a one-time only call that will instantly register all known resource
            //version types and validators. This way you never have to manually reference a
            //ObjectModels assembly of the desired resource type you want to work with
            ModelSetup.Initialize();

            //Anytime we work with the Maestro API, we require an IServerConnection
            //reference. The Maestro.Login.LoginDialog provides a UI to obtain such a
            //reference.

            //If you need to obtain an IServerConnection reference programmatically and
            //without user intervention, use the ConnectionProviderRegistry class
            var login = new Maestro.Login.LoginDialog();
            if (login.ShowDialog() == DialogResult.OK)
            {
                _conn = login.Connection;

                //Connections carry a capability property that tells you what is and isn't supported.
                //Here we need to check if this connection supports the IDrawingService interface. If
                //it doesn't we can't continue.
                if (Array.IndexOf(_conn.Capabilities.SupportedServices, (int)ServiceType.Drawing) < 0)
                {
                    MessageBox.Show("This particular connection does not support the Drawing Service API");
                    Application.Exit();
                    return;
                }

                //For any non-standard service interface, we call GetService() passing in the service type and casting
                //it to the required service interface.
                _dwSvc = (IDrawingService)_conn.GetService((int)ServiceType.Drawing);
            }
            else //This sample does not work without an IServerConnection
            {
                Application.Exit();
            }
        }