public static void SetGroupCollapse(GroupState state, ListView listview) { for (int i = 0; i <= listview.Groups.Count; i++) { LVGROUP group = new LVGROUP(); group.cbSize = Marshal.SizeOf(group); group.state = (int)state; // LVGS_COLLAPSIBLE group.mask = 4; // LVGF_STATE group.iGroupId = i; IntPtr ip = IntPtr.Zero; try { ip = Marshal.AllocHGlobal(group.cbSize); //Marshal.StructureToPtr(group, ip, true); Marshal.StructureToPtr(group, ip, false); SendMessage(listview.Handle, 0x1000 + 147, i, ip); // #define LVM_SETGROUPINFO (LVM_FIRST + 147) } catch (Exception ex) { System.Diagnostics.Trace.WriteLine (ex.Message + Environment.NewLine + ex.StackTrace); } finally { if (null != ip) { Marshal.FreeHGlobal(ip); } } } }
public void SetGroupCollapse(GroupState state) { IntPtr ptr = IntPtr.Zero; try { LVGROUP group = new LVGROUP(); int size = Marshal.SizeOf(group); ptr = Marshal.AllocHGlobal(size); for (int i = 0; i < this.Groups.Count; i++) { try { group.cbSize = size; group.state = (int)state; group.mask = LVGF_STATE; group.iGroupId = GetGroupID(this.Groups[i]); Marshal.StructureToPtr(group, ptr, false); SendMessage(this.Handle, LVM_SETGROUPINFO, group.iGroupId, ptr); } catch (Exception) { } } } catch (Exception) { } finally { if (ptr != IntPtr.Zero) { Marshal.FreeHGlobal(ptr); } } }
public static void ChangeGroupState(Group group, GroupState state) { if ((group != null) && (group.State != state)) { group.State = state; } }
internal NGroupSelf(TGroupsSelf.Types.GroupSelf message) { Id = message.Group.Id; Private = message.Group.Private; CreatorId = message.Group.CreatorId; Name = message.Group.Name; Description = message.Group.Description; AvatarUrl = message.Group.AvatarUrl; Lang = message.Group.Lang; Metadata = message.Group.Metadata; Count = message.Group.Count; CreatedAt = message.Group.CreatedAt; UpdatedAt = message.Group.UpdatedAt; switch (message.State) { case 0: State = GroupState.Admin; break; case 1: State = GroupState.Member; break; case 2: State = GroupState.Join; break; } }
public void SetGroupState(ListViewGroup lvGroup, GroupState state) { IntPtr ptr = IntPtr.Zero; try { LVGROUP group = new LVGROUP(); int size = Marshal.SizeOf(group); ptr = Marshal.AllocHGlobal(size); group.cbSize = size; group.state = (int)state; group.mask = LVGF_STATE; group.iGroupId = GetGroupID(lvGroup); Marshal.StructureToPtr(group, ptr, false); SendMessage(this.Handle, LVM_SETGROUPINFO, group.iGroupId, ptr); } catch (Exception) { } finally { if (ptr != IntPtr.Zero) { Marshal.FreeHGlobal(ptr); } } }
public HomeGroupsViewModel(GroupState? groupState, GroupOrderByType? orderBy) { GroupStateFilter = groupState.HasValue ? (byte)groupState : -1; OrderByFilter = (byte)(orderBy.HasValue ? orderBy.Value : GroupOrderByType.ByTitle); CachLabel = GroupStateFilter + "&" + OrderByFilter; CachDropPeriod = TimeSpan.FromHours(12); }
public void ResumeWorking() { Controller.OnDebuggingMessage("KGS fixed handicap: Waking up..."); if (_gameController.HandicapPositions.Count == _gameController.Info.NumberOfHandicapStones) { Controller.OnDebuggingMessage("KGS fixed handicap: Placing stones..."); GameBoard gameBoard = new GameBoard(Controller.Info.BoardSize); GroupState groupState = Controller.Ruleset.RulesetInfo.GroupState; var positions = _gameController.HandicapPositions; //set game board stones foreach (var position in positions) { gameBoard[position.X, position.Y] = StoneColor.Black; groupState.AddStoneToBoard(position, StoneColor.Black); } //reflect the number of placed stones to listeners StonesPlaced = _gameController.Info.NumberOfHandicapStones; //add the board to game Controller.GameTree.AddToEnd(positions.ToArray(), new Position[0], gameBoard, new GroupState(groupState, Controller.Ruleset.RulesetInfo)); GoToPhase(Modes.LiveGame.Phases.GamePhaseType.Main); } else { // Wait for the rest. Controller.OnDebuggingMessage("KGS fixed handicap: Not enough stones! Will wake up later..."); } }
private void FillBoardStateInternal(GameBoard copyOfPreviousBoard, GroupState copyOfPreviousGroupState, IRuleset ruleset) { foreach (var position in AddBlack) { copyOfPreviousBoard[position] = StoneColor.Black; } foreach (var position in AddWhite) { copyOfPreviousBoard[position] = StoneColor.White; } BoardState = copyOfPreviousBoard; if (AddBlack.Count == 0 && AddWhite.Count == 0) { GroupState = copyOfPreviousGroupState; } else { ruleset.RulesetInfo.SetState(copyOfPreviousBoard); GroupState = ruleset.RulesetInfo.GroupState; } //process only if move was performed if (Move.Kind != MoveKind.None) { var processMove = ruleset.ProcessMove(this, Move); BoardState = processMove.NewBoard; GroupState = processMove.NewGroupState; Move.Captures.AddRange(processMove.Captures); } }
/// <summary> /// Places the fixed handicap stones based on the game info /// </summary> protected void PlaceHandicapStones() { var gameInfo = Controller.Info; if (gameInfo.NumberOfHandicapStones > 0) { Controller.OnDebuggingMessage("Placing " + gameInfo.NumberOfHandicapStones + " fixed handicap stones..."); GameBoard gameBoard = new GameBoard(Controller.Info.BoardSize); var positions = FixedHandicapPositions.GetHandicapStonePositions(gameInfo.BoardSize, gameInfo.NumberOfHandicapStones).ToArray(); GroupState groupState = Controller.Ruleset.RulesetInfo.GroupState; //set game board stones foreach (var position in positions) { gameBoard[position.X, position.Y] = StoneColor.Black; groupState.AddStoneToBoard(position, StoneColor.Black); } //reflect the number of placed stones to listeners StonesPlaced = gameInfo.NumberOfHandicapStones; //add the board to game Controller.GameTree.AddToEnd(positions, new Position[0], gameBoard, new GroupState(groupState, Controller.Ruleset.RulesetInfo)); } }
private void DataProcess() { while (!isClosed) { try { if (dataQueue.IsEmpty) { Thread.Sleep(100); continue; } ITakeData data; if (!dataQueue.TryDequeue(out data) || data == null) { continue; } var pd = data as PushDataDto; var np = pd.Param as NormalParam; GroupState gs = new GroupState() { GroupID = np == null ? "1" : np.Stage + "" }; factory.StartNew((s) => { AssignHandleProcess(data); }, gs); } catch (Exception e) { logger.Error(e.ToString()); } } }
public virtual void Start() { RefRigidbody = GetComponent <Rigidbody>(); RefSphere = GetComponent <SphereCollider>(); Neighbors = new List <Agent>(); FSM = new StateMachine.StateMachine(); InitialState initial = new InitialState(this); GroupState group = new GroupState(this); ExitState exit = new ExitState(this); JoinGroupTransition JG = new JoinGroupTransition(); JG.SetTargetState(group); ExitTriggerTransition ET = new ExitTriggerTransition(); ET.SetTargetState(exit); ExitFormationTransition EF = new ExitFormationTransition(); EF.SetTargetState(group); initial.AddTransitions(JG); group.AddTransitions(ET); exit.AddTransitions(EF); FSM.AddState(initial); FSM.AddState(group); FSM.AddState(exit); FSM.Start(initial); }
private ExecutionState <GroupState> Run(string code, InstructionExecutor <GroupState> executor = null) { (Synfron.Staxe.Matcher.Data.IMatchData matchData, bool success, int _, int?_, string _) = LanguageMatchEngine.Match(code); Assert.True(success); InstructionGenerator generator = new InstructionGenerator(); IList <Instruction <GroupState> > instructions = generator.Generate(matchData); InstructionOptimizer <GroupState> optimizer = new InstructionOptimizer <GroupState>(); instructions = optimizer.Optimize(instructions).ToArray(); GroupState groupState = new GroupState(); groupState.Group.Instructions = instructions.ToArray(); ExecutionState <GroupState> executionState = new ExecutionState <GroupState>(groupState); executor = executor ?? new InstructionExecutor <GroupState>() { ExternalDynamicPointers = NativeLocator.GetNativePointer, ValueProvider = new ValueProvider() }; PrintDiagnostics.EnableDiagnostics(code, executor, executionState, true); executor.Execute(executionState); return(executionState); }
private void Init() { if (_initialized) { return; } lock (Locker) { if (_initialized) { return; } _acDomain.MessageDispatcher.DispatchMessage(new MemorySetInitingEvent(this)); _groupDic.Clear(); var groups = _acDomain.RetrieveRequiredService <IOriginalHostStateReader>().GetAllGroups(); foreach (var group in groups) { if (!_groupDic.ContainsKey(@group.Id)) { _groupDic.Add(@group.Id, GroupState.Create(@group)); } } _initialized = true; _acDomain.MessageDispatcher.DispatchMessage(new MemorySetInitializedEvent(this)); } }
/* * Reference to a group record. Traversal returns mixed types and directions. */ private void Groups(long nodeReference, long groupReference) { Id = NO_ID; this._next = NO_ID; this._groupState = GroupState.Incoming; this._originNodeReference = nodeReference; _group.direct(nodeReference, groupReference); }
private bool GetOneState(GroupState mask) { if (this.Created) { this.State = this.GetState(); } return((this.State & mask) == mask); }
public GroupItem() { InitializeComponent(); Dock = DockStyle.Top; labelX_count.ForeColor = Color.Black; _state = GroupState.NotInQueue; ItemStateChangingEnabled = true; }
public void RollBack() { state = memoryState; shuffleLeftIndex = memoryShuffleLeftIndex; shuffleRightIndex = memoryShuffleRightIndex; pickElement.SetNotUse(); }
private bool GetOneState(GroupState stateMask) { if (Created) { State = GetState(); } return((State & stateMask) == stateMask); }
/// <summary> /// Get the current state of this group from the underlying control /// </summary> protected int SetState(GroupState newState, GroupState mask) { NativeMethods.LVGROUP2 group = new NativeMethods.LVGROUP2(); group.cbSize = ((uint)Marshal.SizeOf(typeof(NativeMethods.LVGROUP2))); group.mask = (uint)GroupMask.LVGF_STATE; group.state = (uint)newState; group.stateMask = (uint)mask; return(NativeMethods.SetGroupInfo(this.ListView, this.GroupId, group)); }
private static void OnItemStateChanged(int index, GroupState state) { ItemStateChangedHandler handler = ItemStateChanged; if (handler != null) { handler(index, state); } }
public void AddItem(string text,GroupState state, DateTime datetime, string count, List<string> symbols) { var ind = panelEx_container.Controls.Count; var cntrl = new StyledListItemControl(text, ind, state, datetime, count); cntrl.ItemSelectedChanged += cntrl_ItemSelectedChanged; panelEx_container.Controls.Add(cntrl); //if(SelectedItem==-1) SelectFirstItem(); cntrl.Symbols = symbols; }
internal void ChangeState(int index, GroupState state) { var styledListItemControl = panelEx_container.Controls[index] as GroupItem; if (styledListItemControl != null) { styledListItemControl.ItemState = state; } }
// Update is called once per frame void Update() { GroupState input = (GroupState)Input.GetAxisRaw("Group Up"); if (input != 0) { currentGrouping = input; } }
protected virtual void OnItemStateChanged(int index, GroupState state) { ItemStateChangedHandler handler = ItemStateChanged; if (handler != null) { handler(index, state); } }
public void ChangeState(int index, GroupState state) { var groupItem = panelEx1.Controls[index] as GroupItem; if (groupItem != null) { groupItem.ItemState = state; } }
public bool TryGetGroup(Guid groupId, out GroupState group) { if (!_initialized) { Init(); } Debug.Assert(groupId != Guid.Empty); return(_groupDic.TryGetValue(groupId, out group)); }
public GroupTree(object key, ColumnInfo column, GroupState state, List <T> items = null) { Items = items == null ? new List <T>() : items; SubGroups = new List <GroupTree <T> >(); Column = column; Key = key; Column = column; Aggregates = new List <AggregatorInfo <T> >(); State = state; }
public bool IsSuffleFinish() { var result = shuffeUseCount == GetSuffleMaxCount(); if (result) { state = GroupState.GameReady; } return(result); }
protected int SetState(GroupState state, GroupState stateMask) { BrightIdeasSoftware.NativeMethods.LVGROUP2 group = new BrightIdeasSoftware.NativeMethods.LVGROUP2 { cbSize = (uint)Marshal.SizeOf(typeof(BrightIdeasSoftware.NativeMethods.LVGROUP2)), mask = 4, state = (uint)state, stateMask = (uint)stateMask }; return(BrightIdeasSoftware.NativeMethods.SetGroupInfo(this.ListView, this.GroupId, group)); }
public string NpcgroupInfo(NpcGroupType groupType) { string str = ""; if (groupType < 0 || this.groupType == groupType) { str += "\n Type=" + groupType.ToString() + " State=" + GroupState.ToString(); } return(str); }
public void SetState(GroupState newState) { if (currentState != newState) { currentState = newState; } //else { // Debug.Log(string.Format("<color=yellow> PinsGroup[{0}] : Se ha vuelto a establecer el mismo estado ( {1} ) que ya tenía que sigue activo </color>", index, newState.ToString())); //} }
private void ChangeState(GroupState nextState) // 先关闭之前的状态 { if (FadeDuration > 0) { switch (mCurrentState) { case GroupState.ONE: Tweener t1 = mOneGroup.DOFade(0, FadeDuration); // 变透明咯 t1.OnComplete(() => { GO_One.SetActive(false); }); break; case GroupState.TWO: Tweener t2 = mTwoGroup.DOFade(0, FadeDuration); t2.OnComplete(() => { GO_Two.SetActive(false); }); break; case GroupState.THREE: Tweener t3 = mThreeGroup.DOFade(0, FadeDuration); t3.OnComplete(() => { GO_Three.SetActive(false); }); break; } } else { switch (mCurrentState) { case GroupState.ONE: mOneGroup.alpha = 0; GO_One.SetActive(false); break; case GroupState.TWO: mTwoGroup.alpha = 0; GO_Two.SetActive(false); break; case GroupState.THREE: mThreeGroup.alpha = 0; GO_Three.SetActive(false); break; } } mCurrentState = nextState; }
public void AddItem(string text, int depth, GroupState state, DateTime datetime, string count, List<string> symbols, List<SessionModel> sessions, bool isAutoCollect) { var ind = panelEx_container.Controls.Count; var cntrl = new GroupItem(text, ind, depth, state, datetime, count, isAutoCollect); cntrl.ItemSelectedChanged += cntrl_ItemSelectedChanged; cntrl.ItemEditGroupClick += cntrl_ItemEditGroupClick; panelEx_container.Controls.Add(cntrl); //if(SelectedItem==-1) SelectFirstItem(); cntrl.Symbols = symbols; cntrl.Sessions = sessions; }
public StyledListItemControl(string text, int index,GroupState state, DateTime datetime, string count) { InitializeComponent(); Dock = DockStyle.Top; labelX_count.ForeColor = Color.Black; ItemText = text; ItemIndex = index; ItemState = state; ItemDateTime = datetime; ItemCount = count; ItemStateChangingEnabled = true; }
public void AddItem(string text, GroupState state, DateTime datetime, string count, List<string> symbols, List<SessionModel> sessions, string timeFrame, bool isAutoCollect) { //todo Invoke((Action)(() => { var ind = panelEx_container.Controls.Count; var cntrl = new StyledListItemControl(text, ind, state, datetime, count, timeFrame, isAutoCollect); cntrl.ItemSelectedChanged += cntrl_ItemSelectedChanged; cntrl.ItemEditGroupClick += cntrl_ItemEditGroupClick; panelEx_container.Controls.Add(cntrl); //if(SelectedItem==-1) SelectFirstItem(); cntrl.Symbols = symbols; cntrl.Sessions = sessions; })); }
public GroupItem(string text, int index, int depth, GroupState state, DateTime datetime, string count, bool isAutoCollect) { InitializeComponent(); Dock = DockStyle.Top; labelX_count.ForeColor = Color.Black; ItemIsAutoCollect = isAutoCollect; ItemDepth = depth; ItemText = text; ItemIndex = index; ItemState = state; ItemDateTime = datetime; ItemCount = count; ItemStateChangingEnabled = true; }
public void SetGroupState( RowIdentifier ri, GroupState groupState, bool layoutNow ) { System.Diagnostics.Debug.Assert( ri.GroupColumns != null ); if( FocusedItem != null && FocusedItem.RowIdentifier.GroupColumns.Length == 0 && Array.IndexOf( ri.Items, FocusedItem.RowIdentifier.Items[0] ) != -1 ) { bool isSelected = SelectedItems.Contains( FocusedItem.RowIdentifier ); PositionedRowIdentifier pri = GetPositionedIdentifierFromObject( ri ); if( pri != null ) { if( !SelectedItems.Contains( pri.RowIdentifier ) ) { SelectedItems.Add( pri.RowIdentifier ); } FocusedItem = pri; } } if( GetGroupState( ri ) != groupState ) { if( _globalGroupState == groupState ) { _groupExpansionState.Remove( ri ); } else { _groupExpansionState.Add( ri ); } ClearRowInformation(); if( layoutNow ) { Layout(); } else { Host.LazyLayout( this ); } } }
void cntrl_ItemSelectedChanged( int itemIndex, GroupState state) { OnItemStateChanged(itemIndex, state); }
void gi_ItemSelectedChanged(int itemIndex, int groupID, GroupState state, bool itemIsSelected, List<string> symbols) { OnItemStateChanged(itemIndex, groupID, state,itemIsSelected,symbols); }
private void CQGDataCollectorManager_ItemStateChanged(int index, GroupState state) { Invoke((Action) (() => { StoreGroupStatus(index, state); _groupItems[index].GroupState = state; //todo //groupList4.ChangeState(index, state); StateChanged(state,index); if (state == GroupState.InProgress) { _logger.LogAdd( @" Collecting start for group: " + _groupItems[index].GroupModel.GroupName + " [" + _groupItems[index].AllSymbols.Count + "]", Category.Information); Task.Factory.StartNew( () => SendLog(_groupItems[index].AllSymbols, DataAdminMessageFactory.LogMessage.Log.CollectGroup, _groupItems[index].GroupModel.GroupName, _groupItems[index].GroupModel.TimeFrame, true, false)).Wait(); if (_groupItems[index].AllSymbols.Count != 0) Task.Factory.StartNew( () => SendLog(_groupItems[index].AllSymbols, DataAdminMessageFactory.LogMessage.Log.CollectSymbol, "", _groupItems[index].GroupModel.TimeFrame, true, false)).Wait(); } if (state == GroupState.Finished) { _logger.LogAdd(@" Collecting finished for group: " + _groupItems[index].GroupModel.GroupName, Category.Information); _groupItems[index].GroupModel.End = DateTime.Now; //groupList4.ChangeDateTime(index, _groupItems[index].GroupModel.End); ChangeDateTime(index, _groupItems[index].GroupModel.End); ClientDatabaseManager.SetGroupEndDatetime(_groupItems[index].GroupModel.GroupId, _groupItems[index].GroupModel.End); ui__status_labelItem_status.Text = "Collecting finished for group: " + _groupItems[index].GroupModel.GroupName; // Task.Factory.StartNew(() => SendLog(_groupItems[index].CollectedSymbols, DataAdminMessageFactory.LogMessage.Log.CollectSymbol,"", _groupItems[index].GroupModel.TimeFrame, false, true)).Wait(); Task.Factory.StartNew( () => SendLog(_groupItems[index].AllSymbols, DataAdminMessageFactory.LogMessage.Log.CollectGroup, _groupItems[index].GroupModel.GroupName, _groupItems[index].GroupModel.TimeFrame, false, true)).Wait(); } })); }
private void StateChanged(GroupState state,int row) { if (state == GroupState.Finished) { for (int i = 0; i < superGridControl1.PrimaryGrid.Columns.Count; i++) { superGridControl1.GetCell(row, i).CellStyles.Default.Background.Color1 = Color.LightGreen; } superGridControl1.GetCell(row, 5).Value = state.ToString(); ChangeLogs(row, (DateTime.Now - startCollecting).Hours + "h:" + (DateTime.Now - startCollecting).Minutes + "m:" + (DateTime.Now - startCollecting).Seconds + "s",totalrows.ToString(),minrows,maxrows); totalrows = 0; minrows = 9999999; maxrows = 0; } if (state == GroupState.InProgress) { for (int i = 0; i < superGridControl1.PrimaryGrid.Columns.Count; i++) { superGridControl1.GetCell(row, i).CellStyles.Default.Background.Color1 = Color.Yellow; } superGridControl1.GetCell(row, 5).Value = state.ToString(); } if (state == GroupState.InQueue) { for (int i = 0; i < superGridControl1.PrimaryGrid.Columns.Count; i++) { superGridControl1.GetCell(row, i).CellStyles.Default.Background.Color1 = Color.DodgerBlue; } superGridControl1.GetCell(row, 5).Value = state.ToString(); } if (state == GroupState.NotInQueue) { for (int i = 0; i < superGridControl1.PrimaryGrid.Columns.Count; i++) { superGridControl1.GetCell(row, i).CellStyles.Default.Background.Color1 = Color.White; } superGridControl1.GetCell(row, 5).Value = state.ToString(); } int index = _groupItems.FindIndex(oo => oo.GroupModel.GroupName == (string) superGridControl1.GetCell(row, 1).Value); CQGDataCollectorManager.ChangeState(index, state); }
//public delegate void ItemColorChangedHandler(Status status); //public event ItemColorChangedHandler ItemColorChanged; private void StatusChanged(GroupState state) { //if (state == GroupState.Unsuccessful) ItemColor = Color.Red; if (state == GroupState.Finished) ItemColor = Color.LightGreen; if (state == GroupState.InProgress) ItemColor = Color.Yellow; if (state == GroupState.InQueue) ItemColor = Color.DodgerBlue; if (state == GroupState.NotInQueue) ItemColor = Color.White; //ItemColorChangedHandler handler = ItemColorChanged; //if (handler != null) handler(status); }
public static GroupState GetGroupState(ObjectListView olv, int groupId, GroupState mask) { return (GroupState)NativeMethods.SendMessage(olv.Handle, LVM_GETGROUPSTATE, groupId, (int)mask); }
protected virtual void OnItemSelectedChanged(int itemIndex, GroupState state) { if (state != GroupState.NotInQueue) { panelEx_left.BackColor = labelX_title.ForeColor = _mainColor; } else { panelEx_left.BackColor = Color.White; labelX_title.ForeColor = Color.Black; } ItemSelectedChangedHandler handler = ItemSelectedChanged; if (handler != null) handler( itemIndex, ItemState); }
private void SetOneState(bool value, GroupState mask) { this.StateMask ^= mask; if (value) this.State ^= mask; else this.State &= ~mask; if (this.Created) this.SetState(this.State, mask); }
private void groupList4_ItemStateChanged(int index, GroupState state) { StoreGroupStatus(index, state); _groupItems[index].GroupState = state; CQGDataCollectorManager.ChangeState(index, state); }
private bool GetOneState(GroupState mask) { if (this.Created) this.State = this.GetState(); return (this.State & mask) == mask; }
public static void ChangeState(int index, GroupState groupState) { _groups[index].GroupState = groupState; }
private static void OnItemStateChanged(int index, GroupState state) { ItemStateChangedHandler handler = ItemStateChanged; if (handler != null) handler(index, state); }
private void OnItemSelectedChanged(int itemIndex, int groupID, GroupState state, bool itemIsSelected, List<string> symbols) { //panelEx_isSelected.Visible = _isSelected; if (ItemState != GroupState.InProgress && _isSelected) ItemState = GroupState.InQueue; if (ItemState != GroupState.InProgress && !_isSelected) ItemState = GroupState.NotInQueue; ItemSelectedChangedHandler handler = ItemSelectedChanged; if (handler != null) handler(itemIndex, groupID, ItemState,ItemIsSelected,Symbols); }
public void ChangeState(int index, GroupState state) { var styledListItemControl = panelEx_container.Controls[index] as StyledListItemControl; if (styledListItemControl != null) styledListItemControl.ItemState = state; }
private void groupList4_ItemStateChanged(int index, int groupID, GroupState state, bool itemIsSelected, List<string> symbols) { //todo //if (itemIsSelected) //{ // SymbolItem.AddGroupItem(symbols, groupID, _client.UserID); // foreach (var panel in panelSymbolItem.Controls) // { // var symbolItem = panel as SymbolItem; // if (symbolItem != null) symbolItem.ColorStateChange(); // } // slidePanelSymbols.Focus(); // slidePanelSymbols.BringToFront(); //} //else //{ // SymbolItem.RemoveGroupItem(groupID); // foreach (var panel in panelSymbolItem.Controls) // { // var symbolItem = panel as SymbolItem; // if (symbolItem != null) symbolItem.ColorStateChange(); // //panelSymbolItem.Controls.Add(new SymbolItem(sym.SymbolName)); // // listViewSymbols.Items.Add(sym.SymbolName); // } // slidePanelSymbols.Focus(); // slidePanelSymbols.BringToFront(); //} //StoreGroupStatus(groupList4.Count-index-1, state); //_groupItems[index].GroupState = state; //CQGDataCollectorManager.ChangeState(index, state); }
public void SetItem(int ind, string text, GroupState groupState, DateTime dateTime, string count, List<string> symbols, List<SessionModel> sessions, string timeFrame, bool isAutoCollect) { if (ind < panelEx_container.Controls.Count) { var cntrl = panelEx_container.Controls[ind] as StyledListItemControl; cntrl.ItemText = text; cntrl.ItemState = groupState; cntrl.ItemDateTime = dateTime; cntrl.Symbols = symbols; cntrl.Sessions = sessions; cntrl.ItemCount = count; cntrl.ItemTimeframe = timeFrame; cntrl.ItemIsAutoCollect = isAutoCollect; } else { AddItem(text, groupState, dateTime, count, symbols, sessions, timeFrame, isAutoCollect); } }
private void StoreGroupStatus(int index, GroupState state) { var strIndex = "[" + index + "]"; if (state == GroupState.Finished || state == GroupState.NotInQueue || state == GroupState.InProgress) { if (Settings.Default.InQueueGroups.Contains(strIndex)) { var ind = Settings.Default.InQueueGroups.IndexOf(strIndex); Settings.Default.InQueueGroups = Settings.Default.InQueueGroups.Remove(ind, strIndex.Length); } } if (state == GroupState.InQueue) { if (!Settings.Default.InQueueGroups.Contains(strIndex)) Settings.Default.InQueueGroups += strIndex; } if (state == GroupState.Finished) { Settings.Default.InProgressGroup = ""; } if (state == GroupState.InProgress) { Settings.Default.InProgressGroup = strIndex; } //Console.WriteLine("#InQueue:" + Settings.Default.InQueueGroups); //Console.WriteLine("#InProgress:" + Settings.Default.InProgressGroup); Settings.Default.Save(); }
protected virtual void OnItemStateChanged(int index, GroupState state) { ItemStateChangedHandler handler = ItemStateChanged; if (handler != null) handler(index, state); }
/// <summary> /// Get the current state of this group from the underlying control /// </summary> protected int SetState(GroupState newState, GroupState mask) { NativeMethods.LVGROUP2 group = new NativeMethods.LVGROUP2(); group.cbSize = ((uint)Marshal.SizeOf(typeof(NativeMethods.LVGROUP2))); group.mask = (uint)GroupMask.LVGF_STATE; group.state = (uint)newState; group.stateMask = (uint)mask; return NativeMethods.SetGroupInfo(this.ListView, this.GroupId, group); }
protected virtual void OnItemStateChanged(int index, int groupID, GroupState state, bool itemIsSelected, List<string> symbols) { ItemStateChangedHandler handler = ItemStateChanged; if (handler != null) handler(index, groupID, state,itemIsSelected,symbols); }
/// <summary> /// Create a GroupStateChangedEventArgs /// </summary> /// <param name="group"></param> /// <param name="oldState"> </param> /// <param name="newState"> </param> public GroupStateChangedEventArgs(OLVGroup group, GroupState oldState, GroupState newState) { this.group = group; this.oldState = oldState; this.newState = newState; }
public void ChangeState(int index, GroupState state) { var groupItem = panelEx1.Controls[index] as GroupItem; if (groupItem != null) groupItem.ItemState = state; }