public System.Xml.XmlAttribute Remove(System.Xml.XmlAttribute node) { throw null; }
private static void UnknownAttribute(object sender, XmlAttributeEventArgs e) { System.Xml.XmlAttribute attr = e.Attr; Log.WarnFormat("Unknown attribute: {0}={1}", attr.Name, attr.Value); }
Stream(System.Xml.XmlAttribute att) { m_dataObjs.Add(new Snoop.Data.ClassSeparator(typeof(System.Xml.XmlAttribute))); m_dataObjs.Add(new Snoop.Data.Bool("Specified", att.Specified)); }
// The following method shows the sample description and formats its text (supports new lines and bold text) private void TextBlock_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { System.Xml.XmlNode node = e.NewValue as System.Xml.XmlNode; if (node == null) { return; } System.Xml.XmlAttribute attribute = node.Attributes["Description"]; if (attribute == null) { DescriptionTextBlock.Text = ""; return; } string description = attribute.Value; if (!string.IsNullOrEmpty(description)) { DescriptionTextBlock.BeginInit(); DescriptionTextBlock.Inlines.Clear(); bool isBold = false; string part = ""; int pos1 = 0; while (pos1 != -1 || pos1 > description.Length - 1) { int pos2 = description.IndexOf('\\', pos1); if (pos2 == -1) { part = description.Substring(pos1); break; } part = description.Substring(pos1, pos2 - pos1); char command = description[pos2 + 1]; var run = new Run(part); if (isBold) { run.FontWeight = FontWeights.Bold; } DescriptionTextBlock.Inlines.Add(run); if (command == 'n') // NewLine { DescriptionTextBlock.Inlines.Add(new System.Windows.Documents.LineBreak()); } else if (command == 'b') // Toggle bold { isBold = !isBold; } pos1 = pos2 + 2; } if (!string.IsNullOrEmpty(part)) { DescriptionTextBlock.Inlines.Add(part); } DescriptionTextBlock.EndInit(); } else { DescriptionTextBlock.Text = ""; } }
private static Common.DbConfigInfo ReadFile() { Common.DbConfigInfo temp = new Common.DbConfigInfo(); if (string.IsNullOrEmpty(filePath)) { var dir = AppDomain.CurrentDomain.BaseDirectory; System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(dir); System.IO.FileInfo[] files = directoryInfo.GetFiles(fileName, System.IO.SearchOption.AllDirectories); if (files == null || files.Length < 1) { //throw new Exception("缺少配置文件ZeroDbConfig.xml"); return(temp); } filePath = files[0].FullName; } System.IO.FileInfo fileInfo = new System.IO.FileInfo(filePath); if (!fileInfo.Exists) { //throw new Exception("配置文件ZeroDbConfig.xml不存在"); return(temp); } try { System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument(); xmlDocument.Load(filePath); System.Xml.XmlNodeList xmlNodeList = xmlDocument.SelectNodes(@"/zero/dbs/db");//GetElementsByTagName("db"); if (xmlNodeList == null || xmlNodeList.Count < 1) { throw new Exception("缺少db配置"); } temp.Dbs = new List <Common.DbConfigDatabaseInfo>(); foreach (System.Xml.XmlNode node in xmlNodeList) { System.Xml.XmlAttribute dbKey = node.Attributes["dbKey"]; System.Xml.XmlAttribute dbConnectionString = node.Attributes["dbConnectionString"]; System.Xml.XmlAttribute dbType = node.Attributes["dbType"]; if (dbKey == null || dbConnectionString == null || dbType == null) { continue; } string key = dbKey.Value; string conn = dbConnectionString.Value; string type = dbType.Value; if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(conn) || string.IsNullOrEmpty(type)) { continue; } type = type.Trim(); if (string.Equals(type, "SqlServer", StringComparison.OrdinalIgnoreCase)) { type = "SqlServer"; } else if (string.Equals(type, "MySql", StringComparison.OrdinalIgnoreCase)) { type = "MySql"; } else if (string.Equals(type, "Sqlite", StringComparison.OrdinalIgnoreCase)) { type = "Sqlite"; } else { continue; } key = key.Trim(); conn = conn.Trim(); if (temp.Dbs.Find(o => string.Equals(o.dbKey, key, StringComparison.OrdinalIgnoreCase)) != null) { continue; } temp.Dbs.Add(new Common.DbConfigDatabaseInfo { dbConnectionString = conn, dbKey = key, dbType = type }); } if (temp.Dbs.Count < 1) { return(null); } xmlNodeList = xmlDocument.SelectNodes(@"/zero/dvs/dv"); temp.Dvs = new List <Common.DbConfigDataviewInfo>(); if (xmlNodeList == null || xmlNodeList.Count < 1) { return(temp); } foreach (System.Xml.XmlNode node in xmlNodeList) { System.Xml.XmlAttribute dbKey = node.Attributes["dbKey"]; System.Xml.XmlAttribute tableName = node.Attributes["tableName"]; System.Xml.XmlAttribute entityKey = node.Attributes["entityKey"]; if (dbKey == null || tableName == null || entityKey == null) { continue; } string key = dbKey.Value; string name = tableName.Value; string entity = entityKey.Value; if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(name) || string.IsNullOrEmpty(entity)) { continue; } key = key.Trim(); name = name.Trim(); entity = entity.Trim(); if (temp.Dbs.Find(o => string.Equals(o.dbKey, key, StringComparison.OrdinalIgnoreCase)) == null) { continue; } if (temp.Dvs.Find(o => string.Equals(o.entityKey, entity, StringComparison.OrdinalIgnoreCase)) != null) { continue; } temp.Dvs.Add(new Common.DbConfigDataviewInfo { dbKey = key, tableName = name, entityKey = entity, isStandardMapping = true }); } } catch { temp = null; } return(temp); }
public virtual System.Xml.XmlAttribute RemoveAttributeNode(System.Xml.XmlAttribute oldAttr) { return(default(System.Xml.XmlAttribute)); }
// TODO: We can't add new Custom Attributes due to you need an XML document object reference void HandleAddAttributehandleClick(object sender, System.EventArgs e) { // Add a custom Name Space before to add a new one if (this.scl.xmlns == null) { CustomAttributeDialog.AddNameSpace(this.scl, this.nameSpaceList); } // If no custom name space then abort if (this.scl.xmlns != null) { System.Xml.XmlAttribute[] attrArray; if (this.element.AnyAttr == null) { attrArray = new System.Xml.XmlAttribute[1]; } else { attrArray = new System.Xml.XmlAttribute[this.element.AnyAttr.GetLength(0) + 1]; this.element.AnyAttr.CopyTo(attrArray, 0); } string[] ns = new string[this.scl.xmlns.ToArray().Length]; for (int i = 0; i < ns.Length; i++) { ns[i] = "xmlns:" + this.scl.xmlns.ToArray()[i].Name + "=" + this.scl.xmlns.ToArray()[i].Namespace; } EditDialog dlg = new EditDialog(this.scl, ns); dlg.L1 = "Name:"; dlg.L2 = "Value:"; dlg.Text = "Add Custom Attribute"; DialogResult res = dlg.ShowDialog(); if (res == DialogResult.OK) { if (this.xmldoc != null) { System.Console.WriteLine("NameSpace = " + this.scl.xmlns.ToArray()[dlg.NameSpaceIndex]); System.Console.WriteLine("Att name = " + dlg.T1); System.Console.WriteLine("Att value = " + dlg.T2); System.Xml.XmlAttribute a = this.xmldoc.CreateAttribute(dlg.T1, this.scl.xmlns.ToArray()[dlg.NameSpaceIndex] .ToString()); a.Value = dlg.T2; if (this.element.AnyAttr == null) { this.element.AnyAttr = new System.Xml.XmlAttribute [1]; this.element.AnyAttr[1] = a; } // else // this.element.AddXmlAttribute (a); FillAttr(); } } } }
protected void ParseWsdlArrayType(System.Xml.XmlAttribute attr) { }
protected void UnknownAttribute(object o, System.Xml.XmlAttribute attr) { }
public void RemoveAttribute(string xpath) { System.Xml.XmlAttribute oXmlAttribute = (System.Xml.XmlAttribute)XmlDocument.SelectSingleNode(xpath); System.Xml.XmlElement oXmlElement = (System.Xml.XmlElement)oXmlAttribute.OwnerElement; oXmlElement.Attributes.Remove(oXmlAttribute); }
public void RemoveAttribute(System.Xml.XmlAttribute oXmlAttribute) { System.Xml.XmlElement oXmlElement = (System.Xml.XmlElement)oXmlAttribute.OwnerElement; oXmlElement.Attributes.Remove(oXmlAttribute); }
public System.Xml.XmlAttribute CreateAttribute(string Name, string Value) { System.Xml.XmlAttribute oXmlAttribute = XmlDocument.CreateAttribute(Name); oXmlAttribute.Value = Value; return(oXmlAttribute); }
public virtual System.Xml.XmlAttribute SetAttributeNode(System.Xml.XmlAttribute newAttr) { throw null; }
public virtual System.Xml.XmlAttribute RemoveAttributeNode(System.Xml.XmlAttribute oldAttr) { throw null; }
public System.Xml.XmlAttribute Prepend(System.Xml.XmlAttribute node) { return(default(System.Xml.XmlAttribute)); }
protected void UnknownAttribute(object o, System.Xml.XmlAttribute attr, string qnames) { }
public System.Xml.XmlAttribute Remove(System.Xml.XmlAttribute node) { return(default(System.Xml.XmlAttribute)); }
private bool CheckAttribute(System.Xml.XmlAttribute attribut) { return(false); }
public virtual System.Xml.XmlAttribute SetAttributeNode(System.Xml.XmlAttribute newAttr) { return(default(System.Xml.XmlAttribute)); }
public bool IsXmlAttributOk(System.Xml.XmlAttribute xmlAttribut) { this.Reset(); return(this.CheckAttribute(xmlAttribut)); }
private static void serializer_UnknownAttribute(object sender, XmlAttributeEventArgs e) { //log unknown attribute System.Xml.XmlAttribute attr = e.Attr; String unknownAttribute = "Unknown attribute " + attr.Name + "='" + attr.Value + "'"; }
} // End Sub TransformPath public static void TransformPath(string file) { System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); if (System.Environment.OSVersion.Platform != System.PlatformID.Unix) { doc.XmlResolver = null; // .NET Framework } doc.Load(file); System.Xml.XmlNamespaceManager nspmgr = new System.Xml.XmlNamespaceManager(doc.NameTable); nspmgr.AddNamespace(doc.DocumentElement.Name, doc.DocumentElement.NamespaceURI); bool bOnlyRoomLayer = true; if (bOnlyRoomLayer) { System.Xml.XmlNodeList pathLayers = doc.SelectNodes("//svg:g[@id!='FM_OBJEKT_RAUM']", nspmgr); foreach (System.Xml.XmlNode layer in pathLayers) { layer.ParentNode.RemoveChild(layer); } // Next layer } // End if (bOnlyRoomLayer) System.Xml.XmlElement xe = doc.CreateElement("style", doc.DocumentElement.NamespaceURI); xe.SetAttribute("type", "text/css"); xe.InnerText = @" path:hover { fill: orange; stroke-width: 10; stroke: gold; transition: all .2s ease-in-out; transform: scale(1.0); } path { transform: scale(1.0); } "; if (doc.DocumentElement.FirstChild == null) { doc.DocumentElement.AppendChild(xe); } else { doc.DocumentElement.InsertBefore(xe, doc.DocumentElement.FirstChild); } // System.Xml.XmlNode nd = doc.SelectSingleNode("//svg:g[@id='FM_OBJEKT_RAUM']", nspmgr); // System.Xml.XmlNodeList paths = nd.SelectNodes ("./svg:path", nspmgr); System.Xml.XmlNodeList paths = doc.SelectNodes("//svg:g[@id='FM_OBJEKT_RAUM']/svg:path", nspmgr); // System.Xml.XmlNodeList paths = doc.SelectNodes("//svg:g[@id='FM_OBJEKT_RAUM']/svg:path[@data-handle='4']", nspmgr); System.Console.WriteLine(paths); int r = 20; foreach (System.Xml.XmlNode path in paths) { // string col = string.Format("#0000{0:X2}", r); // path.Attributes["fill"].Value = "#FF0000"; path.Attributes["fill"].Value = string.Format("#00{0:X2}00", r); r += 37; r = r % 255; System.Xml.XmlAttribute da = path.Attributes["d"]; if (da == null) { continue; } string d = da.Value.Trim(); if (d.StartsWith("M")) { d = d.Substring(1); } if (d.EndsWith("z")) { d = d.Substring(0, d.Length - 1); } string[] coords = d.Split('L'); System.Collections.Generic.List <System.Drawing.Point> points = new System.Collections.Generic.List <System.Drawing.Point>(); foreach (string coord in coords) { string[] xyc = coord.Split(' '); float fX = 0; float fY = 0; float.TryParse(xyc[0], out fX); float.TryParse(xyc[1], out fY); // points.Add(new double[] { dblX, dblY }); points.Add(new System.Drawing.Point((int)fX, (int)fY)); System.Console.WriteLine("Pxy: [{0},{1}]", fX, fY); } // Next coord int j = points.Count - 1; for (int i = 0; i < points.Count; ++i) { if (j <= i) { break; } if (PointsEqual(points[i], points[j])) { points.RemoveAt(j); } else { System.Console.WriteLine(points[i] == points[j]); break; } j--; } // Next i string str = ""; for (int i = 0; i < points.Count; ++i) { if (i == 0 && points.Count == 1) { str += string.Format("M{0} {1} z", points[i].X, points[i].Y); } else if (i == 0) { str += string.Format("M{0} {1}", points[i].X, points[i].Y); } else if (i == points.Count - 1) { str += string.Format("L{0} {1} z", points[i].X, points[i].Y); } else { str += string.Format("L{0} {1}", points[i].X, points[i].Y); } } // Next i // System.Console.WriteLine(str); path.Attributes["d"].Value = str; } // Next path string newFileName = null; if (System.Environment.OSVersion.Platform == System.PlatformID.Unix) { newFileName = @"/root/" + "Rooms_" + System.IO.Path.GetFileNameWithoutExtension(file) + @".svg"; } else { newFileName = @"D:\" + "Rooms_" + System.IO.Path.GetFileNameWithoutExtension(file) + @".svg"; } doc.Save(newFileName); System.Console.WriteLine(System.Environment.NewLine); System.Console.WriteLine(" --- Press any key to continue --- "); System.Console.ReadKey(); } // End Sub TransformPath
/// <summary> /// Therefore this method, called once we have a cache and object, is our first chance to /// actually create the embedded control. /// </summary> public override void FinishInit() { CheckDisposed(); IWritingSystemContainer wsContainer = Cache.ServiceLocator.WritingSystems; bool fVernRTL = wsContainer.DefaultVernacularWritingSystem.RightToLeftScript; bool fAnalRTL = wsContainer.DefaultAnalysisWritingSystem.RightToLeftScript; System.Xml.XmlAttribute xa = ConfigurationNode.Attributes["layout"]; // To properly fix LT-6239, we need to consider all four mixtures of directionality // involving the vernacular (table) and analysis (slot name) writing systems. // These four possibilities are marked RTL, LTRinRTL, RTLinLTR, and <nothing>. if (fVernRTL && fAnalRTL) { if (xa.Value.EndsWith("RTLinLTR") || xa.Value.EndsWith("LTRinRTL")) { xa.Value = xa.Value.Substring(0, xa.Value.Length - 8); } if (!xa.Value.EndsWith("RTL")) { xa.Value += "RTL"; // both vern and anal are RTL } } else if (fVernRTL && !fAnalRTL) { if (xa.Value.EndsWith("RTLinLTR")) { xa.Value = xa.Value.Substring(0, xa.Value.Length - 8); } else if (xa.Value.EndsWith("RTL") && !xa.Value.EndsWith("LTRinRTL")) { xa.Value = xa.Value.Substring(0, xa.Value.Length - 3); } if (!xa.Value.EndsWith("LTRinRTL")) { xa.Value += "LTRinRTL"; // LTR anal name in RTL vern table } } else if (!fVernRTL && fAnalRTL) { if (xa.Value.EndsWith("LTRinRTL")) { xa.Value = xa.Value.Substring(0, xa.Value.Length - 8); } else if (xa.Value.EndsWith("RTL")) { xa.Value = xa.Value.Substring(0, xa.Value.Length - 3); } if (!xa.Value.EndsWith("RTLinLTR")) { xa.Value += "RTLinLTR"; // RTL anal name in LTR vern table } } else { if (xa.Value.EndsWith("RTLinLTR") || xa.Value.EndsWith("LTRinRTL")) { xa.Value = xa.Value.Substring(0, xa.Value.Length - 8); } else if (xa.Value.EndsWith("RTL")) { xa.Value = xa.Value.Substring(0, xa.Value.Length - 3); } // both vern and anal are LTR (unmarked case) } var ctrl = new InflAffixTemplateControl((FdoCache)Mediator.PropertyTable.GetValue("cache"), Object.Hvo, ConfigurationNode, StringTbl); Control = ctrl; m_menuHandler = InflAffixTemplateMenuHandler.Create(ctrl, ConfigurationNode); #if !Want m_menuHandler.Init(Mediator, null); #else m_menuHandler.Init(null, null); #endif ctrl.SetContextMenuHandler(m_menuHandler.ShowSliceContextMenu); ctrl.Mediator = Mediator; ctrl.SetStringTableValues(Mediator.StringTbl); if (ctrl.RootBox == null) { ctrl.MakeRoot(); } }
private void Serializer_UnknownAttribute(object sender, XmlAttributeEventArgs e) { System.Xml.XmlAttribute a = e.Attr; Log("Unknown attribute found during deserialization:\nName\t" + a.Name + "\nValue\t" + a.Value); }
protected void AddAttribute(System.Xml.XmlElement tag, String name, String val) { System.Xml.XmlAttribute attr = tag.OwnerDocument.CreateAttribute(name); attr.Value = val; tag.Attributes.Append(attr); }
/// <summary> /// catches unknown attribute nodes /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void serializer_UnknownAttribute (object sender, XmlAttributeEventArgs e) { System.Xml.XmlAttribute attr = e.Attr; Log.dbg("Unknown attribute " + attr.Name + "='" + attr.Value + "'"); }
private void serializer_UnknownAttribute(object sender, XmlAttributeEventArgs e) { System.Xml.XmlAttribute attr = e.Attr; Console.WriteLine("Unknown attribute " + attr.Name + "='" + attr.Value + "'"); }
public System.Xml.XmlAttribute InsertBefore(System.Xml.XmlAttribute newNode, System.Xml.XmlAttribute refNode) { return(default(System.Xml.XmlAttribute)); }
protected override void ProcessCommand(NetworkStream nstm, char tag) { //string s; int len; switch (tag) { case 'e': // Batch 'get next' enumeration. { try { int ienumid = nstm.ReadByte(); if (ienumid >= 0) { byte enumid = (byte)ienumid; if (enumid >= this.enums.Length) { nstm.WriteByte((byte)'-'); } else { if (null == this.enums[enumid]) { this.enums[enumid] = new IntComboListPartEnumerator(this); } int offset = 0; if (null == buf || buf.Length < 40) { throw new Exception("Enumeration batch buffer too small!"); } //if (uniquecompression) // Compressed... { for (; ;) { if (!this.enums[enumid].MoveNext()) { break; } B8 b8 = this.enums[enumid].Current; int nrow = 1; while (this.enums[enumid].MoveNext()) { B8 b8next = this.enums[enumid].Current; if (b8.A != b8next.A || b8.B != b8next.B) //if (b8 != b8next) { this.enums[enumid].MoveBack(); // ! break; } nrow++; } if (nrow < mindupes) { continue; } if (nrow > Int16.MaxValue) { nrow = Int16.MaxValue; } // Using Big Endian! MySpace.DataMining.DistributedObjects.Entry.Int16ToBytes((Int16)nrow, buf, offset); b8.CopyToArray(buf, offset + 2); offset += 8 + 2; if (offset + 8 + 2 > buf.Length) { break; } } } if (offset > 0) { nstm.WriteByte((byte)'+'); XContent.SendXContent(nstm, buf, offset); } else { nstm.WriteByte((byte)'-'); } } } } catch { nstm.WriteByte((byte)'-'); throw; } } break; case 'n': // Reset next in enumeration.. { int ienumid = nstm.ReadByte(); if (ienumid >= 0) { byte enumid = (byte)ienumid; if (XLog.logging) { XLog.log("Starting enumeration (enumid:" + enumid.ToString() + ")"); } if (enumid < this.enums.Length && null != this.enums[enumid]) { //this.enums[enumid].Reset(); this.enums[enumid] = null; } } } break; case 's': { try { #if ENABLE_TIMING long start = 0; if (XLog.logging) { QueryPerformanceCounter(out start); } #endif int readbuflen = 1048576; if (null != DistributedObjectsSlave.xslave) { System.Xml.XmlNode xzblocks = DistributedObjectsSlave.xslave["zblocks"]; if (null != xzblocks) { { System.Xml.XmlAttribute xzbs = xzblocks.Attributes["readbuffersize"]; if (null != xzbs) { readbuflen = DistributedObjectsSlave.ParseCapacity(xzbs.Value); } } } } foreach (ZBlock zb in zblocks) { zb.LeaveAddMode(readbuflen); } foreach (ZBlock zb in zblocks) { zb.Sort(b8buffer, this.buf); } #if ENABLE_TIMING if (XLog.logging) { long stop; QueryPerformanceCounter(out stop); long freq; if (QueryPerformanceFrequency(out freq)) { long secs = (stop - start) / freq; if (secs > 10) { XLog.log("IntComboListPart sort seconds: " + secs.ToString()); } } } #endif } finally { nstm.WriteByte((byte)'+'); } } break; case 'p': // Batch push/publish... { buf = XContent.ReceiveXBytes(nstm, out len, buf); uint gbfree = (uint)(GetCurrentDiskFreeBytes() / 1073741824); #if DEBUG { string computer_name = System.Environment.GetEnvironmentVariable("COMPUTERNAME"); if (computer_name == "MAPDDRULE" || computer_name == "MAPDCMILLER" || computer_name == "MAPDCLOK") { gbfree = uint.MaxValue; } } #endif if (gbfree > 20) { int pcount = len / 8; // size of B8 int y = 0; for (int i = 0; i != pcount; i++) { TimedAdd(buf, y); y += 8; } } else { if (!nofreedisklog) { nofreedisklog = true; XLog.errorlog("Low free disk space; now dropping entries."); } } } break; case 'M': { buf = XContent.ReceiveXBytes(nstm, out len, buf); if (4 == len) { this.mindupes = DistObjectBase.BytesToInt(buf); } } break; default: base.ProcessCommand(nstm, tag); break; } }
public System.Xml.XmlAttribute Prepend(System.Xml.XmlAttribute node) { throw null; }