public void AddAlertCollectionRow(AlertCustomerExpressionDS.AlertCollectionRow row) { base.Rows.Add(row); }
public void RemoveAlertCollectionRow(AlertCustomerExpressionDS.AlertCollectionRow row) { base.Rows.Remove(row); }
public static XmlSchemaComplexType GetTypedTableSchema(XmlSchemaSet xs) { XmlSchemaComplexType xmlSchemaComplexType = new XmlSchemaComplexType(); XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence(); AlertCustomerExpressionDS alertCustomerExpressionDS = new AlertCustomerExpressionDS(); XmlSchemaAny xmlSchemaAny = new XmlSchemaAny(); xmlSchemaAny.Namespace = "http://www.w3.org/2001/XMLSchema"; xmlSchemaAny.MinOccurs = 0m; xmlSchemaAny.MaxOccurs = 79228162514264337593543950335m; xmlSchemaAny.ProcessContents = XmlSchemaContentProcessing.Lax; xmlSchemaSequence.Items.Add(xmlSchemaAny); XmlSchemaAny xmlSchemaAny2 = new XmlSchemaAny(); xmlSchemaAny2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; xmlSchemaAny2.MinOccurs = 1m; xmlSchemaAny2.ProcessContents = XmlSchemaContentProcessing.Lax; xmlSchemaSequence.Items.Add(xmlSchemaAny2); XmlSchemaAttribute xmlSchemaAttribute = new XmlSchemaAttribute(); xmlSchemaAttribute.Name = "namespace"; xmlSchemaAttribute.FixedValue = alertCustomerExpressionDS.Namespace; xmlSchemaComplexType.Attributes.Add(xmlSchemaAttribute); XmlSchemaAttribute xmlSchemaAttribute2 = new XmlSchemaAttribute(); xmlSchemaAttribute2.Name = "tableTypeName"; xmlSchemaAttribute2.FixedValue = "AlertCollectionDataTable"; xmlSchemaComplexType.Attributes.Add(xmlSchemaAttribute2); xmlSchemaComplexType.Particle = xmlSchemaSequence; XmlSchema schemaSerializable = alertCustomerExpressionDS.GetSchemaSerializable(); XmlSchemaComplexType result; if (xs.Contains(schemaSerializable.TargetNamespace)) { MemoryStream memoryStream = new MemoryStream(); MemoryStream memoryStream2 = new MemoryStream(); try { schemaSerializable.Write(memoryStream); IEnumerator enumerator = xs.Schemas(schemaSerializable.TargetNamespace).GetEnumerator(); while (enumerator.MoveNext()) { XmlSchema xmlSchema = (XmlSchema)enumerator.Current; memoryStream2.SetLength(0L); xmlSchema.Write(memoryStream2); if (memoryStream.Length == memoryStream2.Length) { memoryStream.Position = 0L; memoryStream2.Position = 0L; while (memoryStream.Position != memoryStream.Length && memoryStream.ReadByte() == memoryStream2.ReadByte()) { } if (memoryStream.Position == memoryStream.Length) { result = xmlSchemaComplexType; return result; } } } } finally { if (memoryStream != null) { memoryStream.Close(); } if (memoryStream2 != null) { memoryStream2.Close(); } } } xs.Add(schemaSerializable); result = xmlSchemaComplexType; return result; }
public static XmlSchemaComplexType GetTypedDataSetSchema(XmlSchemaSet xs) { AlertCustomerExpressionDS alertCustomerExpressionDS = new AlertCustomerExpressionDS(); XmlSchemaComplexType xmlSchemaComplexType = new XmlSchemaComplexType(); XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence(); XmlSchemaAny xmlSchemaAny = new XmlSchemaAny(); xmlSchemaAny.Namespace = alertCustomerExpressionDS.Namespace; xmlSchemaSequence.Items.Add(xmlSchemaAny); xmlSchemaComplexType.Particle = xmlSchemaSequence; XmlSchema schemaSerializable = alertCustomerExpressionDS.GetSchemaSerializable(); XmlSchemaComplexType result; if (xs.Contains(schemaSerializable.TargetNamespace)) { MemoryStream memoryStream = new MemoryStream(); MemoryStream memoryStream2 = new MemoryStream(); try { schemaSerializable.Write(memoryStream); IEnumerator enumerator = xs.Schemas(schemaSerializable.TargetNamespace).GetEnumerator(); while (enumerator.MoveNext()) { XmlSchema xmlSchema = (XmlSchema)enumerator.Current; memoryStream2.SetLength(0L); xmlSchema.Write(memoryStream2); if (memoryStream.Length == memoryStream2.Length) { memoryStream.Position = 0L; memoryStream2.Position = 0L; while (memoryStream.Position != memoryStream.Length && memoryStream.ReadByte() == memoryStream2.ReadByte()) { } if (memoryStream.Position == memoryStream.Length) { result = xmlSchemaComplexType; return result; } } } } finally { if (memoryStream != null) { memoryStream.Close(); } if (memoryStream2 != null) { memoryStream2.Close(); } } } xs.Add(schemaSerializable); result = xmlSchemaComplexType; return result; }
public AlertCollectionRowChangeEvent(AlertCustomerExpressionDS.AlertCollectionRow row, DataRowAction action) { this.eventRow = row; this.eventAction = action; }
public void SaveXML() { try { string orderFilePath = AlertManager.Instance.GetOrderFilePath(); AlertCustomerExpressionDS alertCustomerExpressionDS = new AlertCustomerExpressionDS(); if (!Directory.Exists(ApplicationInfo.WORKING_ROOTPATH + "\\AlertOption\\" + ApplicationInfo.UserLoginID)) { Directory.CreateDirectory(ApplicationInfo.WORKING_ROOTPATH + "\\AlertOption\\" + ApplicationInfo.UserLoginID); } foreach (KeyValuePair<string, AlertItemCollection> current in AlertManager.Instance.Symbols) { foreach (AlertItem current2 in current.Value) { DataRow dataRow = alertCustomerExpressionDS.AlertCollection.NewRow(); dataRow["Symbol"] = current2.Symbol; dataRow["ColumnsAlert"] = current2.Field; dataRow["Operator"] = current2.Operator; dataRow["Values"] = current2.Value; dataRow["AlertTime"] = current2.AlertTime.ToString(); dataRow["AlertValue"] = current2.ValueMessageRealtime; alertCustomerExpressionDS.AlertCollection.Rows.Add(dataRow); } } if (alertCustomerExpressionDS.AlertCollection != null) { alertCustomerExpressionDS.WriteXml(orderFilePath); } alertCustomerExpressionDS = null; } catch (Exception ex) { throw ex; } }
public bool ReadData() { try { if (this.symbols == null) { this.symbols = new Dictionary<string, AlertItemCollection>(); } else { this.symbols.Clear(); } AlertCustomerExpressionDS alertCustomerExpressionDS = new AlertCustomerExpressionDS(); string orderFilePath = this.GetOrderFilePath(); if (File.Exists(orderFilePath)) { alertCustomerExpressionDS.ReadXml(orderFilePath); this.ImportFromXML(alertCustomerExpressionDS); } alertCustomerExpressionDS.Clear(); } catch (Exception ex) { throw ex; } return true; }