public LoginView()
 {
     InitializeComponent();
     App app = (App)System.Windows.Application.Current;
     ObjectDataProvider odp = (ObjectDataProvider)app.Resources["ChatModel"];
     _model = (ChatModel)odp.Data;
     _coordinator = app.getCoordinator();
 }
Example #2
0
        private void AppStartup(object sender, StartupEventArgs e)
        {
            PlatformID id = Environment.OSVersion.Platform;
            bool windows = id == PlatformID.Win32NT || id  == PlatformID.Win32S || id == PlatformID.Win32Windows ||
                           id == PlatformID.WinCE;
            if(windows)
            {
                RegistryKey netKey = Registry.LocalMachine.OpenSubKey(
                                                        "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Client");
                if(netKey != null)
                {
                    _hasNetFramework = (int)netKey.GetValue("Install") == 1;
                }

                if(!_hasNetFramework)
                {
                    netKey = Registry.LocalMachine.OpenSubKey(
                                                        "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full");
                    if(netKey != null)
                    {
                        _hasNetFramework = (int)netKey.GetValue("Install") == 1;
                    }
                }

                if(!_hasNetFramework)
                {
                    netKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v3.5");
                    if(netKey != null)
                    {
                        _hasNetFramework = (int)netKey.GetValue("Install") == 1;
                    }
                }
            }

            if(_hasNetFramework)
            {
                _coordinator = new Coordinator(e.Args);
            }
            else
            {
                string errorMessage = "Chat Demo \n" +
                    "You need to install Microsoft .NET Framework v3.5 or higher on a Windows OS in order to run " +
                    "this application.\n" +
                    "Refer to the README file in your Chat Demo distribution for more information.";
                string caption = "Chat Demo - Error";
                MessageBoxImage icon = MessageBoxImage.Error;
                MessageBoxButton button = MessageBoxButton.OK;
                MessageBox.Show(errorMessage, caption, button, icon);
                Shutdown(-1);
            }
        }
 public ChatRoomCallbackI(Coordinator coordinator)
 {
     _coordinator = coordinator;
 }
 public ChatView()
 {
     InitializeComponent();
     _coordinator = ((App)System.Windows.Application.Current).getCoordinator();
     _coordinator.setChatView(this);
 }
Example #5
0
 public AMI_ChatSession_sendI(Coordinator coordinator, string name, string message)
 {
     _coordinator = coordinator;
     _name = name;
     _message = message;
 }
Example #6
0
 private void AppStartup(object sender, StartupEventArgs e)
 {
     _coordinator = new Coordinator(e.Args);
 }
Example #7
0
 public ChatRoomCallbackI(Coordinator coordinator)
 {
     _coordinator = coordinator;
 }
Example #8
0
 public AMI_ChatSession_sendI(Coordinator coordinator, string name, string message)
 {
     _coordinator = coordinator;
     _name        = name;
     _message     = message;
 }