public int?GetNext(SELECTION_TYPE type, bool bRemove = false) { if (m_rgItems.Count == 0) { return(null); } if (type == SELECTION_TYPE.SEQUENTIAL) { int nIdx = m_rgItems[m_nIdx].Index; m_nIdx++; if (m_nIdx >= m_rgItems.Count) { m_nIdx = 0; } return(nIdx); } else { lock (m_objSync) { int nCount = m_rgItems.Count; if (nCount == 0) { return(null); } int nIdx = m_random.Next(nCount); if (m_rgItems[nIdx] == null) { m_rgItems.RemoveAt(nIdx); nCount = m_rgItems.Count; if (nCount == 0) { return(null); } nIdx = m_random.Next(nCount); } int nFinalIdx = m_rgItems[nIdx].Index; if (bRemove) { m_rgItems.RemoveAt(nIdx); } m_nIdx = nIdx + 1; if (m_nIdx == m_rgItems.Count) { m_nIdx = 0; } return(nFinalIdx); } } }
public void Initial(SELECTION_TYPE selecttype) { SelectionType = selecttype; //测量点清空 mline.Vertices.Clear(); //测量面积清空 marea.ExteriorRing.Vertices.Clear();; _R = 0; Refresh(); }
private void ShowCurrentSlotSelectionData() { if (objSlotDba == null) { objSlotDba = new SlotDba(); } SELECTION_TYPE selEnum = (SELECTION_TYPE)objSlotDba.GetSlotSelectionType(); if (selEnum == SELECTION_TYPE.CUSTOM) { LoadCustomizedZoneData(); selectionTypeText.Text = "CUSTOM"; } else if (selEnum == SELECTION_TYPE.PEAK) { LoadPeakHourZoneData(); selectionTypeText.Text = "PEAK HOUR"; } else { LoadDefaultZoneData(); selectionTypeText.Text = "DEFAULT"; } }
public HRESULT OnChangeType(SELECTION_TYPE eType, ISelectionServicesListener *pIListener) { return(((delegate * unmanaged <ISelectionServicesListener *, SELECTION_TYPE, ISelectionServicesListener *, int>)(lpVtbl[6]))((ISelectionServicesListener *)Unsafe.AsPointer(ref this), eType, pIListener)); }
public HRESULT SelectRange(IMarkupPointer *pStart, IMarkupPointer *pEnd, SELECTION_TYPE eType) { return(((delegate * unmanaged <IHTMLEditServices2 *, IMarkupPointer *, IMarkupPointer *, SELECTION_TYPE, int>)(lpVtbl[8]))((IHTMLEditServices2 *)Unsafe.AsPointer(ref this), pStart, pEnd, eType)); }