示例#1
0
 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);
             }
         }
     }
 }
示例#2
0
        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);
                }
            }
        }
示例#3
0
 public static void ChangeGroupState(Group group, GroupState state)
 {
     if ((group != null) && (group.State != state))
     {
         group.State = state;
     }
 }
示例#4
0
        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;
            }
        }
示例#5
0
        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...");
            }
        }
示例#8
0
        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));
            }
        }
示例#10
0
        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());
                }
            }
        }
示例#11
0
    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);
    }
示例#12
0
        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);
        }
示例#13
0
 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));
     }
 }
示例#14
0
 /*
  * 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);
 }
示例#15
0
 private bool GetOneState(GroupState mask)
 {
     if (this.Created)
     {
         this.State = this.GetState();
     }
     return((this.State & mask) == mask);
 }
示例#16
0
 public GroupItem()
 {
     InitializeComponent();
     Dock = DockStyle.Top;
     labelX_count.ForeColor = Color.Black;
     _state = GroupState.NotInQueue;
     ItemStateChangingEnabled = true;
 }
示例#17
0
    public void RollBack()
    {
        state             = memoryState;
        shuffleLeftIndex  = memoryShuffleLeftIndex;
        shuffleRightIndex = memoryShuffleRightIndex;

        pickElement.SetNotUse();
    }
示例#18
0
 private bool GetOneState(GroupState stateMask)
 {
     if (Created)
     {
         State = GetState();
     }
     return((State & stateMask) == stateMask);
 }
示例#19
0
 public GroupItem()
 {
     InitializeComponent();
     Dock = DockStyle.Top;
     labelX_count.ForeColor = Color.Black;
     _state = GroupState.NotInQueue;
     ItemStateChangingEnabled = true;
 }
示例#20
0
 /// <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));
 }
示例#21
0
        private static void OnItemStateChanged(int index, GroupState state)
        {
            ItemStateChangedHandler handler = ItemStateChanged;

            if (handler != null)
            {
                handler(index, state);
            }
        }
示例#22
0
 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;
 }
示例#23
0
        internal void ChangeState(int index, GroupState state)
        {
            var styledListItemControl = panelEx_container.Controls[index] as GroupItem;

            if (styledListItemControl != null)
            {
                styledListItemControl.ItemState = state;
            }
        }
示例#24
0
    // Update is called once per frame
    void Update()
    {
        GroupState input = (GroupState)Input.GetAxisRaw("Group Up");

        if (input != 0)
        {
            currentGrouping = input;
        }
    }
示例#25
0
        protected virtual void OnItemStateChanged(int index, GroupState state)
        {
            ItemStateChangedHandler handler = ItemStateChanged;

            if (handler != null)
            {
                handler(index, state);
            }
        }
示例#26
0
        public void ChangeState(int index, GroupState state)
        {
            var groupItem = panelEx1.Controls[index] as GroupItem;

            if (groupItem != null)
            {
                groupItem.ItemState = state;
            }
        }
示例#27
0
        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;
 }
示例#29
0
    public bool IsSuffleFinish()
    {
        var result = shuffeUseCount == GetSuffleMaxCount();

        if (result)
        {
            state = GroupState.GameReady;
        }
        return(result);
    }
示例#30
0
 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));
 }
示例#31
0
        public string NpcgroupInfo(NpcGroupType groupType)
        {
            string str = "";

            if (groupType < 0 || this.groupType == groupType)
            {
                str += "\n Type=" + groupType.ToString() + " State=" + GroupState.ToString();
            }
            return(str);
        }
示例#32
0
 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()));
     //}
 }
示例#33
0
    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;
    }
示例#34
0
 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;
 }
示例#35
0
        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;
        }
示例#36
0
 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;
     }));
 }
示例#37
0
        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;
        }
示例#38
0
        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 );
                }
            }
        }
示例#39
0
 void cntrl_ItemSelectedChanged( int itemIndex, GroupState state)
 {
     OnItemStateChanged(itemIndex, state);
 }
示例#40
0
 void gi_ItemSelectedChanged(int itemIndex, int groupID, GroupState state, bool itemIsSelected, List<string> symbols)
 {
     OnItemStateChanged(itemIndex, groupID, state,itemIsSelected,symbols);
 }
示例#41
0
        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();
                }

            }));
        }
示例#42
0
        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);
        }
示例#43
0
        //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);
        }
示例#44
0
 public static GroupState GetGroupState(ObjectListView olv, int groupId, GroupState mask) {
     return (GroupState)NativeMethods.SendMessage(olv.Handle, LVM_GETGROUPSTATE, groupId, (int)mask);
 }
示例#45
0
        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);
        }
示例#46
0
        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);
        }
示例#47
0
        private void groupList4_ItemStateChanged(int index, GroupState state)
        {
            StoreGroupStatus(index, state);

            _groupItems[index].GroupState = state;
            CQGDataCollectorManager.ChangeState(index, state);
        }
示例#48
0
 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);
 }
示例#51
0
        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);
        }
示例#52
0
 public void ChangeState(int index, GroupState state)
 {
     var styledListItemControl = panelEx_container.Controls[index] as StyledListItemControl;
     if (styledListItemControl != null)
         styledListItemControl.ItemState = state;
 }
示例#53
0
        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);
        }
示例#54
0
        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);
            }
        }
示例#55
0
        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();
        }
示例#56
0
 protected virtual void OnItemStateChanged(int index, GroupState state)
 {
     ItemStateChangedHandler handler = ItemStateChanged;
     if (handler != null) handler(index, state);
 }
示例#57
0
 /// <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);
 }
示例#58
0
 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);
 }
示例#59
0
 /// <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;
 }
示例#60
0
 public void ChangeState(int index, GroupState state)
 {
     var groupItem = panelEx1.Controls[index] as GroupItem;
     if (groupItem != null)
         groupItem.ItemState = state;
 }