Ejemplo n.º 1
0
        public static void MinecraftThread()
        {
            bool minecraft_loggedin = false;

            minecraftItemsToSend = new List <MinecraftItem>();

            IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 25575);
            Socket     s        = new Socket(endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

            try {
                s.Bind(endPoint);
                s.Listen(10);
                Socket handler = s.Accept();
                //Get data
                string json = Receive(handler);
                Console.WriteLine(json);

                //Send response
                Dictionary <object, object> command_body = new Dictionary <object, object>();
                command_body.Add("result", "true");
                BridgeCommand bc = new BridgeCommand("login", command_body);
                Send(handler, bc);
                minecraft_loggedin = true;
                if (handler.Connected && minecraft_loggedin)
                {
                    Thread outputThread = new Thread(OutputThread);
                    Thread inputThread  = new Thread(InputThread);
                    outputThread.Start(handler);
                    inputThread.Start(handler);
                }
            }
            catch (Exception e) {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 2
0
        public void Execute(CommandAction action)
        {
            List <Project> projects = AllProjects.ToList();

            if (projects.Count == 0)
            {
                return;
            }

            BridgeCommand.ActivateBridgeVsOnSolution(action, projects, SolutionName, _application.Version, _application.Edition);
        }
Ejemplo n.º 3
0
        private CommandStates GetStatus(CommandAction action)
        {
            CommandStates result = CommandStates.Visible;

            bool isBridgeVsConfigured = PackageConfigurator.IsBridgeVsConfigured(_application.Version);

            if (!isBridgeVsConfigured)
            {
                return(result); //just show it as visible
            }
            bool isSolutionEnabled = BridgeCommand.IsSolutionEnabled(SolutionName, _application.Version);

            if (isSolutionEnabled && action == CommandAction.Disable || !isSolutionEnabled && action == CommandAction.Enable)
            {
                result |= CommandStates.Enabled;
            }

            return(result);
        }
Ejemplo n.º 4
0
        public void Execute(CommandAction action)
        {
            List <Project> projects = AllProjects.ToList();

            if (projects.Count == 0)
            {
                return;
            }

            if (BridgeCommand.IsEveryProjectSupported(projects, _application.Version, _application.Edition))
            {
                BridgeCommand.ActivateBridgeVsOnSolution(action, projects, SolutionName, _application.Version,
                                                         _application.Edition);
            }
            else
            {
                string message = $@"Solution {SolutionName} contains one or more un-supported projects. ASP.NET Core, .NET Core, .NET standard and UAP are not supported by LINQBridgeVs.";
                MessageBox.Show(message);
            }
        }
Ejemplo n.º 5
0
        public void Execute(CommandAction action)
        {
            Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
            List <Project> projects = AllProjects.ToList();

            if (projects.Count == 0)
            {
                return;
            }

            if (BridgeCommand.IsEveryProjectSupported(projects, _application.Version, _application.Edition))
            {
                BridgeCommand.ActivateBridgeVsOnSolution(action, projects, SolutionName, _application.Version,
                                                         _application.Edition, Path.GetDirectoryName(_application.Solution.FileName));
            }
            else
            {
                string message = $@"Solution {SolutionName} contains one or more un-supported projects. ASP.NET Core, .NET Core, .NET standard and UAP are not supported by LINQBridgeVs.";
                System.Windows.MessageBox.Show(message);
            }
        }