GetAttribute() public méthode

public GetAttribute ( string localName, string namespaceURI ) : string
localName string
namespaceURI string
Résultat string
        public static MaterialDefinition LoadFromXPathNavigator(XPathNavigator navigator)
        {
            if (navigator == null)
            {
                return null;
            }

            MaterialDefinition materialDefinition = new MaterialDefinition();

            //name
            materialDefinition.Name = navigator.GetAttribute("Name", string.Empty);
            materialDefinition.NameHash = Cryptography.JenkinsOneAtATime(materialDefinition.Name);

            //type
            materialDefinition.Type = navigator.GetAttribute("Type", string.Empty);
            materialDefinition.TypeHash = Cryptography.JenkinsOneAtATime(materialDefinition.Type);

            //draw styles
            XPathNodeIterator entries = navigator.Select("./Array[@Name='DrawStyles']/Object[@Class='DrawStyle']");

            while (entries.MoveNext())
            {
                DrawStyle drawStyle = DrawStyle.LoadFromXPathNavigator(entries.Current);

                if (drawStyle != null)
                {
                    materialDefinition.DrawStyles.Add(drawStyle);
                }
            }

            return materialDefinition;
        }
Exemple #2
0
 public static ChannelLink Parse(XPathNavigator navigator)
 {
     ChannelLink result = null;
     Guid channelId = Guid.Empty;
     string id = navigator.GetAttribute("id", String.Empty);
     if (!String.IsNullOrEmpty(id))
     {
         channelId = new Guid(id);
     }
     int mpChannelId = -1;
     string mpId = navigator.GetAttribute("mpId", String.Empty);
     if (!String.IsNullOrEmpty(id))
     {
         mpChannelId = Int32.Parse(mpId);
     }
     if (channelId != Guid.Empty
         && mpChannelId >= 0)
     {
         string channelName = navigator.GetAttribute("name", String.Empty);
         ChannelType channelType;
         string type = navigator.GetAttribute("type", String.Empty);
         if (String.IsNullOrEmpty(type))
         {
             channelType = ChannelType.Television;
         }
         else
         {
             channelType = (ChannelType)Enum.Parse(typeof(ChannelType), type);
         }
         string mpChannelName = navigator.GetAttribute("mpName", String.Empty);
         result = new ChannelLink(channelType, channelId, channelName, mpChannelId, mpChannelName);
     }
     return result;
 }
 public PowerLocalInfo ToPowerInfo(XPathNavigator powerElement)
 {
     var name = powerElement.GetAttribute("Name", "");
     var powerId = powerElement.GetAttribute("Id", "");
     var math = _character.SelectNodes(string.Format("calculations/power[@name='{0}']", name)).Item(0).Value;
     return new PowerLocalInfo(name, powerId, math);
 }
Exemple #4
0
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="tag">The tag node</param>
        public TagOptions(XPathNavigator tag)
        {
            startTag = tag.GetAttribute("startTag", String.Empty);
            endTag = tag.GetAttribute("endTag", String.Empty);
            tagAttributes = tag.GetAttribute("attributes", String.Empty);
            matchRules = tag.Select("Match");
            endTags = new Stack<string>();
        }
Exemple #5
0
        static Func<IEnumerable<Argument>, string> GetArgsFormating(XPathNavigator argsNode)
        {
            string accumulator = argsNode.GetAttribute("accumulator", string.Empty);
            string start = argsNode.GetAttribute("start", string.Empty);
            string end = argsNode.GetAttribute("end", string.Empty);
            string general = argsNode.GetAttribute("general", string.Empty);

            return GetArgsFormating(accumulator, start, end, general);
        }
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="component">The build component that owns the dictionary.  This is useful for logging
        /// messages during initialization.</param>
        /// <param name="configuration">The target dictionary configuration</param>
        /// <returns>A target dictionary instance that uses a simple in-memory
        /// <see cref="Dictionary{TKey, TValue}"/> instance to store the targets.</returns>
        public ESentTargetDictionary(BuildComponentCore component, XPathNavigator configuration) :
          base(component, configuration)
        {
            bool noReload = false;
            int localCacheSize;

            string cachePath = configuration.GetAttribute("cachePath", String.Empty);

            if(String.IsNullOrWhiteSpace(cachePath))
                throw new ArgumentException("The cachePath attribute must contain a value", "configuration");

            string cacheSize = configuration.GetAttribute("localCacheSize", String.Empty);

            if(String.IsNullOrWhiteSpace(cacheSize) || !Int32.TryParse(cacheSize, out localCacheSize))
                localCacheSize = 1000;

            // This is a slightly modified version of Managed ESENT that provides the option to serialize
            // reference types.  In this case, we don't care about potential issues of persisted copies not
            // matching the original if modified as they are never updated once written to the cache.  We can
            // also turn off column compression for a slight performance increase since it doesn't benefit the
            // binary data that is serialized.
            PersistentDictionaryFile.AllowReferenceTypeSerialization = true;

            index = new PersistentDictionary<string, Target>(cachePath, false)
                { LocalCacheSize = localCacheSize };

            string noReloadValue = configuration.GetAttribute("noReload", String.Empty);

            // If noReload is true, skip reloading the dictionary if it contains any data.  This is used on
            // project targets to prevent reloading the data in the reference build if already loaded by the
            // conceptual build.
            if(!String.IsNullOrWhiteSpace(noReloadValue) && Boolean.TryParse(noReloadValue, out noReload) &&
              noReload && index.Count != 0)
                return;

            // Loading new targets can take a while so issue a diagnostic message as an alert
            int filesToLoad = 0;

            foreach(string file in Directory.EnumerateFiles(this.DirectoryPath, this.FilePattern, this.Recurse ?
              SearchOption.AllDirectories : SearchOption.TopDirectoryOnly))
                if((this.NamespaceFileFilter.Count == 0 || this.NamespaceFileFilter.Contains(
                  Path.GetFileName(file))) && !this.ContainsKey("N:" + Path.GetFileNameWithoutExtension(file)))
                    filesToLoad++;

            // The time estimate is a ballpark figure and depends on the system
            if(filesToLoad != 0)
            {
                component.WriteMessage(MessageLevel.Diagnostic, "{0} file(s) need to be added to the ESENT " +
                    "reflection target cache database.  Indexing them will take about {1:N0} minute(s), " +
                    "please be patient.  Cache location: {2}", filesToLoad, Math.Ceiling(filesToLoad * 10 / 60.0),
                    cachePath);

                // Limit the degree of parallelism or it overwhelms the ESENT version store
                this.LoadTargetDictionary(3);
            }
        }
Exemple #7
0
		public SettingsMapping (XPathNavigator nav)
		{
			_sectionTypeName = nav.GetAttribute ("sectionType", String.Empty);
			_mapperTypeName = nav.GetAttribute ("mapperType", String.Empty);

			EnumConverter cvt = new EnumConverter (typeof (SettingsMappingPlatform));
			_platform = (SettingsMappingPlatform) cvt.ConvertFromInvariantString (nav.GetAttribute ("platform", String.Empty));

			LoadContents (nav);
		}
      public void ReadXml(XPathNavigator node, XmlResolver resolver) {

         if (node.NodeType == XPathNodeType.Element) {

            if (node.MoveToFirstAttribute()) {
               do {
                  switch (node.LocalName) {
                     case "media-type":
                        this.MediaType = node.Value;
                        break;

                     case "boundary":
                        this.Boundary = node.Value;
                        break;
                  }
               } while (node.MoveToNextAttribute());

               node.MoveToParent();
            }

            if (node.MoveToChild(XPathNodeType.Element)) {

               XPathHttpMultipartItem currentItem = null;

               do {
                  if (node.NamespaceURI == XPathHttpClient.Namespace) {

                     switch (node.LocalName) {
                        case "header":
                           if (currentItem == null)
                              currentItem = new XPathHttpMultipartItem();

                           currentItem.Headers.Add(node.GetAttribute("name", ""), node.GetAttribute("value", ""));
                           break;

                        case "body":
                           if (currentItem == null)
                              currentItem = new XPathHttpMultipartItem();

                           currentItem.Body = new XPathHttpBody();
                           currentItem.Body.ReadXml(node, resolver);

                           this.Items.Add(currentItem);
                           currentItem = null;
                           break;
                     }
                  }

               } while (node.MoveToNext(XPathNodeType.Element));
               
               node.MoveToParent();
            }
         }
      }
Exemple #9
0
 public View(XPathNavigator view, XPathNavigator mainView, IXmlNamespaceResolver resolver)
 {
     this._id = view.GetAttribute("id", String.Empty);
     this._type = view.GetAttribute("type", String.Empty);
     if (this._id == mainView.GetAttribute("virtualViewId", String.Empty))
         view = mainView;
     this._label = view.GetAttribute("label", String.Empty);
     this._headerText = ((string)(view.Evaluate("string(c:headerText)", resolver)));
     _group = view.GetAttribute("group", String.Empty);
     _showInSelector = !((view.GetAttribute("showInSelector", String.Empty) == "false"));
 }
 private static PageInfo GetPageInfoFromNavigator(XPathNavigator matchingPageNode)
 {
     // Create the PageInfo from the element navigator.
     var pageInfo = new PageInfo {
         Id = int.Parse(matchingPageNode.GetAttribute("id", string.Empty)),
         Slug = matchingPageNode.GetAttribute("slug", string.Empty),
         Title = matchingPageNode.GetAttribute("title", string.Empty),
         Content = HttpUtility.HtmlDecode(matchingPageNode.Value)
     };
     return pageInfo;
 }
        public HxfGeneratorComponent (BuildAssembler assembler, XPathNavigator configuration) : base(assembler, configuration) {

            // get configuration data
            inputValue = configuration.GetAttribute("input", String.Empty);
            if (!String.IsNullOrEmpty(inputValue)) inputValue = Environment.ExpandEnvironmentVariables(inputValue);
            outputValue = configuration.GetAttribute("output", String.Empty);
            if (!String.IsNullOrEmpty(outputValue)) outputValue = Environment.ExpandEnvironmentVariables(outputValue);
           
            // subscribe to component events
            assembler.ComponentEvent += new EventHandler(FileCreatedHandler);
        }
Exemple #12
0
 public ActionGroup(XPathNavigator actionGroup, IXmlNamespaceResolver resolver)
     : this()
 {
     this._scope = actionGroup.GetAttribute("scope", String.Empty);
     this._headerText = actionGroup.GetAttribute("headerText", String.Empty);
     this._id = actionGroup.GetAttribute("id", String.Empty);
     _flat = (actionGroup.GetAttribute("flat", String.Empty) == "true");
     XPathNodeIterator actionIterator = actionGroup.Select("c:action", resolver);
     while (actionIterator.MoveNext())
         if (Controller.UserIsInRole(actionIterator.Current.GetAttribute("roles", String.Empty)))
             this.Actions.Add(new Action(actionIterator.Current, resolver));
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectFile"/> class.
        /// </summary>
        /// <param name="nodeFromProject">The x path navigator.</param>
        public ProjectFile(XPathNavigator nodeFromProject)
        {
            if (nodeFromProject == null)
            {
                throw new ArgumentNullException("nodeFromProject", @"Cannot create project file as the XML passed was null.");
            }

            _relativePath = nodeFromProject.GetAttribute(@"RelPath", string.Empty);

            string buildAction = nodeFromProject.GetAttribute(@"BuildAction", string.Empty);
            _buildAction = (BuildAction)Enum.Parse(typeof(BuildAction), buildAction);
        }
        //=====================================================================

        /// <inheritdoc />
        public override void Initialize(XPathNavigator configuration)
        {
            inputFile = configuration.GetAttribute("input", String.Empty);

            if(!String.IsNullOrEmpty(inputFile))
                inputFile = Environment.ExpandEnvironmentVariables(inputFile);

            outputFilename = configuration.GetAttribute("output", String.Empty);

            if(!String.IsNullOrEmpty(outputFilename))
                outputFilename = Environment.ExpandEnvironmentVariables(outputFilename);

            // Subscribe to component events
            base.BuildAssembler.ComponentEvent += FileCreatedHandler;
        }
 private static Browser GetBrowser(XPathNavigator objNav)
 {
     Browser objBrowser = new Browser();
     objBrowser.Contains = objNav.GetAttribute("contains", "");
     objBrowser.Name = objNav.GetAttribute("nm", "");
     string strMinVersion = objNav.GetAttribute("minversion", "");
     //If Not String.IsNullOrEmpty(strMinVersion) Then    '.NET 2.0 specific
     // HACK : Modified to not error if object is null.
     //if (strMinVersion.Length > 0)
     if (!String.IsNullOrEmpty(strMinVersion))
     {
         objBrowser.MinVersion = double.Parse(strMinVersion);
     }
     return objBrowser;
 }
 private DateTime CreateDateTime(XPathNavigator node, string attribute)
 {
     var value = node.GetAttribute(attribute, node.NamespaceURI);
     if (String.IsNullOrEmpty(value))
         return DateTime.MinValue;
     return DateTime.Parse(value);
 }
 internal static string ExtractFromNavigator(XPathNavigator nav)
 {
     string attribute = nav.GetAttribute(XPathMessageContext.Actor11A, "http://schemas.xmlsoap.org/soap/envelope/");
     string str2 = nav.GetAttribute(XPathMessageContext.Actor12A, "http://www.w3.org/2003/05/soap-envelope");
     nav.MoveToRoot();
     nav.MoveToFirstChild();
     if ((nav.LocalName == "Envelope") && (nav.NamespaceURI == "http://schemas.xmlsoap.org/soap/envelope/"))
     {
         return attribute;
     }
     if ((nav.LocalName == "Envelope") && (nav.NamespaceURI == "http://www.w3.org/2003/05/soap-envelope"))
     {
         return str2;
     }
     return string.Empty;
 }
        private TIMD FindEnumValue(XPathNavigator node, string attribute)
        {
            var value = node.GetAttribute(attribute, node.NamespaceURI);

            TIMD outValue;
            Enum.TryParse(value, out outValue);
            return outValue;
        }
Exemple #19
0
 public static bool ControlloLingua(XPathNavigator navigator)
 {
     bool risultato = true;
     navigator.MoveToNextAttribute();
     String hreflang = navigator.GetAttribute("hreflang", "");
     if (hreflang != navigator.XmlLang)
         risultato = false;
     return risultato;
 }
        // Instantiation logic

		public ResolveConceptualLinksComponent (BuildAssembler assembler, XPathNavigator configuration) : base(assembler, configuration) {

            string showBrokenLinkTextValue = configuration.GetAttribute("showBrokenLinkText", String.Empty);
            if (!String.IsNullOrEmpty(showBrokenLinkTextValue)) showBrokenLinkText = Convert.ToBoolean(showBrokenLinkTextValue);

			XPathNodeIterator targetsNodes = configuration.Select("targets");
			foreach (XPathNavigator targetsNode in targetsNodes) {

                // the base directory containing target; required
                string baseValue = targetsNode.GetAttribute("base", String.Empty);
                if (String.IsNullOrEmpty(baseValue)) WriteMessage(MessageLevel.Error, "Every targets element must have a base attribute that specifies the path to a directory of target metadata files.");
                baseValue = Environment.ExpandEnvironmentVariables(baseValue);
                if (!Directory.Exists(baseValue)) WriteMessage(MessageLevel.Error, String.Format("The specified target metadata directory '{0}' does not exist.", baseValue));

                // an xpath expression to construct a file name
                // (not currently used; pattern is hard-coded to $target.cmp.xml
                string filesValue = targetsNode.GetAttribute("files", String.Empty);

                // an xpath expression to construct a url
                string urlValue = targetsNode.GetAttribute("url", String.Empty);
                XPathExpression urlExpression;
                if (String.IsNullOrEmpty(urlValue)) {
                    urlExpression = XPathExpression.Compile("concat(/metadata/topic/@id,'.htm')");
                } else {
                    urlExpression = CompileXPathExpression(urlValue);
                }
                
                // an xpath expression to construct link text
                string textValue = targetsNode.GetAttribute("text", String.Empty);
                XPathExpression textExpression;
                if (String.IsNullOrEmpty(textValue)) {
                    textExpression = XPathExpression.Compile("string(/metadata/topic/title)");
                } else {
                    textExpression = CompileXPathExpression(textValue);
                }

                // the type of link to create to targets found in the directory; required
                string typeValue = targetsNode.GetAttribute("type", String.Empty);
                if (String.IsNullOrEmpty(typeValue)) WriteMessage(MessageLevel.Error, "Every targets element must have a type attribute that specifies what kind of link to create to targets found in that directory.");
                
                // convert the link type to an enumeration member
                LinkType type = LinkType.None;
                try {
                    type = (LinkType) Enum.Parse(typeof(LinkType), typeValue, true);
                } catch (ArgumentException) {
                    WriteMessage(MessageLevel.Error, String.Format("'{0}' is not a valid link type.", typeValue));
                }

                // we have all the required information; create a TargetDirectory and add it to our collection
                TargetDirectory targetDirectory = new TargetDirectory(baseValue, urlExpression, textExpression, type);
                targetDirectories.Add(targetDirectory);

            }

            WriteMessage(MessageLevel.Info, String.Format("Collected {0} targets directories.", targetDirectories.Count));	

		}
Exemple #21
0
 public static bool ApplicationAtomXml(XPathNavigator navigator)
 {
     bool risultato = true;
     navigator.MoveToNextAttribute();
     String type = navigator.GetAttribute("type", "");
     if (type != "application/atom+xml")
         risultato = false;
     return risultato;
 }
Exemple #22
0
 public static bool AppOpenXml(XPathNavigator navigator)
 {
     bool risultato = true;
     navigator.MoveToNextAttribute();
     String type = navigator.GetAttribute("type", "");
     if (type != "application/opensearchdescription+xml")
         risultato = false;
     return risultato;
 }
Exemple #23
0
        public static VertexLayout LoadFromXPathNavigator(XPathNavigator navigator)
        {
            if (navigator == null)
            {
                return null;
            }

            VertexLayout vertexLayout = new VertexLayout();

            //name
            vertexLayout.Name = navigator.GetAttribute("Name", String.Empty);

            //name hash
            vertexLayout.NameHash = Cryptography.JenkinsOneAtATime(vertexLayout.Name);

            //entries
            XPathNodeIterator entries = navigator.Select("./Array[@Name='Entries']/Object[@Class='LayoutEntry']");

            while (entries.MoveNext())
            {
                navigator = entries.Current;

                VertexLayout.Entry entry = new Entry();

                //stream
                entry.Stream = UInt32.Parse(navigator.GetAttribute("Stream", String.Empty));

                //data type
                string dataTypeString = navigator.GetAttribute("Type", String.Empty);
                Entry.GetDataTypeFromString(dataTypeString, out entry.DataType);

                //data usage
                string dataUsageString = navigator.GetAttribute("Usage", String.Empty);
                Entry.GetDataUsageFromString(dataUsageString, out entry.DataUsage);

                //data usage index
                entry.DataUsageIndex = UInt32.Parse(navigator.GetAttribute("UsageIndex", String.Empty));

                vertexLayout.Entries.Add(entry);
            }

            return vertexLayout;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="component">The XPath navigator containing the syntax
        /// filter component's configuration information</param>
        internal SyntaxFilterInfo(XPathNavigator component)
        {
            XPathNavigator item;
            string attrValue;

            id = component.GetAttribute("id", String.Empty);

            if(String.IsNullOrEmpty(id))
                throw new InvalidOperationException("Syntax filter configuration contains no 'id' attribute");

            attrValue = component.GetAttribute("sortOrder", String.Empty);

            // Sort order is optional
            if(String.IsNullOrEmpty(attrValue))
                sortOrder = Int32.MaxValue;
            else
                sortOrder = Convert.ToInt32(attrValue, CultureInfo.InvariantCulture);

            // Alternate names are optional
            alternateNames = new Collection<string>();
            attrValue = component.GetAttribute("alternateNames", String.Empty);

            if(!String.IsNullOrEmpty(attrValue))
                foreach(string n in attrValue.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    attrValue = n.Trim();

                    if(attrValue.Length != 0)
                        alternateNames.Add(attrValue.ToLowerInvariant());
                }

            item = component.SelectSingleNode("generator");
            if(item == null)
                throw new InvalidOperationException("Syntax filter configuration contains no 'generator' node");

            generatorNode = item.OuterXml;

            item = component.SelectSingleNode("language");
            if(item == null)
                throw new InvalidOperationException("Syntax filter configuration contains no 'generator' node");

            languageNode = item.OuterXml;
        }
Exemple #25
0
        private string GetFilename(string basePath, XPathNavigator node) {
            // Try and find the source relative to the coverage file first...
            var filename = node.GetAttribute("filename", "");
            string relativePath = Path.Combine(_coverageXmlBasePath, filename);
            if (File.Exists(relativePath)) {
                return relativePath;
            }

            // Then try the absolute path.
            return Path.Combine(basePath, filename);
        }
        public Attachment Read(XPathNavigator navigator, ContentItem item)
        {
            string url = navigator.GetAttribute("url", string.Empty);

            if(!string.IsNullOrEmpty(url))
            {
                return new Attachment(this, url, item, Convert.FromBase64String(navigator.Value));
            }

            return null;
        }
Exemple #27
0
 public Attachment Read(XPathNavigator navigator, ContentItem item)
 {
     string x = navigator.GetAttribute("blah", string.Empty);
     if (!string.IsNullOrEmpty(x))
     {
         Assert.AreEqual(x.ToUpper(), navigator.Value);
         item["wasRead"] = true;
         return new Attachment(this, x, item, new byte[1]);
     }
     return null;
 }
Exemple #28
0
		private ITaskConfiguration CreateTaskConfiguration(IContext context, TaskTypeCatalog taskTypes, XPathNavigator taskNode)
		{
			string taskName = taskNode.GetAttribute("taskName", string.Empty);

			if (taskTypes.TaskNameToConfigType.ContainsKey(taskName)) //has a config class
			{
				//make the task configuration class, using the xml we're looking at
				return context.Resolve<ITaskConfiguration>(taskName + "Config",// using this service name
												   new Parameter[] { new TypedParameter(typeof(string), taskNode.OuterXml) });
			}
			return null;
		}
        static TimeSpan ReadTimeSpan(XPathNavigator assembly)
        {
            var timeString = assembly.GetAttribute("time", "");

            double time;
            if (double.TryParse(timeString, NumberStyles.Number, CultureInfo.InvariantCulture, out time))
            {
                return TimeSpan.FromMilliseconds(time);
            }

            return TimeSpan.Zero;
        }
Exemple #30
0
        public CreateRound(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            alineAxis = (Axis)Enum.Parse(typeof(Axis), navigator.GetAttribute("axis", string.Empty));

            //Radius of circle
            navigator.MoveToChild("Radius", string.Empty);
            radius = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Center of circle
            navigator.MoveToChild("Center", string.Empty);
            center   = new Vector3WithUnit();
            center.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            center.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            center.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent();
        }
Exemple #31
0
        public static DrawStyle LoadFromXPathNavigator(XPathNavigator navigator)
        {
            if (navigator == null)
            {
                return null;
            }

            DrawStyle drawStyle = new DrawStyle();

            //name
            drawStyle.Name = navigator.GetAttribute("Name", String.Empty);
            drawStyle.NameHash = Jenkins.OneAtATime(drawStyle.Name);

            //effect
            drawStyle.Effect = navigator.GetAttribute("Effect", String.Empty);

            //input layout
            String vertexLayout = navigator.GetAttribute("InputLayout", String.Empty);
            drawStyle.VertexLayoutNameHash = Jenkins.OneAtATime(vertexLayout);

            return drawStyle;
        }
Exemple #32
0
        public CreateSphere(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            //Radius of sphere
            navigator.MoveToChild("Radius", string.Empty);
            radius = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Center of sphere
            navigator.MoveToChild("Center", string.Empty);
            center   = new Vector3WithUnit();
            center.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            center.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            center.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent();
        }
Exemple #33
0
 public CreatePoint(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
     : base(navigator, parent)
 {
     //Position of Point
     navigator.MoveToChild("Position", string.Empty);
     position   = new Vector3WithUnit();
     position.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
     position.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
     position.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
     navigator.MoveToParent();
 }
Exemple #34
0
        public CreateCuboid(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            //Width of box
            navigator.MoveToChild("Width", string.Empty);
            width = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Depth of box
            navigator.MoveToChild("Depth", string.Empty);
            depth = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Height of box
            navigator.MoveToChild("Height", string.Empty);
            height = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Reference point of box
            navigator.MoveToChild("RefPoint", string.Empty);
            refPoint   = new Vector3WithUnit();
            refPoint.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            refPoint.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            refPoint.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent();
        }
Exemple #35
0
        public CreateCone(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            alineAxis = (Axis)Enum.Parse(typeof(Axis), navigator.GetAttribute("axis", string.Empty));

            //Bottom radius of cylinder
            navigator.MoveToChild("BottomRadius", string.Empty);
            bottomRadius = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent( );

            //Top radius of cylinder
            navigator.MoveToChild("TopRadius", string.Empty);
            topRadius = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent( );

            //Height of cylinder
            navigator.MoveToChild("Height", string.Empty);
            height = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent( );

            //Center of cylinder
            navigator.MoveToChild("Center", string.Empty);
            center   = new Vector3WithUnit( );
            center.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            center.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            center.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent( );
        }
Exemple #36
0
        public CreateLine(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            navigator.MoveToChild("Positions", string.Empty);
            navigator.MoveToFirstChild();

            //Start Point of line
            startPoint   = new Vector3WithUnit();
            startPoint.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            startPoint.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            startPoint.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));


            //End Point of line
            navigator.MoveToNext();
            endPoint   = new Vector3WithUnit();
            endPoint.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            endPoint.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            endPoint.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));

            navigator.MoveToParent();
            navigator.MoveToParent();
        }
Exemple #37
0
        public CreateRectangle(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            alineAxis = (Axis)Enum.Parse(typeof(Axis), navigator.GetAttribute("axis", string.Empty));

            //Width of rectangle
            navigator.MoveToChild("Width", string.Empty);
            width = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Height of rectangle
            navigator.MoveToChild("Height", string.Empty);
            height = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Reference point of rectangle
            navigator.MoveToChild("RefPoint", string.Empty);
            refPoint   = new Vector3WithUnit();
            refPoint.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            refPoint.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            refPoint.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent();
        }