// protected override void Update() { base.Update(); highlighter.ConstantOnImmediate(ColorTool.GetColor(t)); t += Time.deltaTime * velocity; t %= 1f; }
private void InitUI() { txtMonth.Text = date.Month.ToString() + "月"; txtDay.Text = date.Day.ToString(); txtWeek.Text = DateTool.DayOfWeek(date); if (date.Date == DateTime.Today) { DateSP.Background = ColorTool.HexColorToBrush("#c5f3ff"); RoomGrid.Background = ColorTool.HexColorToBrush("#53a9ba"); } Task.Factory.StartNew(() => { //改成用DispatcherPriority,因為如果快速換月份 //一直跑UI,馬上又丟棄太浪費資源 //改成有空閒再跑會議房間就好 this.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, new Action(() => //this.Dispatcher.BeginInvoke(new Action(() => { //meetingList.ForEach(item => foreach (UserMeeting item in meetingList) { var room = new MeetingRoom(UserID, UserPWD, item, this.Home_Change2MeetingDataCT_Event, NewAddMeetingID); MeetingRoomWP.Children.Add(room); } //); })); }); }
private static ColorTool FindNearestSystemColorTool(Color rc) { double hd, sd, bd, td, ltd; ColorTool rtn = null; ltd = double.MaxValue; foreach (ColorTool gct in AllColorTools) { Color gc = gct.color; // Use a simple Euclidean formula to determine which of the system colors is // closest to the requested color. Weight Hue twice as much as Saturation and // Brightness. hd = (2) * (1000 / 360) * (Math.Pow((rc.GetHue() - gc.GetHue()), 2)); sd = (1) * (1000 / 1) * (Math.Pow((rc.GetSaturation() - gc.GetSaturation()), 2)); bd = (1) * (1000 / 1) * (Math.Pow((rc.GetBrightness() - gc.GetBrightness()), 2)); td = hd + sd + bd; // As the total difference gets lower, the color is getting closer. Keep // track of the lowest total difference, and it's owning color. if (td < ltd) { ltd = td; rtn = gct; // Exact color match, we are done if (td == 0) { break; } } } return(rtn); }
private void _003CInitEvent_003Eb__a(object sender, MouseButtonEventArgs e) { ClearButtonColor(); btnIsSigned.Background = ColorTool.HexColorToBrush("#019fde"); txtIsSigned.Foreground = Brushes.White; ChangeSignRow_ByOrder(SignListCT_Order.是否簽到); }
public void Init(int width, int height, float mapScale, Func <int, int, int> randomRangeFuc = null) { this.height = (height / 2) * 2 + 1; this.width = (width / 2) * 2 + 1; this.mapScale = mapScale; if (randomRangeFuc != null) { RandomRange = randomRangeFuc; } else { RandomRange = UnityEngine.Random.Range; } nodes = new Tile[this.width, this.height]; directions = new int[4][]; directions[0] = new int[] { 1, 0 }; directions[1] = new int[] { 0, 1 }; directions[2] = new int[] { -1, 0 }; directions[3] = new int[] { 0, -1 }; rooms = new List <Room>(); colors = new Color[10]; for (int i = 0; i < colors.Length; i++) { colors[i] = ColorTool.RandomColorHSV(); } for (int x = 0; x < this.width; x += 1) { for (int y = 0; y < this.height; y += 1) { nodes[x, y] = new Tile().Init(x, y); } } }
private void _003CInitEvent_003Eb__2(object sender, MouseEventArgs e) { MouseTool.ShowHand(); if (!btnImg.Source.ToString().Contains("images/icon_arrow_active.png")) { base.Background = ColorTool.HexColorToBrush("#f1f5f6"); } }
private void ClearButtonColor() { btnIndex.Background = ColorTool.HexColorToBrush("#D3Dce0"); btnDept.Background = ColorTool.HexColorToBrush("#D3Dce0"); btnIsSigned.Background = ColorTool.HexColorToBrush("#D3Dce0"); txtIndex.Foreground = Brushes.Black; txtDept.Foreground = Brushes.Black; txtIsSigned.Foreground = Brushes.Black; }
private void ChangeBackground(object sender, DictionaryEventArgas e) { nowVM = e.dict["FolderVM"] as FolderDataFolderListFolder; foreach (var item in SP.Children.OfType <JoinRow>()) { item.Background = ColorTool.HexColorToBrush("#00A2C2"); } }
public override void OnMouseDown(int Button, int Shift, int X, int Y) { if (Button != 1 || m_hookHelper.FocusMap.LayerCount <= 0) { return; } IActiveView activeView = m_hookHelper.ActiveView; IGraphicsContainer graphicsContainer = activeView as IGraphicsContainer; // 删除地图上添加的所有Element graphicsContainer.DeleteAllElements(); // 获得点击位置并转化为点图形要素 IPoint point = activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); // 获取地图中的图层 IFeatureLayer featureLayer = m_hookHelper.FocusMap.get_Layer(0) as IFeatureLayer; if (featureLayer == null) { return; } IFeatureClass featureClass = featureLayer.FeatureClass; // 进行点击,查询图层要素 ISpatialFilter spatialFilter = new SpatialFilterClass(); spatialFilter.Geometry = point; spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects; IFeatureCursor featureCursor = featureClass.Search(spatialFilter, false); // 获得点击查询的要素 IFeature feature = featureCursor.NextFeature(); if (feature != null && feature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon) { IGeometry geometry = feature.Shape as IGeometry; // 通过ITopologicalOperator接口进行多边行的简单化处理 ITopologicalOperator topologicalOperator = geometry as ITopologicalOperator; topologicalOperator.Simplify(); // 创建缓冲区 IGeometry bufferGeometry = topologicalOperator.Buffer(5000); // 创建多边形符号样式并添加到地图上 IScreenDisplay screenDisplay = activeView.ScreenDisplay; ISimpleFillSymbol simpleFillSymbol = new SimpleFillSymbolClass(); simpleFillSymbol.Style = esriSimpleFillStyle.esriSFSCross; IRgbColor rgbColor = ColorTool.GetRgbColor(211, 100, 200); simpleFillSymbol.Color = rgbColor; // 创建多边行渲染效果的Element IFillShapeElement fillShapElement = new PolygonElementClass(); IElement element = fillShapElement as IElement; element.Geometry = bufferGeometry; fillShapElement.Symbol = simpleFillSymbol; // 将渲染之后的多边形element添加到地图IGraphicsContainer中 graphicsContainer.AddElement(fillShapElement as IElement, 0); } // 刷新地图 activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); }
public override void OnMouseDown(int Button, int Shift, int X, int Y) { if (Button != 1 || m_HookHelper.FocusMap.LayerCount <= 0) { return; } IMap map = m_HookHelper.FocusMap; IActiveView activeView = m_HookHelper.ActiveView; // 获取点击位置并抓化为点图形要素 IPoint point = activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); // 获取地图中的图层 IFeatureLayer featureLayer = activeView.FocusMap.get_Layer(0) as IFeatureLayer; if (featureLayer == null) { return; } IFeatureClass featureCLass = featureLayer.FeatureClass; // 进行点击,选择要素 ISpatialFilter spatialFilter = new SpatialFilterClass(); spatialFilter.Geometry = point; spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects; IFeatureCursor featureCursor = featureCLass.Search(spatialFilter, false); // 获得点击查询的要素 IFeature feature = featureCursor.NextFeature(); if (feature != null && feature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon) { map.ClearSelection(); IRelationalOperator relationalOperator = feature.Shape as IRelationalOperator; // 设置被选择要素的颜色 IRgbColor rgbColor = ColorTool.GetRgbColor(255, 0, 0); IFeatureSelection featureSelection = featureLayer as IFeatureSelection; featureSelection.SelectionColor = rgbColor; // 查找邻接要素,并之余地图的选择集中 IFeatureCursor nearFeatureCursor = featureLayer.Search(null, false); IFeature nearFeature = nearFeatureCursor.NextFeature(); // 遍历图层内所有要素进行邻接判定 while (nearFeature != null) { if (relationalOperator.Touches(nearFeature.Shape)) { // 如果对比要素与当前选择要素邻接,则加入到地图选择集中 map.SelectFeature(featureLayer, nearFeature); } nearFeature = nearFeatureCursor.NextFeature(); } } // 刷新地图 activeView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, activeView.Extent); }
private void SeriesMenu_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { MouseTool.ShowLoading(); btnImg.Source = new BitmapImage(new Uri("images/icon_arrow_active.png", UriKind.Relative)); base.Background = ColorTool.HexColorToBrush("#019fde"); txtSeriesName.Foreground = Brushes.White; if (this.SeriesMeetingCT_ChangeMeetingRoomWP_Event != null) { this.SeriesMeetingCT_ChangeMeetingRoomWP_Event(seriesDataSeriesMeetingSeries.ID); } }
private void InitUI() { txtMonth.Text = date.Month + "月"; txtDay.Text = date.Day.ToString(); txtWeek.Text = DateTool.DayOfWeek(date); if (date.Date == DateTime.Today) { DateSP.Background = ColorTool.HexColorToBrush("#c5f3ff"); RoomGrid.Background = ColorTool.HexColorToBrush("#53a9ba"); } Task.Factory.StartNew(new Action(_003CInitUI_003Eb__3)); }
private void InitEvent() { //txtIsSigned.MouseEnter += (sender, e) => { MouseTool.ShowHand(); }; //txtIsSigned.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); }; //txtIsSigned.MouseLeftButtonDown += txtIsSigned_MouseLeftButtonDown; btnIndex.MouseEnter += (sender, e) => { MouseTool.ShowHand(); }; //ClearBorderColor(); btnIndex.BorderBrush = Brushes.Gray; }; btnIndex.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); }; btnIndex.MouseLeftButtonDown += (sender, e) => { ClearButtonColor(); this.btnIndex.Background = ColorTool.HexColorToBrush("#019fde"); this.txtIndex.Foreground = Brushes.White; ChangeSignRow_ByOrder(SignListCT_Order.序號); }; btnDept.MouseEnter += (sender, e) => { MouseTool.ShowHand(); }; //ClearBorderColor(); btnDept.BorderBrush = Brushes.Gray; }; btnDept.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); }; btnDept.MouseLeftButtonDown += (sender, e) => { ClearButtonColor(); this.btnDept.Background = ColorTool.HexColorToBrush("#019fde"); this.txtDept.Foreground = Brushes.White; ChangeSignRow_ByOrder(SignListCT_Order.機關單位); }; btnIsSigned.MouseEnter += (sender, e) => { MouseTool.ShowHand(); }; //ClearBorderColor(); btnIsSigned.BorderBrush = Brushes.Gray; }; btnIsSigned.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); }; btnIsSigned.MouseLeftButtonDown += (sender, e) => { ClearButtonColor(); this.btnIsSigned.Background = ColorTool.HexColorToBrush("#019fde"); this.txtIsSigned.Foreground = Brushes.White; ChangeSignRow_ByOrder(SignListCT_Order.是否簽到); }; txtKeyword.MouseEnter += (sender, e) => { MouseTool.ShowIBeam(); txtKeyword.Focus(); }; txtKeyword.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); }; //Keyboard.ClearFocus(); txtKeyword.KeyUp += txtKeyword_KeyUp; txtKeyword.Focus(); btnAddUser.MouseEnter += (sender, e) => { MouseTool.ShowHand(); }; btnAddUser.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); }; btnAddUser.MouseLeftButtonDown += (sender, e) => { Home Home_Window = Application.Current.Windows.OfType <Home>().FirstOrDefault(); if (Home_Window != null) { Home_Window.CC.Content = new SignPadCT("guest", "來賓", "", "", (x, y) => { Home_Window.CC.Content = new SignListCT_Mix(); }); } }; }
/// <summary> /// 配置信息UI、移动、攻击输入 /// </summary> public void SetupUIAndInput(Points waypoints) { playerNameText.text = PlayerName; ColorTool.ChangeSelfAndChildrens(gameObject, RepresentColor, colorMaterialName); // 坦克颜色 if (Team != null) { playerNameText.color = Team.TeamColor; playerIconMesh.material.color = Team.TeamColor; // 图标颜色 } tankMovement.SetupPlayerInput(PlayerID); // 配置坦克移动输入 tankAttack.SetShortcutName("Fire" + PlayerID); // 配置坦克攻击输入 stateController.SetWaypoints(waypoints); }
public void _003CInitUI_003Eb__6() { foreach (SeriesDataSeriesMeetingSeries series in SeriesList) { SeriesMenu seriesMenu = new SeriesMenu(series, _003C_003E4__this.SeriesMeetingCT_ChangeMeetingRoomWP_Callback); _003C_003E4__this.SeriesMenuSP.Children.Add(seriesMenu); if (seriesMenu.seriesDataSeriesMeetingSeries.ID.Equals(_003C_003E4__this.NowSeriesID)) { seriesMenu.btnImg.Source = new BitmapImage(new Uri("images/icon_arrow_active.png", UriKind.Relative)); seriesMenu.Background = ColorTool.HexColorToBrush("#019fde"); seriesMenu.txtSeriesName.Foreground = Brushes.White; } } }
/// <summary> /// 添加字段,并设置字段对应的颜色,存储在_dicFieldAndColor中 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOK_Click(object sender, EventArgs e) { if (!SelectedCheck()) { return; } Color color; IRgbColor rgbColor = null; string fieldName = string.Empty; Dictionary <string, IRgbColor> _dicFieldAndColor = null; _dicFieldAndColor = new Dictionary <string, IRgbColor>(); for (int i = 0; i < dataGridView.Rows.Count - 1; i++) { fieldName = dataGridView.Rows[i].Cells[0].Value.ToString(); switch (dataGridView.Rows[i].Cells[2].Value.ToString()) { case "Red": color = Color.Red; break; case "Blue": color = Color.Blue; break; case "Green": color = Color.Green; break; case "Brown": color = Color.Brown; break; default: color = Color.Yellow; break; } rgbColor = ColorTool.GetRgbColor((int)color.R, (int)color.G, (int)color.B); if (!_dicFieldAndColor.ContainsKey(fieldName)) { _dicFieldAndColor.Add(fieldName, rgbColor); } } Render(cmbSelLayer.SelectedItem.ToString(), _dicFieldAndColor); mFieldArrayName.Clear(); cmbSelLayer.SelectedIndex = -1; cmbSelLayer.Text = ""; dataGridView.Rows.Clear(); Close(); }
// void Toggle() { if (state) { h.ConstantOffImmediate(); state = false; } else { Color color = ColorTool.GetColor(Random.value); h.ConstantOnImmediate(color); state = true; } }
public override void OnMouseDown(int Button, int Shift, int X, int Y) { if (Button != 1 || m_hookHelper.FocusMap.LayerCount <= 0) { return; } IActiveView activeView = m_hookHelper.ActiveView; IGraphicsContainer graphicsContainer = activeView as IGraphicsContainer; // 删除地图上添加的所有element graphicsContainer.DeleteAllElements(); // 获得点击位置并转换为点图形要素 IPoint ponit = activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y); // 获取地图中的图层 IFeatureLayer featureLayer = m_hookHelper.FocusMap.get_Layer(0) as IFeatureLayer; if (featureLayer == null) { return; } IFeatureClass featureClass = featureLayer.FeatureClass; // 进行点击,查询图层要素 ISpatialFilter spatialFilter = new SpatialFilterClass(); spatialFilter.Geometry = ponit; spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIndexIntersects; IFeatureCursor featureCursor = featureClass.Search(spatialFilter, false); // 获得点击查询的要素 IFeature feature = featureCursor.NextFeature(); if (feature != null && feature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon) { IGeometry geometry = feature.Shape as IGeometry; ITopologicalOperator topologicalOperator = geometry as ITopologicalOperator; // 获取边界 IGeometry bounddary = topologicalOperator.Boundary; ILineElement lineElement = new LineElementClass(); ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbol(); IRgbColor rgbcolor = ColorTool.GetRgbColor(0, 255, 0); simpleLineSymbol.Color = rgbcolor; simpleLineSymbol.Width = 5; lineElement.Symbol = simpleLineSymbol; IElement element = lineElement as IElement; element.Geometry = bounddary; graphicsContainer.AddElement(element, 0); } // 刷新地图 activeView.PartialRefresh(esriViewDrawPhase.esriViewBackground, null, null); }
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { ColorTool tool = value as ColorTool; if (tool != null) { SolidColorBrush brush = tool.Color as SolidColorBrush; if (brush != null) { return(brush.Color); } } return(Colors.Black); }
private void UserControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (dictEvent != null) { Dictionary <string, object> dict = new Dictionary <string, object>() { { "FolderVM", VM } }; dictEvent(this, new DictionaryEventArgas() { dict = dict }); } this.Background = ColorTool.HexColorToBrush("#FFD933"); }
private void txtName_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { Brush brush = ColorTool.HexColorToBrush("#0093b0"); if (txtAgendaName.Foreground.ToString().Equals(brush.ToString())) { this.MeetingDataCT_ShowAgendaFile_Event(meetingDataAgenda.ID, meetingDataAgenda.ParentID, IsDbClick: true); } else { this.MeetingDataCT_ShowAgendaFile_Event(meetingDataAgenda.ID, meetingDataAgenda.ParentID, IsDbClick: false); } txtAgendaName.Foreground = brush; txtAgendaName.Inlines.LastInline.Foreground = brush; txtCaption.Foreground = brush; }
private void ChangeColor(string cbDataKey) { switch (cbDataKey) { case "未開始": btnProgress.Foreground = ColorTool.HexColorToBrush("#3746db"); break; case "已結束": btnProgress.Foreground = ColorTool.HexColorToBrush("#000000"); break; case "進行中": btnProgress.Foreground = ColorTool.HexColorToBrush("#ff1a1a"); break; } }
private void ChangeServerCtrl(bool Online) { if (Online == true) { txtStatus.Text = "連線中"; txtStatus.Foreground = ColorTool.HexColorToBrush("#E2F540"); txtStatus.HorizontalAlignment = HorizontalAlignment.Left; btnStatus.Source = new BitmapImage(new Uri("images/btn_broadcast_connected.png", UriKind.Relative)); } else { txtStatus.Text = "未啟動"; txtStatus.Foreground = ColorTool.HexColorToBrush("#707A82"); txtStatus.HorizontalAlignment = HorizontalAlignment.Center; btnStatus.Source = new BitmapImage(new Uri("images/btn_broadcast_broken.png", UriKind.Relative)); } }
/// <summary> /// 重写重置UI事件 /// </summary> public override void InitUI() { base.InitUI(); cmbSelectedField.Items.Clear(); cmbSelectedField.Items.Add("Black"); cmbSelectedField.Items.Add("Whtile"); cmbSelectedField.Items.Add("Red"); cmbSelectedField.Items.Add("Green"); cmbSelectedField.Items.Add("Blue"); ColorDictionary = new Dictionary <string, IRgbColor>(); ColorDictionary.Add("Black", ColorTool.GetRgbColor(0, 0, 0)); ColorDictionary.Add("Whtile", ColorTool.GetRgbColor(255, 255, 255)); ColorDictionary.Add("Red", ColorTool.GetRgbColor(255, 0, 0)); ColorDictionary.Add("Green", ColorTool.GetRgbColor(0, 255, 0)); ColorDictionary.Add("Blue", ColorTool.GetRgbColor(0, 0, 255)); }
private void txtName_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { //if (IsHasFile == false && IsHasChildren == false ) // return; Brush BlueBrush = ColorTool.HexColorToBrush("#0093b0"); if (txtAgendaName.Foreground.ToString().Equals(BlueBrush.ToString())) { MeetingDataCT_ShowAgendaFile_Event(meetingDataAgenda.ID, meetingDataAgenda.ParentID, true); } else { MeetingDataCT_ShowAgendaFile_Event(meetingDataAgenda.ID, meetingDataAgenda.ParentID, false); } txtAgendaName.Foreground = BlueBrush; txtAgendaName.Inlines.LastInline.Foreground = BlueBrush; txtCaption.Foreground = BlueBrush; }
public ColorManager() { // Walk thru all the System defined colors and keep a list of // them to compare against requested colors. To save resources, // we don't want to make any new colors if possible, just use the // closest available System defined color (there are ~140 of them). Array AllKnownColors = Enum.GetValues(typeof(KnownColor)); foreach (KnownColor kc in AllKnownColors) { Color c = Color.FromKnownColor(kc); if (!c.IsSystemColor && c.Name != "Transparent") { ColorTool ct = new ColorTool(); ct.color = c; ct.pen = new Pen(c); ct.brush = new SolidBrush(c); AllColorTools.Add(ct); } } }
private void InitEvent() { this.MouseEnter += (sender, e) => { MouseTool.ShowHand(); if (this.btnImg.Source.ToString().Contains("images/icon_arrow_active.png") == false) { this.Background = ColorTool.HexColorToBrush("#f1f5f6"); } //lblMousehover.Visibility = Visibility.Visible; }; this.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); if (this.btnImg.Source.ToString().Contains("images/icon_arrow_active.png") == false) { this.Background = Brushes.Transparent; } //lblMousehover.Visibility = Visibility.Collapsed; }; this.MouseLeftButtonDown += SeriesMenu_MouseLeftButtonDown; }
private void AddLineRender(int index) { if (lineParent.childCount >= roadParent.childCount) { return; } GameObject line = new GameObject("line" + index.ToString()); line.transform.parent = lineParent.transform; line.transform.localPosition = Vector3.zero; LineRenderer lr = line.AddComponent <LineRenderer>(); lr.startColor = ColorTool.RandomColor(1, 0.5f, 1); lr.endColor = lr.startColor; lr.startWidth = 0.2f; lr.endWidth = 0.2f; lr.material = lineMat; lineList.Add(lr); }
private void ClearBorderColor() { btnIndex.BorderBrush = ColorTool.HexColorToBrush("#5F879B"); btnDept.BorderBrush = ColorTool.HexColorToBrush("#5F879B"); btnIsSigned.BorderBrush = ColorTool.HexColorToBrush("#5F879B"); }
private void InitUI() { SeriesMeetingCT_ChangeMeetingRoomWP_Callback = new SeriesMeetingCT_ChangeMeetingRoomWP_Function(ChangeMeetingRoomWP); List <SeriesDataSeriesMeetingSeries> SeriesList = new List <SeriesDataSeriesMeetingSeries>(); List <SeriesDataSeriesMeetingMeeting> MeetingList = new List <SeriesDataSeriesMeetingMeeting>(); foreach (SeriesDataSeriesMeeting seriesMeeting in seriesData.SeriesMeeting) { SeriesList.Add(seriesMeeting.Series); MeetingList.AddRange(seriesMeeting.MeetingList.ToList()); } string CourseOrMeeting_String = PaperLess_Emeeting.Properties.Settings.Default.CourseOrMeeting_String; txtCount.Text = string.Format("共 {0} 組系列{1}", SeriesList.Count, CourseOrMeeting_String); Task.Factory.StartNew(() => { this.Dispatcher.BeginInvoke(new Action(() => { //int i = 0; //SeriesList.ForEach(item => foreach (SeriesDataSeriesMeetingSeries item in SeriesList) { //i++; SeriesMenu sm = new SeriesMenu(item, SeriesMeetingCT_ChangeMeetingRoomWP_Callback); SeriesMenuSP.Children.Add(sm); if (sm.seriesDataSeriesMeetingSeries.ID.Equals(NowSeriesID) == true) { sm.btnImg.Source = new BitmapImage(new Uri("images/icon_arrow_active.png", UriKind.Relative)); //sm.Background = new SolidColorBrush(Color.FromRgb(1, 161, 195)); sm.Background = ColorTool.HexColorToBrush("#019fde"); sm.txtSeriesName.Foreground = Brushes.White; } }//); })); this.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, new Action(() => //this.Dispatcher.BeginInvoke(new Action(() => { int i = 0; //MeetingList.ForEach(item => int total = 0; foreach (SeriesDataSeriesMeetingMeeting item in MeetingList) { i++; UserMeeting um = new UserMeeting(); um.BeginTime = item.BeginTime; um.EndTime = item.EndTime; um.ID = item.ID; um.isBrowserd = item.isBrowserd; um.isDownload = item.isDownload; um.Location = item.Location; um.Name = item.Name; um.pincode = item.pincode; um.SeriesMeetingID = item.SeriesMeetingID; um.type = item.type; Home Home_Window = App.Current.Windows.OfType <Home>().FirstOrDefault(); if (Home_Window != null) { bool invisible = false; if (NowSeriesID.Equals("") == false && um.SeriesMeetingID.Equals(NowSeriesID) == false) { invisible = true; } else { ++total; } var room = new MeetingRoom(UserID, UserPWD, um, Home_Window.Home_Change2MeetingDataCT_Callback, "", invisible); MeetingRoomWP.Children.Add(room); } //string CourseOrMeeting_String = PaperLess_Emeeting.Properties.Settings.Default.CourseOrMeeting_String; //txtCount.Text = string.Format("共 {0} 組系列{1}", total, CourseOrMeeting_String); }//); })); }); }