public void Update(StripButtonState buildStatus, short type) { SuspendFlowLayout(); buttons[type].State = buildStatus; InvokeShow(type); UpdateFlowLayoutPanelSize(); ResumeFlowLayout(); }
public void SetStateWithoutInvoke(StripButtonState state) { StripButtonState oldstate = state; this.state = state; if (this.state != oldstate) { OnStateChangeWithoutInvoke(state); } else if (state == StripButtonState.Percantage) { Refresh(); } }
/*public bool DrawPercentage { * get { return drawPercentage; } * set { * drawPercentage = value; * InvokeRefresh(); * } * }*/ private void OnStateChange(StripButtonState state) { switch (state) { case StripButtonState.Inactive: InvokeState(new ApplyStateCallback(ApplyInactive)); break; case StripButtonState.Ready: InvokeState(new ApplyStateCallback(ApplyReady)); break; case StripButtonState.Active: InvokeState(new ApplyStateCallback(ApplyActive)); break; case StripButtonState.Percantage: InvokeState(new ApplyStateCallback(ApplyPercent)); break; } }
private void OnStateChangeWithoutInvoke(StripButtonState state) { switch (state) { case StripButtonState.Inactive: ApplyInactive(); break; case StripButtonState.Active: ApplyActive(); break; case StripButtonState.Ready: ApplyReady(); break; case StripButtonState.Percantage: ApplyPercent(); break; } Refresh(); }
public int RightBuildingClick(int id, bool isUnit) { InfoLog.WriteInfo("Enter RightBuildingClick" + id, EPrefix.BMan); int current = -1; InfoLog.WriteInfo("Lock cObjLock in RightBuildingClick", EPrefix.BMan); lock (this.cObjLock) current = _currentObjectID; InfoLog.WriteInfo("Unlock cObjLock in RightBuildingClick", EPrefix.BMan); if (current != -1) { StripButtonState state = _stripData[current][(short)id].State; InfoLog.WriteInfo("State: " + state + " " + Enum.GetName(typeof(StripButtonState), state), EPrefix.BMan); switch (state) { case StripButtonState.Active: RightBuildActiveClick(id, isUnit); InfoLog.WriteInfo("Exit RightBuildingClick", EPrefix.BMan); return(current); } } InfoLog.WriteInfo("Exit RightBuildingClick", EPrefix.BMan); return(-1); }
public BuildStatusStrip(int objectid, short typeid, short turnsToBuild, BuildType type) : base(objectid, typeid, turnsToBuild, type) { _state = StripButtonState.Active; }
public void SetState(int key, StripButtonState state) { buttons[key].State = state; }