Exemplo n.º 1
0
        internal bool LoadServerConfiguration(IGatewayService service)
        {
            Server.ServerConfiguration serverConfiguration;
            IDataSyncronize            message;
            IDataSyncronize            contact;

            serverConfiguration = ObjectPool.Instance.Resolve <Server.ServerConfiguration>();

            message = ObjectPool.Instance.Resolve <MessageCollaborator>();
            contact = ObjectPool.Instance.Resolve <DatabaseCollectionViewSource>();

            //if (serverConfiguration == null) // comment this if you want refresh connection
            {
                if (serverConfiguration == null)
                {
                    serverConfiguration = new Server.ServerConfiguration(service);
                }

                if (message == null)
                {
                    message = new MessageCollaborator();
                }

                if (contact == null)
                {
                    contact = new DatabaseCollectionViewSource();
                }

                message.StartSyncronizing();
                contact.StartSyncronizing();

                ObjectPool.Instance.Register <SMSGatewayWpf.ViewModels.Devices.SMSView>().ImplementedBy(new SMSGatewayWpf.ViewModels.Devices.SMSView());
                ObjectPool.Instance.Register <SMSGatewayWpf.ViewModels.Devices.CallView>().ImplementedBy(new SMSGatewayWpf.ViewModels.Devices.CallView());
                ObjectPool.Instance.Register <SMSGatewayWpf.ViewModels.Devices.PortView>().ImplementedBy(new SMSGatewayWpf.ViewModels.Devices.PortView());
                ObjectPool.Instance.Register <SMSGatewayWpf.ViewModels.Devices.GeneralView>().ImplementedBy(new SMSGatewayWpf.ViewModels.Devices.GeneralView());
            }

            ObjectPool.Instance.Register <Server.ServerConfiguration>().ImplementedBy(serverConfiguration);
            ObjectPool.Instance.Register <MessageCollaborator>().ImplementedBy(message);
            ObjectPool.Instance.Register <DatabaseCollectionViewSource>().ImplementedBy(contact);

            OnConfigurationLoaded();

            // comment due to disabled load configuration server
            //if (serverConfiguration.General == null)
            //    return false;
            //else
            return(true);
        }
Exemplo n.º 2
0
        internal bool LoadServerConfiguration(IGatewayService service)
        {
            Server.ServerConfiguration serverConfiguration;
            IDataSyncronize message;
            IDataSyncronize contact;  
            
            serverConfiguration = ObjectPool.Instance.Resolve<Server.ServerConfiguration>();

            message = ObjectPool.Instance.Resolve<MessageCollaborator>();
            contact = ObjectPool.Instance.Resolve<DatabaseCollectionViewSource>();

            //if (serverConfiguration == null) // comment this if you want refresh connection
            {
                if (serverConfiguration == null)
                    serverConfiguration = new Server.ServerConfiguration(service);

                if (message == null)
                    message = new MessageCollaborator();

                if (contact == null)
                    contact = new DatabaseCollectionViewSource();

                message.StartSyncronizing();
                contact.StartSyncronizing();

                ObjectPool.Instance.Register<SMSGatewayWpf.ViewModels.Devices.SMSView>().ImplementedBy(new SMSGatewayWpf.ViewModels.Devices.SMSView());
                ObjectPool.Instance.Register<SMSGatewayWpf.ViewModels.Devices.CallView>().ImplementedBy(new SMSGatewayWpf.ViewModels.Devices.CallView());
                ObjectPool.Instance.Register<SMSGatewayWpf.ViewModels.Devices.PortView>().ImplementedBy(new SMSGatewayWpf.ViewModels.Devices.PortView());
                ObjectPool.Instance.Register<SMSGatewayWpf.ViewModels.Devices.GeneralView>().ImplementedBy(new SMSGatewayWpf.ViewModels.Devices.GeneralView());
            }

            ObjectPool.Instance.Register<Server.ServerConfiguration>().ImplementedBy(serverConfiguration);
            ObjectPool.Instance.Register<MessageCollaborator>().ImplementedBy(message);
            ObjectPool.Instance.Register<DatabaseCollectionViewSource>().ImplementedBy(contact);

            OnConfigurationLoaded();
                
            // comment due to disabled load configuration server
            //if (serverConfiguration.General == null)
            //    return false;
            //else
            return true;
        }