Example #1
0
        public void Dispel(/*source?*/)
        {
            if (state != StatusState.Active)
            {
                return;
            }
            bool isDispelled = true;

            for (int i = 0; i < components.Count; i++)
            {
                bool actionResult = components[i].OnDispelAttempted();     //pass dispel context? prolly
                if (!actionResult && isDispelled)
                {
                    isDispelled = actionResult;
                }
            }
            if (IsDispellable && isDispelled)
            {
                state = StatusState.Dispelled;
                for (int i = 0; i < components.Count; i++)
                {
                    components[i].OnEffectDispelled();
                }
            }
        }
Example #2
0
        //----------------------------------------------------------------------
        protected PathNode(PathNode parent, string name)
        {
            Id      = Interlocked.Increment(ref _lastid);
            Parent  = parent;
            Name    = name;
            _status = StatusState.Normal;

            if (Parent == null)
            {
                Root = (PathRoot)this;
                Path = string.Empty;
            }
            else
            {
                Root = Parent.Root;
                if (Parent.Parent == null)
                {
                    Path = Name;
                }
                else
                {
                    Path = string.Concat(Parent.Path, "/", Name);
                }
            }

            _children          = new Dictionary <string, PathNode>(StringComparer.InvariantCultureIgnoreCase);
            _monitors          = new Dictionary <string, Monitor>(StringComparer.InvariantCultureIgnoreCase);
            _pathSubscriptions = new SubscriptionManager <StatusEvent>();
        }
Example #3
0
        //----------------------------------------------------------------------
        public bool UpdateMonitor(string path, string name, string text, StatusState status, TimeSpan validity, TimeSpan expiration, bool beat)
        {
            string[] parts;
            PathNode node;

            if (status < StatusState.Normal || status > StatusState.Critical)
            {
                return(false);
            }

            if (name == null)
            {
                return(false);
            }

            if ((parts = BreakPath(path)) == null)
            {
                return(false);
            }

            lock (_root)
            {
                node = _root.GetNode(parts, true);
                node.UpdateMonitor(name, text, status, validity, expiration, beat);
            }
            return(true);
        }
Example #4
0
 public MarioState(Player myGameObject, Sprites.IMarioSprite mySprite)
 {
     this.myGameObject         = myGameObject;
     this.currentMovementState = MovementState.LookingRight;
     this.currentStatusState   = StatusState.Small;
     this.mySprite             = mySprite;
 }
Example #5
0
        private void ApplyWorkOrderListFilter(dal.WorkOrder WorkOrder)
        {
            if (WorkOrder == null)
            {
                return;
            }
            StatusState currentState = StatusState.All;

            try {
                currentState = (StatusState)Enum.Parse(typeof(StatusState), lbStatus.SelectedItem.ToString());
            }
            catch { }

            string selectedPilot = "ALL";

            try {
                selectedPilot = lbPilot.SelectedItem.ToString();
            }
            catch { }
            selectedPilot = selectedPilot.ToUpper();

            if (
                (currentState == StatusState.All)
                ||
                (WorkOrder.Complete && currentState == StatusState.Complete)
                ||
                (WorkOrder.Started && currentState == StatusState.WIP)
                ||
                (!WorkOrder.Started && currentState == StatusState.Open)
                )
            {
                if (
                    selectedPilot == "ALL" ||
                    WorkOrder.AssignedPilot.ToUpper() == selectedPilot)
                {
                    bool found = false;
                    foreach (dal.WorkOrder wo in lbWorkOrder.Items)
                    {
                        if (wo.OriginalFilePath.ToUpper() == WorkOrder.OriginalFilePath.ToUpper())
                        {
                            found = true;
                            break;
                        }
                    }
                    if (!found)
                    {
                        if (lbWorkOrder.InvokeRequired)
                        {
                            lbWorkOrder.Invoke((MethodInvoker) delegate {
                                lbWorkOrder.Items.Add(WorkOrder);
                            });
                        }
                        else
                        {
                            lbWorkOrder.Items.Add(WorkOrder);
                        }
                    }
                }
            }
        }
Example #6
0
 public void BeDead()
 {
     if (currentStatusState != StatusState.Dead)
     {
         currentStatusState = StatusState.Dead;
     }
 }
 private void UpdateStatusState(StatusState state)
 {
     SetLEDState(LEDs.LED1, state.LEDs);
     SetLEDState(LEDs.LED2, state.LEDs);
     SetLEDState(LEDs.LED3, state.LEDs);
     SetLEDState(LEDs.LED4, state.LEDs);
 }
    public virtual void pushByBall(Vector2 direction, float ballSize, int id)
    {
        stunnedEffect.Show();
        clearBall();
        changeIdKilled(id);
        previousState = currentState;
        currentState  = StatusState.Stun;
        ++numberBall;
        body.AddForce(direction.normalized * ballSize * 100000 * numberBall);
        isPushed = true;
        //if (totalTimeForPush < Time.time)
        //{
        totalTimeForPush = Time.time + timeForPush;
        //}
        //else
        //{
        //    totalTimeForPush += timeForPush;
        //}

        // GameController.Instance.Killer(infor.idKiller).infor.isPLayer
        if (GameController.Instance.characters[infor.idKiller].isPLayer)
        {
            UIManager.Ins.gamePlay.ShowBoxPush(infor.itemName, ballSize);
        }

        if (infor.idKiller == 0 || infor.id == 0)
        {
            UIManager.Ins.PlayVibrate();
        }

        SetCharacterState(currentState);

        // faceObject.GetComponent<BoxCollider2D>().isTrigger = true;
    }
Example #9
0
        public StandardMelee(InputHandler handler)
        {
            _mousePosition = new Vector2f(500, 500);

            CurrentStatus = StatusState.WaitingForPlayers;

            uiState = UIStateTypes.Normal;
            currentHotkey = null;
            currentHotkeySheet = null;
            standardHotkeys = Settings.GetSheet("standard_game_mode_controls");

            InputHandler = handler;
            myId = 0;
            map = new TileMap();

            allowMinimapCameraMove = true;
            selectedUnits = null;
            controlGroups = new Dictionary<Keyboard.Key, List<EntityBase>>();

            for (int i = 27; i <= 35; i++)
            {
                controlGroups.Add((Keyboard.Key) i, new List<EntityBase>());
            }

            controlBoxP1 = new Vector2f(0, 0);
            controlBoxP2 = new Vector2f(0, 0);
            selectedAttackMove = false;
            releaseSelect = false;

            CameraPosition = new Vector2f(0, 0);

            miniMap = new MiniMap(map, Fog, entities);

            //Load Sprites
            bottomHUDGUI = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/BottomGUI.png"));
            alertHUDAlert = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_Alert.png"));
            alertHUDUnitCreated = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_UnitCreated.png"));
            alertHUDBuildingCreated =
                new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/Alert_BuildingFinished.png"));

            avatarWorker = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_AVATAR_WORKER.png"));

            hudBoxUnit = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_BOX_Unit.png"));
            hudBoxBuilding = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/HUD_BOX_Building.png"));

            hudControlBox = new Sprite(ExternalResources.GTexture("Resources/Sprites/HUD/ControlGroupBox.png"));
            hudControlBox.Origin = new Vector2f(hudControlBox.TextureRect.Width/2, 0);

            viewBounds = new Sprite(ExternalResources.GTexture("Resources/Sprites/Hud/ViewBounds.png"));

            //Load Sounds
            moveSound = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/MoveCommand/0.wav"));
            attackMoveSound = new Sound(ExternalResources.GSoundBuffer("Resources/Audio/AttackCommand/0.wav"));

            backgroundMusic = new Music("Resources/Audio/Music/In Game/mario.wav");
            backgroundMusic.Loop = true;
            backgroundMusic.Volume = Settings.MUSICVOLUME;
            backgroundMusic.Play();
        }
Example #10
0
 public void Expire()
 {
     for (int i = 0; i < components.Count; i++)
     {
         components[i].OnEffectExpired();
     }
     state = StatusState.Expired;
 }
Example #11
0
 public void BeBig()
 {
     if (currentStatusState != StatusState.Big)
     {
         currentStatusState = StatusState.Big;
         mySprite           = Sprites.SpriteMachine.Instance.CreateBigMarioSprite();
     }
 }
Example #12
0
 public void BeFire()
 {
     if (currentStatusState != StatusState.Fire)
     {
         currentStatusState = StatusState.Fire;
         mySprite           = Sprites.SpriteMachine.Instance.CreateFireMarioSprite();
     }
 }
Example #13
0
 public StatusEffect()
 {
     state      = StatusState.Invalid;
     components = new List <StatusEffectComponent>();
     tags       = new TagCollection();
     duration   = new FloatRange();
     timer      = new Timer();//can probably get rid of timer and just duration as a variable
 }
Example #14
0
 public void BeSmall()
 {
     if (currentStatusState != StatusState.Small)
     {
         currentStatusState = StatusState.Small;
         mySprite           = Sprites.SpriteMachine.Instance.CreateSmallMarioSprite();
     }
 }
Example #15
0
 public void Apply(Entity target, Context context)
 {
     this.target  = target;
     this.context = context;
     caster       = context.entity;
     state        = StatusState.Active;
     UpdateComponentContext();
 }
    public virtual void Start()
    {
        body = GetComponent <Rigidbody2D>();
        stunnedEffect.Hide();
        currentState = StatusState.Chasing;

        SetCharacterState(currentState);
        MapControler.CutMap += CheckWhenCutMap;
    }
Example #17
0
 public EnemyStats(int hp, int maxHp, int dmg, int speed, StatusState state, ENEMY_STATE_MACHINE statemachine)
 {
     this.Hp           = hp;
     this.MaxHp        = maxHp;
     this.Dmg          = dmg;
     this.Speed        = speed;
     this.State        = state;
     this.statemachine = statemachine;
 }
Example #18
0
 public BookmarkContext(StatusState item)
 {
     Id     = item.Id;
     Status = new State
     {
         SystemCode = item.State.SystemCode,
         IsSorryOn  = item.State.IsSorryOn
     };
 }
 public void EndStun()
 {
     isStunning = false;
     isPushed   = false;
     numberBall = 0;
     stunnedEffect.Hide();
     previousState = currentState;
     currentState  = StatusState.Chasing;
     SetCharacterState(currentState);
     // faceObject.GetComponent<BoxCollider2D>().isTrigger = false;
 }
Example #20
0
 public void Start()
 {
     if (this.status == StatusState.InProgress)
     {
         throw new InvalidOperationException("Already in progress.");
     }
     this.status = StatusState.InProgress;
     this.thread = new Thread(new ThreadStart(this.StartTaskAsync));
     this.thread.IsBackground = true;
     this.thread.Start();
 }
        /// <summary>
        /// Sets the status.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="state">The state.</param>
        /// <param name="messageBoxText">The message box text.</param>
        private void SetStatus(String message, StatusState state, String messageBoxText = null)
        {
            m_numDone = 0;
            Status    = message;
            CanStart  = state == StatusState.Ready ? true : false;

            if (!String.IsNullOrEmpty(messageBoxText))
            {
                MessageBox.Show(messageBoxText);
            }
        }
        public AcceptorDataFrame(byte[] bits)
        {
            byte status = bits[1];

            try
            {
                Status = (StatusState)((int)status);
            }
            catch
            {
                Status = StatusState.Rejected;
            }

            byte e = bits[2];

            Failure        = (e & 1) > 0;
            PowerUp        = (e & 2) > 0;
            CashboxFull    = (e & 4) > 0;
            Cheated        = (e & 8) > 0;
            NoteJammed     = (e & 16) > 0;
            CashboxPresent = (e & 32) > 0;
            InvalidCommand = (e & 64) > 0;

            switch ((int)bits[4])
            {
            case 1:
                Amount = 1;
                break;

            case 2:
                Amount = 5;
                break;

            case 3:
                Amount = 10;
                break;

            case 4:
                Amount = 20;
                break;

            case 5:
                Amount = 100;
                break;

            default:
                Amount = 0;
                break;
            }

            SequenceNumber = bits[5];
        }
Example #23
0
 private void StartTaskAsync()
 {
     DoTask();
     if (CancelRequested)
     {
         status = StatusState.Cancelled;
         OnCancelled();
     }
     else
     {
         status = StatusState.Completed;
         OnCompleted();
     }
 }
Example #24
0
        public async Task <StatusState> UpdateAsync(BookmarkContext state)
        {
            var updateState = new StatusState
            {
                Id        = state.Id,
                DateStamp = DateTime.Now.ToUniversalTime(),
                State     = new State
                {
                    IsSorryOn  = state.Status.IsSorryOn,
                    SystemCode = state.Status.SystemCode
                }
            };

            return(await Task.FromResult(UpdateState(updateState)));
        }
Example #25
0
        private StatusState UpdateState(StatusState state)
        {
            if (state.Id == Guid.Empty)
            {
                throw new ArgumentNullException(nameof(state));
            }

            if (_inMemoryRepository.ContainsKey(state.Id))
            {
                _inMemoryRepository.Remove(state.Id);
            }

            _inMemoryRepository.Add(state.Id, state);

            return(_inMemoryRepository[state.Id]);
        }
        public AcceptorDataFrame(byte[] bits)
        {
            byte status = bits[1];
            try
            {
                Status = (StatusState)((int)status);
            }
            catch
            {
                Status = StatusState.Rejected;
            }

            byte e = bits[2];
            Failure = (e & 1) > 0;
            PowerUp = (e & 2) > 0;
            CashboxFull = (e & 4) > 0;
            Cheated = (e & 8) > 0;
            NoteJammed = (e & 16) > 0;
            CashboxPresent = (e & 32) > 0;
            InvalidCommand = (e & 64) > 0;

            switch ((int)bits[4])
            {
                case 1:
                    Amount = 1;
                    break;
                case 2:
                    Amount = 5;
                    break;
                case 3:
                    Amount = 10;
                    break;
                case 4:
                    Amount = 20;
                    break;
                case 5:
                    Amount = 100;
                    break;
                default:
                    Amount = 0;
                    break;
            }

            SequenceNumber = bits[5];
        }
Example #27
0
        // (You could add properties to return the thread ID and name here.)

        // Start the new operation.
        public void Start()
        {
            if (status == StatusState.InProgress)
            {
                throw new InvalidOperationException("Already in progress.");
            }
            else
            {
                // Initialize the new task.
                status = StatusState.InProgress;

                // Create the thread.
                thread = new Thread(StartTaskAsync);

                // Start the thread.
                thread.Start();
            }
        }
Example #28
0
        /// <summary>
        /// Установить статус по id МЦ
        /// </summary>
        public void SetStatusByMaterialId(int materialId, StatusState?oldStatus, StatusState newStatus, DateTime eventDate, string reason = "")
        {
            var materialActive = dbContext.MaterialActives.Where(o => o.Id == materialId).AsNoTracking().FirstOrDefault();

            if (materialActive != null)
            {
                var statusHistory = new MaterialActiveStatusHistory
                {
                    MaterialActiveId = materialActive.Id,
                    OldState         = oldStatus,
                    NewState         = newStatus,
                    EventDate        = eventDate,
                    Reason           = reason
                };
                dbContext.MaterialActiveStatusHistories.Add(statusHistory);
                dbContext.SaveChanges();
            }
        }
 public void SetCharacterState(StatusState state)
 {
     if (state == StatusState.Chasing)
     {
         skeletonAnimation.state.ClearTracks();
         skeletonAnimation.skeleton.SetSlotsToSetupPose();
         skeletonAnimation.state.SetAnimation(0, "idle", true);
         // SetAnimation(idle, true, 1);
     }
     else if (state == StatusState.Stun)
     {
         isStunning = true;
         skeletonAnimation.state.ClearTracks();
         // skeletonAnimation.skeleton.SetSlotsToSetupPose();
         skeletonAnimation.state.SetAnimation(0, "stun", true);
         // SetAnimation(stun, true, 1);
     }
 }
Example #30
0
        // Start the new operation.
        public void Start()
        {
            if (status == StatusState.InProgress)
            {
                throw new InvalidOperationException("Already in progress.");
            }
            else
            {
                // Initialize the new task.
                status = StatusState.InProgress;

                // Create the thread and run it in the background,
                // so it will terminate automatically if the application ends.
                thread = new Thread(StartTaskAsync);
                thread.IsBackground = true;

                // Start the thread.
                thread.Start();
            }
        }
Example #31
0
		// Start the new operation.
		public void Start()
		{
			if (status == StatusState.InProgress)
			{
				throw new InvalidOperationException("Already in progress.");
			}
			else
			{
				// Initialize the new task.
				status = StatusState.InProgress;

				// Create the thread and run it in the background,
				// so it will terminate automatically if the application ends.
				thread = new Thread(StartTaskAsync);
				thread.IsBackground = true;

				// Start the thread.
				thread.Start();
			}
		}
Example #32
0
        int GetStatusBarStatePriority(StatusState state)
        {
            switch (state)
            {
            case StatusState.Ready:
                return(0);

            case StatusState.WaitingBeforeStart:
                return(1);

            case StatusState.RecordingInfo:
                return(2);

            case StatusState.CopyingInfo:
                return(3);

            default:
                return(100);
            }
        }
Example #33
0
        void Start()
        {
            var topMenuState = new TopMenuState(transform.FindChild("TopMenuUI").gameObject, textures, fontProperties);
            var statusState = new StatusState(transform.FindChild("StatusUI").gameObject, textures, fontProperties);

            stateMachine = new StateMachine<State<MainMenuTrigger>, MainMenuTrigger>(topMenuState);

            stateMachine
                .Configure(topMenuState)
                .OnEntry(trans => topMenuState.OnEnter())
                .OnExit(trans => topMenuState.OnExit())
                .Permit(MainMenuTrigger.StatusSelected, statusState)
                .Ignore(MainMenuTrigger.MenuExited);

            stateMachine
                .Configure(statusState)
                .OnEntry(trans => statusState.OnEnter())
                .OnExit(trans => statusState.OnExit())
                .Permit(MainMenuTrigger.ActionCanceled, topMenuState);

            topMenuState.OnEnter();
        }
Example #34
0
        void SetStatusBarStatus(StatusState state, string text, int progress = 0)
        {
            // need to terminate copy thread before the prog ends
            try
            {
                if (GetStatusBarStatePriority(state) >= GetStatusBarStatePriority(statusBarState) || state == StatusState.Ready)
                {
                    statusBarState = state;

                    statusLabel.Text      = text;
                    statusPogress.Visible = progress > 0;

                    if (state == StatusState.CopyingInfo && progress == 0)
                    {
                        statusBarState = StatusState.Ready;
                    }

                    statusPogress.Value = progress;
                }
            }
            catch { }
        }
Example #35
0
		private void StartTaskAsync()
		{
			DoTask();
			status = StatusState.Completed;
			OnCompleted();
		}
Example #36
0
        public override void Update(float ms)
        {
            UpdateTiles();
            //base.Update(ms);
            switch (GameStatus)
            {
                case StatusState.InProgress:
                    {
                        //Check if players are still playing

                        //TODO: Change back to non-comment when ready
                        base.Update(ms);
                        int team1Count = 0;
                        int team1Id = 0;
                        bool gameInProgress = false;

                        foreach (Player player in players)
                        {
                            if (player.Status == Player.StatusTypes.InGame)
                            {
                                if (team1Count == 0)
                                {
                                    team1Id = player.Team;
                                    team1Count++;
                                }
                                else
                                {
                                    if (team1Id != player.Team)
                                    {
                                        gameInProgress = true;
                                        break;
                                    }
                                }
                            }
                        }
                        //If there's not enough players playing, the game is completed
                        if (gameInProgress == false)
                        {
                            GameStatus = StatusState.Completed;
                        }

                        //Check if player has lost all their buildings

                        foreach (Player player in players)
                        {
                            byte team = player.Team;
                            bool hasBuilding = false;
                            foreach (EntityBase entity in WorldEntities.Values)
                            {
                                if (entity.Team == team && entity is BuildingBase)
                                {
                                    hasBuilding = true;
                                    break;
                                }
                            }
                            if (hasBuilding == false)
                            {
                                //player has been eliminated
                                GameStatus = StatusState.Completed;
                            }
                        }
                    }

                    break;
                case StatusState.WaitingForPlayers:
                    break;
                case StatusState.Completed:
                    //TODO: Change back to non-comment when ready
                    base.Update(ms);
                    break;
                default:
                    break;
            }
        }
Example #37
0
 //-------------------------------------------------------------------------------
 //
 private void ReSetStatusState()
 {
     _stateStatusState = StatusState.Normal;
     lblTweetStatus.Text = "";
     btnStateReset.Visible = false;
 }
Example #38
0
        public override void AddConnection(NetConnection connection)
        {
            if (players.Count < MaxPlayers)
            {
                //Connected client must be a player

                var nPlayer = new Player { ClientId = idToGive, Team = idToGive };
                nPlayer.Wood = 50;
                nPlayer.Supply = 10;
                players.Add(nPlayer);
                connection.Tag = nPlayer;

                var home =// new HomeBuilding(Server, nPlayer);
                BuildingBase.CreateBuilding("standardBase", Server, nPlayer);
                home.Team = nPlayer.Team;
                home.BuildTime = 0;
                if (TiledMap.SpawnPoints.Count > players.Count - 1)
                {
                    home.Position = TiledMap.SpawnPoints[players.Count - 1];
                }

                AddEntity(home);

                SendAllPlayers();
                SendMap();
                SendAllEntities();
                SetCamera(nPlayer, home.Position);

                if (players.Count >= MaxPlayers)
                {
                    GameStatus = StatusState.InProgress;
                }

                var memory = new MemoryStream();
                var writer = new BinaryWriter(memory);
                writer.Write((byte) Gamemode.Signature.Handshake);
                writer.Write(idToGive);
                Server.SendGameData(memory.ToArray(), connection);
            }
            else
            {
                //Connectd client must be a spectator or something non-player type?
                SendAllPlayers();
                SendData(map.ToBytes(), Gamemode.Signature.MapLoad);
                SendAllEntities();
            }
            idToGive++;
        }
 public CommandSetItem(CommandSet commandSet, EventHandler statusHandler, EventHandler invokeHandler, CommandID id, bool optimizeStatus, IUIService uiService)
     : base(invokeHandler, id)
 {
     this.uiService = uiService;
     this.eventService = commandSet.eventService;
     this.statusHandler = statusHandler;
     if (optimizeStatus && (statusHandler != null))
     {
         this.commandSet = commandSet;
         lock (typeof(CommandSet.CommandSetItem))
         {
             if (commandStatusHash == null)
             {
                 commandStatusHash = new Hashtable();
             }
         }
         StatusState state = commandStatusHash[statusHandler] as StatusState;
         if (state == null)
         {
             state = new StatusState();
             commandStatusHash.Add(statusHandler, state);
         }
         state.refCount++;
     }
 }
Example #40
0
        protected override void ParseCustom(MemoryStream memory)
        {
            var reader = new BinaryReader(memory);
            var signature = (StandardMeleeSignature) reader.ReadByte();

            switch (signature)
            {
                case StandardMeleeSignature.StatusChanged:
                    {
                        int status = memory.ReadByte();
                        CurrentStatus = (StatusState) status;
                    }
                    break;
                case StandardMeleeSignature.PlayerSurrender:
                    {
                        byte id = reader.ReadByte();
                        if (players.ContainsKey(id))
                        {
                            players[id].Status = Player.StatusTypes.Left;
                            onPlayerSurrender(players[id]);
                        }
                    }
                    break;
                case StandardMeleeSignature.PlayerElimination:
                    {
                        byte id = reader.ReadByte();
                        if (players.ContainsKey(id))
                        {
                            players[id].Status = Player.StatusTypes.Left;
                            onPlayerElimination(players[id]);
                        }
                    }
                    break;

                default:
                    break;
            }
        }
 private void SaveCommandStatus()
 {
     if (this.commandSet != null)
     {
         StatusState state = null;
         if (commandStatusHash.Contains(this.statusHandler))
         {
             state = commandStatusHash[this.statusHandler] as StatusState;
         }
         else
         {
             state = new StatusState();
         }
         state.SaveState(this, this.commandSet.SelectionVersion);
     }
 }
Example #42
0
        //-------------------------------------------------------------------------------
        //
        private void SetStatusState(StatusState state, string lbltext)
        {
            if (state == StatusState.Normal) { return; }

            _stateStatusState = state;
            lblTweetStatus.Text = lbltext;
            btnStateReset.Visible = true;
        }
Example #43
0
 //-------------------------------------------------------------------------------
 //
 private void btnStateReset_Click(object sender, EventArgs e)
 {
     _stateStatusState = StatusState.Normal;
     lblTweetStatus.Text = "";
     btnStateReset.Visible = false;
 }
        /// <summary>
        /// Sets the status.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="state">The state.</param>
        /// <param name="messageBoxText">The message box text.</param>
        private void SetStatus(String message, StatusState state, String messageBoxText = null)
        {
            m_numDone = 0;
            Status    = message;
            CanStart  = state == StatusState.Ready ? true : false;

            if (!String.IsNullOrEmpty(messageBoxText))
            {
                MessageBox.Show(messageBoxText);
            }
        }
        private void ShortBreakButton_Click(object sender, RoutedEventArgs e)
        {
            this.Activate();
            MessageBox.Show("Please change to AUX8 in your AVAYA Phone.");

            setStatusLabel((Button)sender);

            statusState = StatusState.StatusStateShortBreak;

            using (WebClient wc = new WebClient())
            {
                string url = "http://" + ipaddress + "/users/updateattendancelog?logstatus=" + 3 + "&previouslogstatus=" + user.currentlogid + "&employeeid=" + this.user.employeeid;

                var json = wc.DownloadString(url);

                if (json != "1" && json != "2")
                {
                    this.user = JsonConvert.DeserializeObject<User>(json);

                    meetingTimeLbl.Content = this.user.totaldurationaux3;
                    onDeskTimeLbl.Content = this.user.totaldurationaux7;
                    shortBreakTimeLbl.Content = this.user.totaldurationaux8;
                    longBreakTimeLbl.Content = this.user.totaldurationaux9;
                    totalTimeLbl.Content = user.totalduration;
                }
            }
        }