public RevitClientTheme_Model(IClientInformation clientInformation)
        {
            String filename = $"inBIM.Revit.Resources.{clientInformation.Product.ToString()}{Core.Extensions.Enum_Extensions<Core.Enums.Years>.GetDescription(clientInformation.Year)}.jpg";

            var imageSource = new BitmapImage();

            imageSource.BeginInit();
            imageSource.StreamSource = Assembly.GetExecutingAssembly().GetManifestResourceStream(filename);
            imageSource.EndInit();

            Background = new ImageBrush()
            {
                ImageSource = imageSource
            };

            Bomb         = Brushes.White;
            BorderPen    = new Pen(new SolidColorBrush(Color.FromArgb(255, 70, 109, 192)), 2.0);
            Invader1     = new SolidColorBrush(Color.FromArgb(255, 158, 198, 234));
            Invader2     = new SolidColorBrush(Color.FromArgb(255, 88, 143, 193));
            Invader3     = new SolidColorBrush(Color.FromArgb(255, 56, 82, 131));
            Missile      = Brushes.MediumPurple;
            Player       = Brushes.MediumPurple;
            Saucer       = Brushes.Azure;
            Shield       = new SolidColorBrush(Color.FromArgb(255, 241, 241, 235));
            TextGameOver = Brushes.Red;
            TextTitle    = new SolidColorBrush(Color.FromArgb(255, 70, 109, 192));
            TextValue    = new SolidColorBrush(Color.FromArgb(255, 217, 216, 210));
        }
        public NavisworksClientTheme_Model(IClientInformation clientInformation)
        {
            String filename = $"inBIM.Navisworks.Resources.{clientInformation.Product.ToString()}{Core.Extensions.Enum_Extensions<Core.Enums.Years>.GetDescription(clientInformation.Year)}.jpg";

            var imageSource = new BitmapImage();

            imageSource.BeginInit();
            imageSource.StreamSource = Assembly.GetExecutingAssembly().GetManifestResourceStream(filename);
            imageSource.EndInit();

            Background = new ImageBrush()
            {
                ImageSource = imageSource
            };

            Bomb         = Brushes.White;
            BorderPen    = new Pen(new SolidColorBrush(Color.FromArgb(255, 0, 42, 21)), 2.0);
            Invader1     = new SolidColorBrush(Color.FromArgb(255, 166, 209, 177));
            Invader2     = new SolidColorBrush(Color.FromArgb(255, 76, 155, 93));
            Invader3     = new SolidColorBrush(Color.FromArgb(255, 29, 78, 43));
            Missile      = new SolidColorBrush(Color.FromArgb(255, 34, 56, 110));
            Player       = new SolidColorBrush(Color.FromArgb(255, 34, 56, 110));
            Saucer       = Brushes.Azure;
            Shield       = new SolidColorBrush(Color.FromArgb(255, 241, 241, 235));
            TextGameOver = Brushes.Red;
            TextTitle    = new SolidColorBrush(Color.FromArgb(255, 166, 209, 177));
            TextValue    = new SolidColorBrush(Color.FromArgb(255, 217, 216, 210));
        }
        public AutoCADClientTheme_Model(IClientInformation clientInformation)
        {
            String filename = $"AwesomeAppIdea.AutoCAD.Resources.{clientInformation.Product.ToString()}{Core.Extensions.Enum_Extensions<Core.Enums.Years>.GetDescription(clientInformation.Year)}.jpg";

            var imageSource = new BitmapImage();

            imageSource.BeginInit();
            imageSource.StreamSource = Assembly.GetExecutingAssembly().GetManifestResourceStream(filename);
            imageSource.EndInit();

            Background = new ImageBrush()
            {
                ImageSource = imageSource
            };

            Bomb         = Brushes.White;
            BorderPen    = new Pen(new SolidColorBrush(Color.FromArgb(255, 145, 13, 26)), 2.0);
            Invader1     = new SolidColorBrush(Color.FromArgb(255, 255, 113, 102));
            Invader2     = new SolidColorBrush(Color.FromArgb(255, 198, 42, 44));
            Invader3     = new SolidColorBrush(Color.FromArgb(255, 149, 30, 32));
            Missile      = new SolidColorBrush(Color.FromArgb(255, 34, 56, 110));
            Player       = new SolidColorBrush(Color.FromArgb(255, 34, 56, 110));
            Saucer       = Brushes.Azure;
            Shield       = new SolidColorBrush(Color.FromArgb(255, 241, 241, 235));
            TextGameOver = Brushes.Red;
            TextTitle    = Brushes.Firebrick;
            TextValue    = new SolidColorBrush(Color.FromArgb(255, 217, 216, 210));
        }
Exemple #4
0
        private void SendCallback(IAsyncResult result)
        {
            IClientInformation      toUserInformation = result as IClientInformation;
            ISocketClientConnection toUser            = _SessionMembers.Find(x => x.clientInformation.UniqueID == toUserInformation.UniqueID);

            toUser.userSocket.EndSend(result);
        }
Exemple #5
0
        private void AcceptCallback(IAsyncResult result)
        {
            IClientInformation      userInformation = result.AsyncState as IClientInformation;
            ISocketClientConnection user            = _SessionMembers.Find(x => x.clientInformation.UniqueID == userInformation.UniqueID);

            user.userSocket = _ServerSocket.EndAccept(result);
            ReceiveMessage(user);
        }
Exemple #6
0
 public Client(TcpClient tcpClient, IClientInformation clientInformation)
 {
     ClientInformation = clientInformation;
     _commandQueueService = new CommandQueueService();
     _commandQueueService.OnCommandPending += _commandQueueService_OnCommandPending;
     _tcpClient = tcpClient;
     _clientCommandHandler = new ClientCommandHandler(_tcpClient, new CommandSerializer(), this) { ClientInfomation = clientInformation };
     _commandFactory = new CommandFactory();
     _commandSerializer = new CommandSerializer();
 }
        // ----- Constructors
        public CommandLocator(IModuleManager moduleManager, IClientInformation clientInformation)
        {
            _moduleManager = moduleManager;
            _moduleManager.ModuleLoaded += ModuleManagerOnModuleLoaded;
            _moduleManager.ModuleUnloaded += ModuleManagerOnModuleUnloaded;

            foreach (var module in _moduleManager.GetModules()) {
                if (module.IsLoaded) {
                    LoadCommandsFromModule(module);
                }
            }

            _defaultCommands.Add(typeof(GetClientInformationRequest).Name, new GetInformationCommand());
            _defaultCommands.Add(typeof(GetFullClientInformationRequest).Name, new GetFullInformationCommand());
            _defaultCommands.Add(typeof(PingRequest).Name, new PingCommand());
            _defaultCommands.Add(typeof(AddModuleRequest).Name, new AddModuleCommand(_moduleManager));
            _defaultCommands.Add(typeof(ListModuleRequest).Name, new ListModuleCommand(_moduleManager));
            _defaultCommands.Add(typeof(LoadModuleRequest).Name, new LoadModuleCommand(_moduleManager));
            _defaultCommands.Add(typeof(UnloadModuleRequest).Name, new UnloadModuleCommand(_moduleManager));
            _defaultCommands.Add(typeof(UploadRequest).Name, new UploadCommand(clientInformation));
            _defaultCommands.Add(typeof(DownloadRequest).Name, new DownloadCommand(clientInformation));
        }
Exemple #8
0
        private void ReceiveCallback(IAsyncResult result)
        {
            IClientInformation      userInformation = result as IClientInformation;
            ISocketClientConnection fromUser        = _SessionMembers.Find(x => x.clientInformation.UniqueID == userInformation.UniqueID);

            fromUser.userSocket.EndRecieve(result);
            bool successfulMessage = fromUser.packet.CreateMessage();

            if (successfulMessage)
            {
                try
                {
                    ISocketClientConnection toUser = _SessionMembers.Find(x => x.clientInformation.UniqueID == fromUser.packet.message.RecipientID);
                    SendMessage(toUser, fromUser);
                }
                catch (ArgumentNullException)
                {
                    //log when I get logging implemented
                }
            }
            fromUser.userSocket.BeginReceive(fromUser, ReceiveCallback, fromUser.clientInformation);
        }
Exemple #9
0
        // ----- Constructors
        public CommandLocator(IModuleManager moduleManager, IClientInformation clientInformation)
        {
            _moduleManager = moduleManager;
            _moduleManager.ModuleLoaded   += ModuleManagerOnModuleLoaded;
            _moduleManager.ModuleUnloaded += ModuleManagerOnModuleUnloaded;

            foreach (var module in _moduleManager.GetModules())
            {
                if (module.IsLoaded)
                {
                    LoadCommandsFromModule(module);
                }
            }

            _defaultCommands.Add(typeof(GetClientInformationRequest).Name, new GetInformationCommand());
            _defaultCommands.Add(typeof(GetFullClientInformationRequest).Name, new GetFullInformationCommand());
            _defaultCommands.Add(typeof(PingRequest).Name, new PingCommand());
            _defaultCommands.Add(typeof(AddModuleRequest).Name, new AddModuleCommand(_moduleManager));
            _defaultCommands.Add(typeof(ListModuleRequest).Name, new ListModuleCommand(_moduleManager));
            _defaultCommands.Add(typeof(LoadModuleRequest).Name, new LoadModuleCommand(_moduleManager));
            _defaultCommands.Add(typeof(UnloadModuleRequest).Name, new UnloadModuleCommand(_moduleManager));
            _defaultCommands.Add(typeof(UploadRequest).Name, new UploadCommand(clientInformation));
            _defaultCommands.Add(typeof(DownloadRequest).Name, new DownloadCommand(clientInformation));
        }
        public void InvalidateInformation(IClientInformation client)
        {
            if (client is null)
            {
                throw new ArgumentException(nameof(client));
            }

            IpAddressScreen.Text = IpAddress;

            ListeningPortScreen.Text =
                $"Listening Port: {(client.ListeningPort >= 0 ? client.ListeningPort.ToString() : "None")}";

            IncomingConnectionsScreen.Text = $"Incoming connections: {client.IncomingConnectionsCount}";

            OutcomingConnectionsScreen.Text = $"Outcoming connection: {client.OutcomingConnectionIp ?? "None"}";

            DisconnectButton.IsEnabled = client.HasOutcomingConnection;

            ConnectButton.IsEnabled = !client.HasOutcomingConnection;

            StartListeningButton.IsEnabled = !client.IsListening;

            StopListeningButton.IsEnabled = client.IsListening;
        }
 public DownloadCommand(IClientInformation clientInformation)
 {
     _clientInformation = clientInformation;
 }
 public AutoCADClientInformation_Model(IClientInformation clientInformation, Versions version) : base(clientInformation.Product, clientInformation.Year)
 {
     CurrentVersion = Registry_Helpers.GetCurrentVersion();
     Language       = Application_Helpers.Language();
     Version        = version;
 }
 public UploadCommand(IClientInformation clientInformation)
 {
     _clientInformation = clientInformation;
 }
 // ----- Constructors
 public RemoteServerConnector(IContinuousRequestProcessor continuousRequestProcessor, IClientInformation clientInformation)
 {
     _clientInformation          = clientInformation;
     _continuousRequestProcessor = continuousRequestProcessor;
     _continuousRequestProcessor.ConnectionLost += ContinuousRequestProcessorOnConnectionLost;
 }
 // ----- Constructors
 public RemoteServerConnector(IContinuousRequestProcessor continuousRequestProcessor, IClientInformation clientInformation)
 {
     _clientInformation = clientInformation;
     _continuousRequestProcessor = continuousRequestProcessor;
     _continuousRequestProcessor.ConnectionLost += ContinuousRequestProcessorOnConnectionLost;
 }
 public SocketClientConnection(IClientInformation clientInfo)
 {
     clientInformation = clientInfo;
 }