コード例 #1
0
ファイル: ProjectListAdapter.cs プロジェクト: uthens/mobile
            public void Bind(ProjectsCollection.SuperProjectData projectData, bool showClient)
            {
                this.projectData = projectData;

                if (projectData.IsEmpty)
                {
                    var emptyColor = ColorView.Resources.GetColor(Resource.Color.dark_gray_text);
                    ColorView.SetBackgroundColor(emptyColor);
                    ProjectTextView.SetTextColor(emptyColor);
                    ClientTextView.SetTextColor(emptyColor);

                    ProjectTextView.SetText(Resource.String.ProjectsNoProject);
                    ClientTextView.Visibility = ViewStates.Gone;
                    TasksButton.Visibility    = ViewStates.Gone;
                    return;
                }

                var color = Color.ParseColor(ProjectModel.HexColors [projectData.Color % ProjectModel.HexColors.Length]);

                ColorView.SetBackgroundColor(color);
                ProjectTextView.SetTextColor(color);
                ClientTextView.SetTextColor(color);

                ProjectTextView.Text      = projectData.Name;
                ClientTextView.Text       = projectData.ClientName;
                ClientTextView.Visibility = showClient ? ViewStates.Visible : ViewStates.Gone;
                TasksButton.Visibility    = projectData.TaskNumber > 0 ? ViewStates.Visible : ViewStates.Gone;
                TasksButton.Selected      = false;
            }
コード例 #2
0
            protected async override void Rebind()
            {
                // Protect against Java side being GCed
                if (Handle == IntPtr.Zero)
                {
                    return;
                }

                model = null;
                if (DataSource != null)
                {
                    model = (ProjectModel)DataSource.Data;
                }

                if (model == null)
                {
                    ColorView.SetBackgroundColor(ColorView.Resources.GetColor(Resource.Color.dark_gray_text));
                    ProjectTextView.SetText(Resource.String.ProjectsNoProject);
                    ClientTextView.Visibility = ViewStates.Gone;
                    TasksButton.Visibility    = ViewStates.Gone;
                    return;
                }

                await model.LoadAsync();

                var color = Color.ParseColor(model.GetHexColor());

                ColorView.SetBackgroundColor(color);
                ProjectTextView.SetTextColor(color);
                ClientTextView.SetTextColor(color);

                ProjectTextView.Text = model.Name;
                if (model.Client != null)
                {
                    ClientTextView.Text       = model.Client.Name;
                    ClientTextView.Visibility = ViewStates.Visible;
                }
                else
                {
                    ClientTextView.Visibility = ViewStates.Gone;
                }

                TasksButton.Visibility = DataSource.Tasks.Count == 0 ? ViewStates.Gone : ViewStates.Visible;
                TasksButton.Selected   = false;
            }
コード例 #3
0
        private void initAndConnect(string ip, short port, string nickname)
        {
            currentIP = ip;
            GTA.Native.Function.Call("DISABLE_PAUSE_MENU", 1);
            GTA.Native.Function.Call("SET_FILTER_MENU_ON", 1);
            BroadcastingPaused = true;
            playerNames = new Dictionary<uint, string>();
            playerModels = new Dictionary<uint, string>();
            isCurrentlyDead = false;
            actionQueue = new Queue<Action>();
            instance = this;

            jsEngine = new JavaScriptEngine();

            CurrentVirtualWorld = 0;

            cameraController = new CameraController(this);

            debugDraw = new ClientTextView(new System.Drawing.PointF(10, 400), "", new GTA.Font("Segoe UI", 24, FontScaling.Pixel), System.Drawing.Color.White);

            pedStreamer = new PedStreamer(this, 100.0f);
            vehicleStreamer = new VehicleStreamer(this, 100.0f);

            pedController = new PlayerPedController();
            npcPedController = new NPCPedController();
            vehicleController = new VehicleController();
            playerVehicleController = new PlayerVehicleController();
            chatController = new ChatController(this);
            keyboardHandler = new KeyboardHandler(this);
            currentState = ClientState.Initializing;
            Interval = 80;
            //cam = new Camera();
            //cam.Activate();
            currentState = ClientState.Disconnected;
            System.IO.File.WriteAllText("multiv-log.txt", "");
            perFrameRenderer = new PerFrameRenderer(this);

            Player.Character.CurrentRoom = Room.FromString("R_00000000_00000000");

            startTimersandBindEvents();
            try
            {
                if (client != null && client.Connected)
                {
                    client.Close();
                }
                client = new TcpClient();
                IPAddress address = IPAddress.Parse(ip);
                nick = nickname;

                client.Connect(address, port);

                Client.currentData = UpdateDataStruct.Zero;

                serverConnection = new ServerConnection(this);

                World.CurrentDayTime = new TimeSpan(12, 00, 00);
                World.PedDensity = 0;
                World.CarDensity = 0;
                // AlternateHook.call(AlternateHook.OtherCommands.TERMINATE_ALL_SCRIPTS_FOR_NETWORK_GAME);
                GTA.Native.Function.Call("CLEAR_AREA", 0.0f, 0.0f, 0.0f, 4000.0f, true);
                currentState = ClientState.Connecting;
            }
            catch
            {
                currentState = ClientState.Disconnected;
                if (client != null && client.Connected)
                {
                    client.Close();
                }
                throw;
            }
        }
コード例 #4
0
 public override void StreamOut()
 {
     if (blip != null && blip.Exists()) blip.Delete();
     if (nickDraw != null) nickDraw.destroy();
     if (healthDraw != null) healthDraw.destroy();
     if (healthDraw2 != null) healthDraw2.destroy();
     if (carHealthDraw != null) carHealthDraw.destroy();
     if (carHealthDraw2 != null) carHealthDraw2.destroy();
     if (chatDraw != null) chatDraw.destroy();
     if (iconDraw != null) iconDraw.destroy();
     nickDraw = null;
     if (gameReference != null && gameReference.Exists()) gameReference.Delete();
     gameReference = null;
     hasNetworkName = false;
 }