Exemplo n.º 1
0
 public EclipsePlayer(System.Xml.XmlNode playerNode)
 {
     this.playerNode = playerNode;
     color = playerNode.Attributes["color"].InnerText;
     win = int.Parse(playerNode.Attributes["win"].InnerText) > 0;
     score = playerNode.Attributes["score"].InnerText;
     race = EclipseRaceParser.categorizeByRace(color);
 }
Exemplo n.º 2
0
		/// <summary>
		/// コンストラクタ
		/// </summary>
		/// <param name="threadXML"></param>
		public ThreadHeader(string threadXML)
		{
			System.Diagnostics.Debug.Assert(threadXML != null, "new ThreadHeader threadXML is Null!");

			_xnode = new System.Xml.XmlDocument();
			((System.Xml.XmlDocument)_xnode).LoadXml(threadXML);

		}
Exemplo n.º 3
0
Arquivo: Xml.cs Projeto: sopindm/bjeb
            public Xml(string rootName)
            {
                _xml = new System.Xml.XmlDocument();

                System.Xml.XmlDeclaration dec = _xml.CreateXmlDeclaration("1.0", null, null);
                _xml.AppendChild(dec);

                _root = _xml.CreateElement(rootName);
                _xml.AppendChild(_root);
            }
Exemplo n.º 4
0
        public Template(System.IO.Stream stream, string pName)
        {
            m_Document.Load(stream);
            m_editortemplate_Node = m_Document.SelectSingleNode("//editortemplate");
            if (m_editortemplate_Node == null)
            {
                throw new Exception("Invalid template file");
            }

            m_Name = pName;
        }
 /// <remarks/>
 public void nfeRecepcaoEventoAsync(System.Xml.XmlNode nfeDadosMsg)
 {
     this.nfeRecepcaoEventoAsync(nfeDadosMsg, null);
 }
Exemplo n.º 6
0
 /// <remarks/>
 public void nfeConsultaNF2Async(System.Xml.XmlNode nfeDadosMsg)
 {
     this.nfeConsultaNF2Async(nfeDadosMsg, null);
 }
Exemplo n.º 7
0
        public void LoadFromXML(System.Xml.XmlNode node)
        {
            System.Diagnostics.Debug.Assert(node.Name.Equals(this.Typename));

            XMLResourceTypeFactory.LoadFromXML(node, this);
        }
Exemplo n.º 8
0
		public Node(System.Xml.XmlNode xmlNode)
		{
			this.xmlNode = xmlNode;
			this.ResetChildern();
			this.Reset();
		}
Exemplo n.º 9
0
        internal VerificationFile(IEnumerable<ManifestEntry> parentChain, FilenameStrategy str)
        {
            m_doc = new System.Xml.XmlDocument();
            System.Xml.XmlNode root = m_doc.AppendChild(m_doc.CreateElement("Verify"));
            root.Attributes.Append(m_doc.CreateAttribute("hash-algorithm")).Value = Utility.Utility.HashAlgorithm;
            root.Attributes.Append(m_doc.CreateAttribute("version")).Value = "1";

            m_node = root.AppendChild(m_doc.CreateElement("Files"));

            foreach (ManifestEntry mfe in parentChain)
            {
                System.Xml.XmlNode f = m_node.AppendChild(m_doc.CreateElement("File"));
                f.Attributes.Append(m_doc.CreateAttribute("type")).Value = "manifest";
                f.Attributes.Append(m_doc.CreateAttribute("name")).Value = mfe.Filename;
                f.Attributes.Append(m_doc.CreateAttribute("size")).Value = mfe.Filesize.ToString();
                f.InnerText = Utility.Utility.ByteArrayAsHexString(Convert.FromBase64String(mfe.RemoteHash));

                for (int i = 0; i < mfe.ParsedManifest.SignatureHashes.Count; i++)
                {
                    string sigfilename = mfe.ParsedManifest.SignatureHashes[i].Name;
                    string contentfilename = mfe.ParsedManifest.ContentHashes[i].Name;
                    bool missing = i >= mfe.Volumes.Count;

                    if (string.IsNullOrEmpty(sigfilename) || string.IsNullOrEmpty(contentfilename))
                    {
                        if (missing)
                        {
                            sigfilename = str.GenerateFilename(new SignatureEntry(mfe.Time, mfe.IsFull, i + 1));
                            contentfilename = str.GenerateFilename(new ContentEntry(mfe.Time, mfe.IsFull, i + 1));

                            //Since these files are missing, we have to guess what their real names were
                            string compressionGuess;
                            if (mfe.Volumes.Count <= 0)
                                compressionGuess = ".zip"; //Default if we have no knowledge
                            else
                                compressionGuess = "." + mfe.Volumes[0].Key.Compression; //Most likely the same as all the others

                            //Encryption will likely be the same as the one the manifest uses
                            string encryptionGuess = string.IsNullOrEmpty(mfe.EncryptionMode) ? "" : "." + mfe.EncryptionMode;

                            sigfilename += compressionGuess + encryptionGuess;
                            contentfilename += compressionGuess + encryptionGuess;
                        }
                        else
                        {
                            sigfilename = mfe.Volumes[i].Key.Filename;
                            contentfilename = mfe.Volumes[i].Value.Filename;
                        }
                    }

                    f = m_node.AppendChild(m_doc.CreateElement("File"));
                    f.Attributes.Append(m_doc.CreateAttribute("type")).Value = "signature";
                    f.Attributes.Append(m_doc.CreateAttribute("name")).Value = sigfilename;
                    f.Attributes.Append(m_doc.CreateAttribute("size")).Value = mfe.ParsedManifest.SignatureHashes[i].Size.ToString();
                    if (missing) f.Attributes.Append(m_doc.CreateAttribute("missing")).Value = "true";
                    f.InnerText = Utility.Utility.ByteArrayAsHexString(Convert.FromBase64String(mfe.ParsedManifest.SignatureHashes[i].Hash));

                    f = m_node.AppendChild(m_doc.CreateElement("File"));
                    f.Attributes.Append(m_doc.CreateAttribute("type")).Value = "content";
                    f.Attributes.Append(m_doc.CreateAttribute("name")).Value = contentfilename;
                    f.Attributes.Append(m_doc.CreateAttribute("size")).Value = mfe.ParsedManifest.ContentHashes[i].Size.ToString();
                    if (missing) f.Attributes.Append(m_doc.CreateAttribute("missing")).Value = "true";
                    f.InnerText = Utility.Utility.ByteArrayAsHexString(Convert.FromBase64String(mfe.ParsedManifest.ContentHashes[i].Hash));
                }
            }
        }
Exemplo n.º 10
0
Arquivo: Xml.cs Projeto: sopindm/bjeb
 public XmlNode(System.Xml.XmlNode node)
 {
     _node = node;
 }
Exemplo n.º 11
0
 public static XElement GetDocString(XElement docMembers, MemberInfo info)
 {
     if (docMembers == null) return null;
     string memberId = GetMemberId(info).ToLower();
     foreach (XElement e in docMembers.ChildNodes)
     {
         var anme = e.Attributes["name"];
         if (anme != null)
         {
             string matchWith = anme.Value.ToLower();
             if (matchWith.StartsWith(memberId))
             {
                 return e;
             }
         }
     }
     return null;
 }
Exemplo n.º 12
0
 /// <summary>
 /// 获取当前任务周期的配置信息,将序列化的内容填充至 XmlNode 的 InnerText 属性或者 ChildNodes 子节点中。
 /// </summary>
 /// <param name="xmlDoc">创建 XmlNode 时所需使用到的 System.Xml.XmlDocument。</param>
 /// <returns></returns>
 public override System.Xml.XmlNode GetTaskPeriodConfig(System.Xml.XmlDocument xmlDoc)
 {
     System.Xml.XmlNode xnConfig = xmlDoc.CreateElement(this.GetType().Name);
     xnConfig.InnerText = this.TimeNum.ToString();
     return(xnConfig);
 }
Exemplo n.º 13
0
 /// <summary>
 /// 从保存此任务周期数据的 XML 文档节点初始化当前任务。
 /// </summary>
 /// <param name="taskConfig">该对象节点的数据</param>
 public override void SetTaskPeriodConfig(System.Xml.XmlNode taskConfig)
 {
     this.TimeNum = Function.ToInt(taskConfig.InnerText);
 }
 /// <remarks/>
 public System.IAsyncResult BeginnfeRetAutorizacaoLote(System.Xml.XmlNode nfeDadosMsg, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("nfeRetAutorizacaoLote", new object[] {
         nfeDadosMsg
     }, callback, asyncState));
 }
Exemplo n.º 15
0
 /// <remarks/>
 public void nfeStatusServicoNF2Async(System.Xml.XmlNode nfeDadosMsg)
 {
     this.nfeStatusServicoNF2Async(nfeDadosMsg, null);
 }
Exemplo n.º 16
0
 /// <remarks/>
 public void cteInutilizacaoCTAsync(System.Xml.XmlNode cteDadosMsg)
 {
     this.cteInutilizacaoCTAsync(cteDadosMsg, null);
 }
Exemplo n.º 17
0
        private IEnumerable <IFileEntry> ListWithouExceptionCatch()
        {
            var req = CreateRequest("");

            req.Method = "PROPFIND";
            req.Headers.Add("Depth", "1");
            req.ContentType   = "text/xml";
            req.ContentLength = PROPFIND_BODY.Length;

            var areq = new Utility.AsyncHttpRequest(req);

            using (System.IO.Stream s = areq.GetRequestStream())
                s.Write(PROPFIND_BODY, 0, PROPFIND_BODY.Length);

            var doc = new System.Xml.XmlDocument();

            using (var resp = (System.Net.HttpWebResponse)areq.GetResponse())
            {
                int code = (int)resp.StatusCode;
                if (code < 200 || code >= 300) //For some reason Mono does not throw this automatically
                {
                    throw new System.Net.WebException(resp.StatusDescription, null, System.Net.WebExceptionStatus.ProtocolError, resp);
                }

                if (!string.IsNullOrEmpty(m_debugPropfindFile))
                {
                    using (var rs = areq.GetResponseStream())
                        using (var fs = new System.IO.FileStream(m_debugPropfindFile, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None))
                            Utility.Utility.CopyStream(rs, fs, false, m_copybuffer);

                    doc.Load(m_debugPropfindFile);
                }
                else
                {
                    using (var rs = areq.GetResponseStream())
                        doc.Load(rs);
                }
            }

            System.Xml.XmlNamespaceManager nm = new System.Xml.XmlNamespaceManager(doc.NameTable);
            nm.AddNamespace("D", "DAV:");

            List <IFileEntry> files = new List <IFileEntry>();

            m_filenamelist = new List <string>();

            foreach (System.Xml.XmlNode n in doc.SelectNodes("D:multistatus/D:response/D:href", nm))
            {
                //IIS uses %20 for spaces and %2B for +
                //Apache uses %20 for spaces and + for +
                string name = Library.Utility.Uri.UrlDecode(n.InnerText.Replace("+", "%2B"));

                string cmp_path;

                //TODO: This list is getting ridiculous, should change to regexps

                if (name.StartsWith(m_url, StringComparison.Ordinal))
                {
                    cmp_path = m_url;
                }
                else if (name.StartsWith(m_rawurl, StringComparison.Ordinal))
                {
                    cmp_path = m_rawurl;
                }
                else if (name.StartsWith(m_rawurlPort, StringComparison.Ordinal))
                {
                    cmp_path = m_rawurlPort;
                }
                else if (name.StartsWith(m_path, StringComparison.Ordinal))
                {
                    cmp_path = m_path;
                }
                else if (name.StartsWith("/" + m_path, StringComparison.Ordinal))
                {
                    cmp_path = "/" + m_path;
                }
                else if (name.StartsWith(m_sanitizedUrl, StringComparison.Ordinal))
                {
                    cmp_path = m_sanitizedUrl;
                }
                else if (name.StartsWith(m_reverseProtocolUrl, StringComparison.Ordinal))
                {
                    cmp_path = m_reverseProtocolUrl;
                }
                else
                {
                    continue;
                }

                if (name.Length <= cmp_path.Length)
                {
                    continue;
                }

                name = name.Substring(cmp_path.Length);

                long     size         = -1;
                DateTime lastAccess   = new DateTime();
                DateTime lastModified = new DateTime();
                bool     isCollection = false;

                System.Xml.XmlNode stat = n.ParentNode.SelectSingleNode("D:propstat/D:prop", nm);
                if (stat != null)
                {
                    System.Xml.XmlNode s = stat.SelectSingleNode("D:getcontentlength", nm);
                    if (s != null)
                    {
                        size = long.Parse(s.InnerText);
                    }
                    s = stat.SelectSingleNode("D:getlastmodified", nm);
                    if (s != null)
                    {
                        try
                        {
                            //Not important if this succeeds
                            lastAccess = lastModified = DateTime.Parse(s.InnerText, System.Globalization.CultureInfo.InvariantCulture);
                        }
                        catch { }
                    }

                    s = stat.SelectSingleNode("D:iscollection", nm);
                    if (s != null)
                    {
                        isCollection = s.InnerText.Trim() == "1";
                    }
                    else
                    {
                        isCollection = (stat.SelectSingleNode("D:resourcetype/D:collection", nm) != null);
                    }
                }

                FileEntry fe = new FileEntry(name, size, lastAccess, lastModified);
                fe.IsFolder = isCollection;
                files.Add(fe);
                m_filenamelist.Add(name);
            }

            return(files);
        }
Exemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseConfig"/> class.
 /// </summary>
 /// <param name="node">The node.</param>
 public BaseConfig(System.Xml.XmlNode node)
 {
     this.m_section = node;
 }
Exemplo n.º 19
0
		/// <summary>
		/// コンストラクタ
		/// </summary>
		/// <param name="node"></param>
		public ThreadHeader(System.Xml.XmlNode node)
		{
			_xnode = node;
		}
Exemplo n.º 20
0
 public void Parse(ICompilateur comp, System.Xml.XmlNode node)
 {
 }
Exemplo n.º 21
0
Arquivo: Xml.cs Projeto: sopindm/bjeb
 public XmlAttribute(System.Xml.XmlNode node, string name)
 {
     _node = node;
     _name = name;
 }
Exemplo n.º 22
0
 public void Inject(ICompiler obj, ICompilateur comp, System.Xml.XmlNode node, string modifier)
 {
 }
Exemplo n.º 23
0
 public MyXmlEncoder()
 {
     m_doc = new System.Xml.XmlDocument();
     m_node = m_doc.CreateElement("root");
 }
Exemplo n.º 24
0
 /// <remarks/>
 public void cteCancelamentoCTAsync(System.Xml.XmlNode cteDadosMsg)
 {
     this.cteCancelamentoCTAsync(cteDadosMsg, null);
 }
Exemplo n.º 25
0
 public void Load(ICompilateur comp, System.Xml.XmlNode node)
 {
 }
Exemplo n.º 26
0
 /// <remarks/>
 public void nfeRetAutorizacaoLoteAsync(System.Xml.XmlNode nfeDadosMsg)
 {
     this.nfeRetAutorizacaoLoteAsync(nfeDadosMsg, null);
 }
Exemplo n.º 27
0
 /// <remarks/>
 public void cteConsultaCTAsync(System.Xml.XmlNode cteDadosMsg)
 {
     this.cteConsultaCTAsync(cteDadosMsg, null);
 }
Exemplo n.º 28
0
        private void guardarXML(Stream myStream)
        {
            System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
            //System.Xml.XmlAttribute atributo;

            System.Xml.XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", "UTF-8", "");
            doc.AppendChild(declaration);

            System.Xml.XmlNode pmml = doc.CreateElement("PMML");

            /*
             * atributo = doc.CreateAttribute("version");
             * atributo.InnerText = "3.0";
             * pmml.Attributes.Append(atributo);
             * atributo = doc.CreateAttribute("xmlns");
             * atributo.InnerText = "http://www.dmg.org/PMML-3-0";
             * pmml.Attributes.Append(atributo);
             * atributo = doc.CreateAttribute("xmlns:xsi");
             * atributo.InnerText = "http://www.w3.org/2001/XMLSchema_instance";
             * pmml.Attributes.Append(atributo);
             */

            pmml.Attributes.Append(setAtributo(doc, "version", "3.0"));
            pmml.Attributes.Append(setAtributo(doc, "xmlns", "http://www.dmg.org/PMML-3-0"));
            pmml.Attributes.Append(setAtributo(doc, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema_instance"));
            doc.AppendChild(pmml);

            System.Xml.XmlNode sprite = doc.CreateElement("TEXTURA");
            if (textureName.Text.Equals(""))
            {
                sprite.Attributes.Append(setAtributo(doc, "Name", "none"));
            }
            else
            {
                sprite.Attributes.Append(setAtributo(doc, "Name", textureName.Text));
            }

            if (useRelativePath.Checked && !relativeFileLoc.Equals(""))
            {
                sprite.Attributes.Append(setAtributo(doc, "TextureFile", relativeFileLoc.Insert(0, "..\\").Replace('\\', '/')));
            }
            else
            {
                sprite.Attributes.Append(setAtributo(doc, "TextureFile", fileLoc));
            }

            int colorR = color_click.BackColor.R;
            int colorG = color_click.BackColor.G;
            int colorB = color_click.BackColor.B;

            //sprite.Attributes.Append(setAtributo(doc, "ColorKey", "FF"+R+G+B));
            System.Xml.XmlNode colorKey = doc.CreateElement("ColorKey");
            colorKey.Attributes.Append(setAtributo(doc, "R", colorR.ToString()));
            colorKey.Attributes.Append(setAtributo(doc, "G", colorG.ToString()));
            colorKey.Attributes.Append(setAtributo(doc, "B", colorB.ToString()));
            sprite.AppendChild(colorKey);
            pmml.AppendChild(sprite);

            /*
             * doc.AppendChild(XClub);
             * System.Xml.XmlNode Pelicula = doc.CreateElement("Pelicula");
             * XClub.AppendChild(Pelicula);
             * System.Xml.XmlNode Data = doc.CreateElement("Data");
             * System.Xml.XmlAttribute atributo = doc.CreateAttribute("Titulo");
             * atributo.InnerText = "Garganta Profunda(Deep Throat)";
             * Data.Attributes.Append(atributo);
             * System.Xml.XmlAttribute atributo2 = doc.CreateAttribute("Director");
             * atributo2.InnerText = "";
             * Data.Attributes.Append(atributo2);
             * Pelicula.AppendChild(Data);*/
            doc.Save(myStream);
        }
Exemplo n.º 29
0
        protected override void ProcessNode(ref List <Dictionary <string, string> > dic, System.Xml.XmlNode node)
        {
            string subject = GetNodeAttribute(node, "subject");

            if (subject == null || subject.Trim().Length <= 0)
            {
                throw new ConfigurationErrorsException("Not config 'subject' for queue mail sender.");
            }
            MappingEvent(subject);
        }
 public System.Threading.Tasks.Task <FogGerenciadorDeVendas.Dominio.AutorizacaoHomolog.nfeAutorizacaoLoteResponse> nfeAutorizacaoLoteAsync(System.Xml.XmlNode nfeDadosMsg)
 {
     FogGerenciadorDeVendas.Dominio.AutorizacaoHomolog.nfeAutorizacaoLoteRequest inValue = new FogGerenciadorDeVendas.Dominio.AutorizacaoHomolog.nfeAutorizacaoLoteRequest();
     inValue.nfeDadosMsg = nfeDadosMsg;
     return(((FogGerenciadorDeVendas.Dominio.AutorizacaoHomolog.NFeAutorizacao4Soap12)(this)).nfeAutorizacaoLoteAsync(inValue));
 }
Exemplo n.º 31
0
 public void LoadFromXML(System.Xml.XmlNode node)
 {
     this.Text = node.Attributes["value"].Value;
 }
 public nfeAutorizacaoLoteRequest(System.Xml.XmlNode nfeDadosMsg)
 {
     this.nfeDadosMsg = nfeDadosMsg;
 }
 /// <remarks/>
 public System.IAsyncResult BeginnfeRecepcaoEvento(System.Xml.XmlNode nfeDadosMsg, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("nfeRecepcaoEvento", new object[] {
         nfeDadosMsg
     }, callback, asyncState));
 }
 public nfeAutorizacaoLoteResponse(System.Xml.XmlNode nfeResultMsg)
 {
     this.nfeResultMsg = nfeResultMsg;
 }
Exemplo n.º 35
0
        private static TestFilter FromXml(XmlNode xmlNode)
        {
            switch (xmlNode.Name)
            {
                case "filter":
                case "and":
                    var andFilter = new AndFilter();
                    foreach (XmlNode childNode in xmlNode.ChildNodes)
                        andFilter.Add(FromXml(childNode));
                    return andFilter;

                case "or":
                    var orFilter = new OrFilter();
                    foreach (System.Xml.XmlNode childNode in xmlNode.ChildNodes)
                        orFilter.Add(FromXml(childNode));
                    return orFilter;

                case "not":
                    return new NotFilter(FromXml(xmlNode.FirstChild));

                case "id":
                    var idFilter = new IdFilter();
                    foreach (string id in xmlNode.InnerText.Split(COMMA))
                        idFilter.Add(int.Parse(id));
                    return idFilter;

                case "tests":
                    var testFilter = new SimpleNameFilter();
                    foreach (XmlNode childNode in xmlNode.SelectNodes("test"))
                        testFilter.Add(childNode.InnerText);
                    return testFilter;

                case "cat":
                    var catFilter = new CategoryFilter();
                    foreach (string cat in xmlNode.InnerText.Split(COMMA))
                        catFilter.AddCategory(cat);
                    return catFilter;

                default:
                    throw new ArgumentException("Invalid filter element: " + xmlNode.Name, "xmlNode");
            }
        }
Exemplo n.º 36
0
 /// <remarks/>
 public System.IAsyncResult BeginProcessXmlDocument(System.Xml.XmlNode xmlRequest, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("ProcessXmlDocument", new object[] {
         xmlRequest
     }, callback, asyncState));
 }
Exemplo n.º 37
0
 public Config(System.Xml.XmlNode node)
 {
     m_section = node;
 }
Exemplo n.º 38
0
 public void AddData(UploadID _Uploader, System.Xml.XmlNode _PlayerNode, VF.SQLPlayerID?_PlayerID = null, Func <int, VF.SQLUploadID> _GetSQLUploadIDFunc = null)
 {
     AddData(_Uploader, XMLUtility.GetChildValue(_PlayerNode, "ExtraData", ""), _PlayerID, _GetSQLUploadIDFunc);
 }
        public void setFromXml(System.Xml.XmlNode InstNode)
        {
            this.node_ = InstNode;
            //InstNode["book"]["bookInfo"];

            System.Xml.XmlNode bookInfoNode
                = InstNode["favoriteInfo"];

            this.favoriteName_ = bookInfoNode["favoriteName"].InnerText;
            this.favoriteCode_ = bookInfoNode["favoriteCode"].InnerText;

                System.Xml.XmlNodeList instrumentListNodeList
                    = InstNode["instrumentList"].SelectNodes("instrument");

            foreach (System.Xml.XmlNode item in instrumentListNodeList)
            {
                string instCode = item.InnerText;

                Excel_instrumentViewModel instrument = new Excel_instrumentViewModel();
                instrument.Item_code_ = instCode;

                this.instrumentList_.Add(instrument);

            }
            
            
        }
Exemplo n.º 40
0
 /// <remarks/>
 public void cteStatusServicoCTAsync(System.Xml.XmlNode cteDadosMsg)
 {
     this.cteStatusServicoCTAsync(cteDadosMsg, null);
 }
Exemplo n.º 41
0
Arquivo: Xml.cs Projeto: sopindm/bjeb
 private Xml(System.Xml.XmlDocument xml)
 {
     _xml = xml;
     _root = _xml.LastChild;
 }
Exemplo n.º 42
0
 public void SetSettings(System.Xml.XmlNode settings)
 {
 }
Exemplo n.º 43
0
            [Ignore] // Remove Atom
            // [TestMethod]
            public void SecurityCallbacksFilterEdmTest()
            {
                ServiceModelData.Northwind.EnsureDependenciesAvailable();
                CombinatorialEngine engine = CombinatorialEngine.FromDimensions(
                    new Dimension("option", "$filter,$orderby".Split(',')));

                TestUtil.RunCombinatorialEngineFail(engine, delegate(Hashtable values)
                {
                    string option = (string)values["option"];
                    int callCount = 0;
                    using (AstoriaUnitTests.Tests.UnitTestModule.AuthorizationTest.InitializationCallbackManager.RegisterStatic((s, e) =>
                    {
                        e.Configuration.SetEntitySetAccessRule("*", EntitySetRights.All);
                    }))
                        using (StaticCallbackManager <AstoriaUnitTests.Tests.UnitTestModule.AuthorizationTest.ComposeQueryEventArgs> .RegisterStatic((s, e) =>
                        {
                            System.Linq.Expressions.Expression <Func <NorthwindModel.Customers, bool> > notAnatr =
                                c => c.CustomerID != "ANATR";
                            e.Filter = notAnatr;
                            callCount++;
                        }))
                            using (TestWebRequest request = TestWebRequest.CreateForInProcess())
                            {
                                // In Northwind, the two first customers are 'ALFKI' and 'ANATR'.
                                // 'ALFKI' has these orders: 10643, 10692, 10702, 10835, 10952, 11011.
                                // 'ANATR' has these orders: 10308, 10625, 10759, 10926.
                                request.ServiceType      = typeof(AstoriaUnitTests.Tests.UnitTestModule.AuthorizationTest.WebDataServiceEdmCustomerCallback);
                                request.RequestUriString = "/Orders?" +
                                                           ((option == "$filter") ?
                                                            "$filter=startswith(Customers/CustomerID, 'A')" :
                                                            "$filter=startswith(Customers/CustomerID,%20'A')%20or%20Customers%20eq%20null&$orderby=Customers/CustomerID");
                                request.Accept = "application/atom+xml,application/xml";
                                request.SendRequest();
                                var document = request.GetResponseStreamAsXmlDocument();
                                if (option == "$filter")
                                {
                                    Assert.AreEqual(1, callCount, "Callback is called a single time (for the navigation property.");

                                    // The orders for 'ANATR' should not be returned
                                    TestUtil.AssertSelectSingleElement(document, "/atom:feed[0 = count(atom:entry/atom:id[text()='http://host/Orders(10308)'])]");
                                    TestUtil.AssertSelectSingleElement(document, "/atom:feed[0 = count(atom:entry/atom:id[text()='http://host/Orders(10625)'])]");

                                    // ALFKI is OK.
                                    TestUtil.AssertSelectSingleElement(document, "/atom:feed[1 = count(atom:entry/atom:id[text()='http://host/Orders(10643)'])]");
                                }
                                else
                                {
                                    Assert.AreEqual(3, callCount, "Callback is called a three tims (for the navigation property)");

                                    // ANATR will come before ALFKI
                                    System.Xml.XmlElement alfkiOrder =
                                        TestUtil.AssertSelectSingleElement(document, "/atom:feed/atom:entry[atom:id/text()='http://host/Orders(10643)']");
                                    System.Xml.XmlElement anatrOrder =
                                        TestUtil.AssertSelectSingleElement(document, "/atom:feed/atom:entry[atom:id/text()='http://host/Orders(10308)']");
                                    bool found = false;
                                    System.Xml.XmlNode node = alfkiOrder;
                                    while (node != null)
                                    {
                                        if (node == anatrOrder)
                                        {
                                            found = true;
                                            break;
                                        }
                                        else
                                        {
                                            node = node.PreviousSibling;
                                        }
                                    }
                                    Assert.IsTrue(found, "ANATR orders sort after ALFKI");
                                }
                            }
                });
            }
Exemplo n.º 44
0
 /// <remarks/>
 public void nfeInutilizacaoNFAsync(System.Xml.XmlNode nfeDadosMsg)
 {
     this.nfeInutilizacaoNFAsync(nfeDadosMsg, null);
 }
Exemplo n.º 45
0
Arquivo: Xml.cs Projeto: sopindm/bjeb
 public XmlNode(string name, XmlNode parent)
 {
     _node = parent._node.OwnerDocument.CreateElement(name);
     parent._node.AppendChild(_node);
 }
Exemplo n.º 46
0
 public abstract System.Xml.XmlNode XmlLoad(System.Xml.XmlNode node);
Exemplo n.º 47
0
 public void UpdateManifest(ManifestEntry manifest)
 {
     if (m_manifestEntry == null)
     {
         m_manifestEntry = m_node.AppendChild(m_doc.CreateElement("File"));
         m_manifestEntry.Attributes.Append(m_doc.CreateAttribute("type")).Value = "manifest";
         m_manifestEntry.Attributes.Append(m_doc.CreateAttribute("name")).Value = manifest.Filename;
         m_manifestEntry.Attributes.Append(m_doc.CreateAttribute("size")).Value = manifest.Filesize.ToString();
     }
     else
     {
         m_manifestEntry.Attributes["type"].Value = "manifest";
         m_manifestEntry.Attributes["name"].Value = manifest.Filename;
         m_manifestEntry.Attributes["size"].Value = manifest.Filesize.ToString();
     }
     m_manifestEntry.InnerText = Utility.Utility.ByteArrayAsHexString(Convert.FromBase64String(manifest.RemoteHash));
 }
Exemplo n.º 48
0
 public abstract System.Xml.XmlNode XmlAppend(System.Xml.XmlNode node);
Exemplo n.º 49
0
        public static System.Xml.XmlNode xslave; // XML config for slave; null if no config file.


        // Assumes xd has been loaded!
        public static void InitXmlConfig(System.Xml.XmlDocument xd)
        {
            try
            {
                xslave = xd["slave"];

                if (null != xslave) // !
                {
                    System.Xml.XmlNode xlog = xslave["log"];
                    if (null != xlog)
                    {
                        System.Xml.XmlAttribute xaenabled = xlog.Attributes["enabled"];
                        if (null != xaenabled)
                        {
                            XLog.logging = 0 == string.Compare(xaenabled.Value, "true", true);
                        }
                    }
                }
            }
            catch (System.Xml.XmlException e)
            {
                //XLog.errorlog("slave config xml error: " + e.ToString());
                throw new Exception("Sub process config xml error", e);
            }
        }
        //bookViewModel 및 childBook , instrument 를 초기화 하는 부분 from xmlfile
        public void setFromXml(System.Xml.XmlNode InstNode)
        {
            this.Node_ = InstNode;
            //InstNode["book"]["bookInfo"];

            System.Xml.XmlNode bookInfoNode
                = InstNode["bookInfo"];

            this.abstractFlag_ = bookInfoNode["abstract"].InnerText;

            string isExpandStr = bookInfoNode["isTreeExpand"].InnerText;

            if (isExpandStr.ToUpper() == "TRUE" || isExpandStr.ToUpper() == "T")
            {
                this.isTreeExpand_ = true;

            }
            else 
            {
                this.isTreeExpand_ = false;
            }
            

            this.bookName_ = bookInfoNode["bookName"].InnerText;
            this.bookCode_ = bookInfoNode["bookCode"].InnerText;

            if (this.abstractFlag_.ToUpper() != "TRUE" && this.abstractFlag_.ToUpper() != "T")
            {
                System.Xml.XmlNodeList instrumentListNodeList
                    = InstNode["instrumentList"].SelectNodes("instrument");

                foreach (System.Xml.XmlNode item in instrumentListNodeList)
                {
                    string instCode = item.InnerText;

                    //Excel_instrumentViewModel instrument = new Excel_instrumentViewModel();
                    
                    //instrument.Item_code_ = instCode;

                    //this.instrumentList_.Add(instrument);

                    if (MasterInformationViewModel.masterPositionMap_.ContainsKey(instCode))
                    {
                        this.instrumentList_.Add(MasterInformationViewModel.masterPositionMap_[instCode]);
                    }
                    else
                    {
                        this.instrumentList_.Add(new Excel_instrumentViewModel());
                    }
                    

                }
            }

            foreach (System.Xml.XmlNode item in InstNode.SelectNodes("book"))
            {
                BookViewModel childBook = new BookViewModel(this);

                childBook.setFromXml(item);

                this.childBookList_.Add(childBook);

            } 
            
        }