public void MoveDataSourceDown(Int32 index) { DataLink tempDataLink = _targetData[index]; _targetData[index] = _targetData[index + 1]; _targetData[index + 1] = tempDataLink; }
public void RemoveDataSource(Int32 aIndex) { if (_targetData == null) { return; } _targetData[aIndex].DataClassRef.Sleep(); if (_targetData.GetUpperBound(0) == 0) { _targetData = null; return; } DataLink[] tempLink = null; tempLink = new DataLink[_targetData.GetUpperBound(0)]; Int32 j = 0; for (Int32 i = 0; i <= _targetData.GetUpperBound(0); i++) { if (i != aIndex) { tempLink[j] = _targetData[i]; j++; } } _targetData = tempLink; //UpdateName(); renderer.ForceIconRedraw(); }
private void AddDataSource(string DataText,string DataLabelText) { DataLink tempLink = new DataLink(); tempLink.DataClassRef = DataManager.GetDataClassRef(DataText); for (Int32 i = 0; i <= tempLink.DataClassRef.DataLabels.GetUpperBound(0); i++) { if (tempLink.DataClassRef.DataLabels[i] == DataLabelText) { tempLink.DataIndex = i; break; } } TargetIcon.AddDataSource(tempLink); PopulateTargetDataList(); }
private void AddDataSource(string DataText, string DataLabelText) { DataLink tempLink = new DataLink(); tempLink.DataClassRef = DataManager.GetDataClassRef(DataText); for (Int32 i = 0; i <= tempLink.DataClassRef.DataLabels.GetUpperBound(0); i++) { if (tempLink.DataClassRef.DataLabels[i] == DataLabelText) { tempLink.DataIndex = i; break; } } TargetIcon.AddDataSource(tempLink); PopulateTargetDataList(); }
//Add an icon into the TrayIcons array. public static void AddIcon(string aIconName, String RolloverText, DataLink[] aTargetData, Color BackgroundColor, Color ForegroundColor) { lock (_iconLock) { if (InvokeControl.InvokeRequired) { MessageBox.Show("Failed to invoke when adding icon.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); throw new Exception("Failed to invoke when adding icon."); } if (trayIcons == null) { trayIcons = new TrayIcon[1]; } else { Array.Resize(ref trayIcons, trayIcons.GetUpperBound(0) + 2); } trayIcons[trayIcons.GetUpperBound(0)] = new TrayIcon(aIconName, RolloverText, aTargetData, BackgroundColor, ForegroundColor); CheckDummyIconVisibliy(); ReshowIcons(); } }
//Constructor public TrayIcon(string aIconName, String aRolloverText, DataLink[] aTargetData, Color BackgroundColor, Color ForegroundColor) { _iconName = aIconName; _rolloverText = aRolloverText; renderer = new RendererBasic(); ((RendererBasic)renderer).BackgroundColour = BackgroundColor; ((RendererBasic)renderer).ForegroundColour = ForegroundColor; ((RendererBasic)renderer).UseAlpha = true; if (aTargetData != null) { foreach (DataLink dataLink in aTargetData) { AddDataSource(dataLink); } } MakeTrayIcon(); }
public void AddDataSource(DataLink aDataLink) { if (aDataLink.DataClassRef == null) { return; } if (_targetData == null) { _targetData = new DataLink[1]; } else { Array.Resize(ref _targetData, _targetData.GetUpperBound(0) + 2); } if (aDataLink.DataClassRef != null) { _targetData[_targetData.GetUpperBound(0)] = aDataLink; aDataLink.DataClassRef.Wake(); //UpdateName(); renderer.ForceIconRedraw(); } }
private void ReadDataNode(XmlReader aR) { DataLink tempLink; tempLink = new DataLink(); string thisNode = ""; while (aR.Read()) { switch (aR.NodeType) { case XmlNodeType.Element: thisNode = aR.Name; break; case XmlNodeType.Text: if (thisNode == "Name") { tempLink.DataClassRef = DataManager.GetDataClassRef(aR.Value); break; } if (thisNode == "Index") { tempLink.DataIndex = Int32.Parse(aR.Value); break; } break; case XmlNodeType.EndElement: if (aR.Name == "Node") { AddDataSource(tempLink); return; } break; } } }
public Int32[] ConvertToIconValues(DataLink[] aValues) { Int32[] iconValues = null; if (aValues != null) { iconValues = new Int32[aValues.GetUpperBound(0) + 1]; for (Int32 i = 0; i <= aValues.GetUpperBound(0); i++) { if (aValues[i].DataClassRef == null) { return null; } if (aValues[i].DataIndex >= 0 && aValues[i].DataIndex <= aValues[i].DataClassRef.CurrentValue.Length - 1) { iconValues[i] = (Int32)ToPer(aValues[i].DataClassRef.CurrentValue[aValues[i].DataIndex], aValues[i].DataClassRef.MaxValue[aValues[i].DataIndex], valueScale); } } } return iconValues; }