Exemplo n.º 1
0
 protected override void Initialize()
 {
     Name     = "RootGameObject";
     Type     = "RootGameObject";
     Position = new Vector3(0, 0, 0);
     Rotation = new Vector3(0, 0, 0);
     Scale    = new Vector3(1, 1, 1);
     CreateTransformationMatrix();
     Childs.Add("Units", new Group("Units"));
 }
Exemplo n.º 2
0
 public Node <T> AddAll(IEnumerable <Node <T> > values)
 {
     values.ForEachItem(
         x =>
     {
         x.Parent = this;
         Childs.Add(x);
     });
     return(this);
 }
Exemplo n.º 3
0
        public ImageBuilder FromImage(string image)
        {
            UseImage(image);

            var builder = new ImageBuilder(this).AsImageName(image);

            Childs.Add(builder);

            return(builder);
        }
Exemplo n.º 4
0
 internal Join(string listName, CG.JoinType type)
     : base("Join", new[]
 {
     new Tuple <string, string>("Type", type.ToString()),
     new Tuple <string, string>("ListAlias", listName)
 }, null)
 {
     _innerEq = new Eq();
     Childs.Add(_innerEq);
 }
Exemplo n.º 5
0
            /// <summary>
            /// Creates a new instance of the <see cref="CollectionNode"/> class and scans it's folder.
            /// </summary>
            /// <param name="dir">The folder containing the files of the app/collection</param>
            public CollectionNode(string dir)
            {
                Directory = dir;
                Name      = Path.GetFileName(dir.Trim('\\'));

                if (System.IO.Directory.Exists(dir + DocumentationDirectory))
                {
                    Docs = new Documentation(dir + DocumentationDirectory);
                }

                #region Enumerate childs, actions and versions
                foreach (var File in EnumerateDir(dir))
                {
                    var           file = File + '\\';
                    DirectoryInfo diri = new DirectoryInfo(dir);
                    if (diri.Attributes.HasFlag(FileAttributes.Hidden))
                    {
                        continue;
                    }
                    if (Path.GetFileName(File)[0] == '_')
                    {
                        loadAction(File);
                        continue;
                    }
                    var child = new CollectionNode(file);
                    if (child.Name.StartsWith("v"))
                    {
                        var ver = new Version();
                        ver.Name = child.Name.Substring(1);
                        ver.Actions.Clear();
                        ver.Actions.AddRange(child.Actions);

                        foreach (string item in new string[] {
                            "info.md",
                            "info.markdown",
                            "info.html",
                            "info.htm",
                            "info.xhtml",
                            "info.txt"
                        })
                        {
                            if (System.IO.File.Exists(file + item))
                            {
                                ver.VersionInfo     = ReadDocFile(file + item);
                                ver.VersionInfoPath = file + item;
                                break;
                            }
                        }
                        Versions.Add(ver);
                        continue;
                    }
                    Childs.Add(child);
                }
                #endregion
            }
Exemplo n.º 6
0
        public void Add(string key, int value)
        {
            var i = 0;

            while (i < key.Length && i < Key.Length && Key[i] == key[i])
            {
                i++;
            }

            if (i == key.Length && i == Key.Length)//Equals
            {
                Value = value;
            }
            else if (i == key.Length)//Key contains key
            {
                var oldChilds = new Dictionary <char, PatriciaTrieNode>(Childs);

                Childs.Clear();
                Childs.Add(Key[i], new PatriciaTrieNode(Key.Substring(i), Value, oldChilds));
                Key   = key.Substring(0, i);
                Value = value;
            }
            else if (i == Key.Length)//key contains Key
            {
                PatriciaTrieNode child;
                if (Childs.TryGetValue(key[i], out child))
                {
                    child.Add(key.Substring(i), value);
                }
                else
                {
                    Childs.Add(key[i], new PatriciaTrieNode(key.Substring(i), value));
                }
            }
            else//find a char not equals
            {
                PatriciaTrieNode child;
                if (Childs.TryGetValue(key[i], out child))
                {
                    child.Add(key.Substring(i), value);
                }
                else
                {
                    var oldChilds = new Dictionary <char, PatriciaTrieNode>(Childs);

                    Childs.Clear();
                    Childs.Add(Key[i], new PatriciaTrieNode(Key.Substring(i), Value, oldChilds));
                    Childs.Add(key[i], new PatriciaTrieNode(key.Substring(i), value));

                    Key   = Key.Substring(0, i);
                    Value = null;
                }
            }
        }
        /// <summary>
        /// constructor that takes a go and a parent node as well as the cage transform
        /// </summary>
        public Node(GameObject go, Node parent, Transform cage)
        {
            // assign parent
            Parent = parent;

            // assign game object
            GameObject = go;
            GOName     = GameObject.name;

            // get the original transforms, position relative to the cage
            P0 = cage.InverseTransformPoint(go.transform.position);
            //R0 = go.transform.rotation;
            //R0 = go.transform.rotation * Quaternion.Inverse(cage.rotation);
            R0 = Quaternion.Inverse(cage.rotation) * go.transform.rotation;
            S0 = go.transform.localScale;

            // check whether game object has a mesh
            HasMesh = go.GetComponent <MeshFilter>() != null;

            // get starting bounds
            if (HasMesh)
            {
                Bounds = go.GetComponent <Renderer>().bounds;
            }
            else
            {
                Bounds = new Bounds(go.transform.position, Vector3.zero);
            }

            // get original material
            if (HasMesh)
            {
                Material = go.GetComponent <Renderer>().sharedMaterial;
            }
            else
            {
                Material = null;
            }

            Locked = true;
            Name   = go.name;

            // add collider if doesn't exist
            if (HasMesh && go.GetComponent <Collider>() == null)
            {
                go.AddComponent <MeshCollider>();
            }

            // check childs
            foreach (Transform child in go.transform)
            {
                Childs.Add(new Node(child.gameObject, this, cage));
            }
        }
Exemplo n.º 8
0
        internal void AddChild(string xref, string frel = null, string mrel = null)
        {
            // Add a child record, given a cross reference id.
            // Assumes that the father/mother relation is 'Natural'
            Child ch = new Child();

            ch.Xref           = xref;
            ch.FatherRelation = frel;
            ch.MotherRelation = mrel;
            Childs.Add(ch);
        }
Exemplo n.º 9
0
        public Child(string name, int childLevel)
        {
            Name = name;

            if (childLevel < 3)
            {
                foreach (var i in Enumerable.Range(0, 10))
                {
                    Childs.Add(new Child(name + $"-child{childLevel}", childLevel + 1));
                }
            }
        }
Exemplo n.º 10
0
        public async void Get()
        {
            var jData = await DataService.Get($"Child/{Family?.Id}");

            if (jData == "ConnectionError")
            {
                StandardMessagesDisplay.NoConnectionToast();
            }
            else if (jData == "null")
            {
                StandardMessagesDisplay.NoDataDisplayMessage();
            }
            else if (jData == "Error")
            {
                StandardMessagesDisplay.Error();
            }
            else if (jData == "ErrorTracked")
            {
                StandardMessagesDisplay.ErrorTracked();
            }
            else
            {
                try
                {
                    var data = JsonConvert.DeserializeObject <Dictionary <string, ChildModel> >(jData);

                    if (data != null)
                    {
                        foreach (KeyValuePair <string, ChildModel> item in data)
                        {
                            Childs?.Add(
                                new ChildModel
                            {
                                FId          = item.Key.ToString(),
                                Id           = item.Value.Id,
                                FullName     = item.Value.FullName,
                                DOB          = item.Value.DOB,
                                Gender       = item.Value.Gender,
                                OPV0         = item.Value.OPV0,
                                RINo         = item.Value.RINo,
                                RegisteredBy = item.Value.RegisteredBy
                            });
                        }
                    }
                }
                catch (Exception ex)
                {
                    Crashes.TrackError(ex);
                    StandardMessagesDisplay.InputToast(ex.Message);
                }
            }
        }
Exemplo n.º 11
0
        public HiiPackageString(IfrRawDataBlock raw) : base(raw)
        {
            data_payload = new IfrRawDataBlock(data);
            data_payload.IncreaseOffset(_Header.GetPhysSize());

            _Payload.Language = data_payload.CopyOfAsciiNullTerminatedString;

            // Parse all string information block types..
            uint offset = (uint)_Payload.Language.Length + 1;

            while (offset < data_payload.Length)
            {
                IfrRawDataBlock      raw_data  = new IfrRawDataBlock(data_payload.Bytes, data_payload.Offset + offset, data_payload.Length - offset);
                EFI_HII_STRING_BLOCK block_hdr = raw_data.ToIfrType <EFI_HII_STRING_BLOCK>();
                HPKElement           hpk_element;

                switch (block_hdr.BlockType)
                {
                case EFI_HII_SIBT_e.EFI_HII_SIBT_END: hpk_element = new HiiSibtBlockNoPayload <EFI_HII_STRING_BLOCK>(raw_data); break;

                /*case EFI_HII_SIBT_e.EFI_HII_SIBT_STRING_SCSU:
                 * case EFI_HII_SIBT_e.EFI_HII_SIBT_STRING_SCSU_FONT:
                 * case EFI_HII_SIBT_e.EFI_HII_SIBT_STRINGS_SCSU:
                 * case EFI_HII_SIBT_e.EFI_HII_SIBT_STRINGS_SCSU_FONT:*/
                case EFI_HII_SIBT_e.EFI_HII_SIBT_STRING_UCS2: hpk_element = new HiiSibtBlockStringUcs2(raw_data); break;

                /*case EFI_HII_SIBT_e.EFI_HII_SIBT_STRING_UCS2_FONT:
                 * case EFI_HII_SIBT_e.EFI_HII_SIBT_STRINGS_UCS2:
                 * case EFI_HII_SIBT_e.EFI_HII_SIBT_STRINGS_UCS2_FONT:
                 * case EFI_HII_SIBT_e.EFI_HII_SIBT_DUPLICATE:*/
                case EFI_HII_SIBT_e.EFI_HII_SIBT_SKIP2: hpk_element = new HiiSibtBlockNoPayload <EFI_HII_SIBT_SKIP2_BLOCK>(raw_data); break;

                case EFI_HII_SIBT_e.EFI_HII_SIBT_SKIP1: hpk_element = new HiiSibtBlockNoPayload <EFI_HII_SIBT_SKIP1_BLOCK>(raw_data); break;

                case EFI_HII_SIBT_e.EFI_HII_SIBT_EXT1: hpk_element = new HiiSibtBlockExt <EFI_HII_SIBT_EXT1_BLOCK>(raw_data); break;

                case EFI_HII_SIBT_e.EFI_HII_SIBT_EXT2: hpk_element = new HiiSibtBlockExt <EFI_HII_SIBT_EXT2_BLOCK>(raw_data); break;

                case EFI_HII_SIBT_e.EFI_HII_SIBT_EXT4: hpk_element = new HiiSibtBlockExt <EFI_HII_SIBT_EXT4_BLOCK>(raw_data); break;

                /*case EFI_HII_SIBT_e.EFI_HII_SIBT_FONT:*/
                default:
                    //raw_data.GenerateAndLogDump(ifr_hdr.OpCode.ToString());
                    LogMessage(LogSeverity.UNIMPLEMENTED, block_hdr.BlockType.ToString());
                    LogMessage(LogSeverity.ERROR, "Parsing aborted due to unimplemented type!");
                    return;
                }
                Childs.Add(hpk_element);

                offset += hpk_element.PhysicalSize;
            }
        }
Exemplo n.º 12
0
        public override string GetHTML(int deep = 0)
        {
            Childs.Clear();
            SetAttribute("aria-label", aria_label is null ? "Toolbar with button groups" : aria_label);
            Groups.ForEach(x => Childs.Add(x));

            if (!(Justifying is null))
            {
                AddCSS(Justifying?.ToString("g").Replace("_", "-"));
            }

            return(base.GetHTML(deep));
        }
        /// <summary>
        /// Add the current tab as top menu item.
        /// </summary>
        private void AddRootNode()
        {
            PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];
            PageSettings   tabItemsRoot   = portalSettings.ActivePage;

            using (MenuTreeNode mn = new MenuTreeNode(tabItemsRoot.PageName))
            {
                // change the link to stay on the same page and call a category product
                mn.Link  = HttpUrlBuilder.BuildUrl("~/DesktopDefault.aspx", tabItemsRoot.PageID);
                mn.Width = Width;
                Childs.Add(mn);
            }
        }
Exemplo n.º 14
0
 public void AddChild(Node newChild)
 {
     if (Childs == null)
     {
         Childs = new List <Node>();
     }
     Childs.Add(newChild);
     if (newChild.Parents == null)
     {
         newChild.Parents = new List <Node>();
     }
     newChild.Parents.Add(this);
 }
Exemplo n.º 15
0
 public bool AddElement(ASNElement el)
 {
     if (!HasElement(el) && CanAdd)
     {
         Childs.Add(el);
         el.ParentSection = this;
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 16
0
 public void InsertChild(WordGlyph glyph)
 {
     glyph.Parent               = this;
     glyph.MainGlyph            = MainGlyph;
     glyph.Redactor             = Redactor;
     glyph.ParentVectorRedactor = ParentVectorRedactor;
     Childs.Add(glyph);
     if (!Line.Words.Contains(glyph.Word))
     {
         Line.AddWord(glyph.Word);
     }
     ParentVectorRedactor.Layout.AddFigure(glyph.Figure);
 }
Exemplo n.º 17
0
 public void Add(string name, object value)
 {
     if (!(value is IJsonElement))
     {
         value = new JsonElement(name, value);
     }
     else
     {
         (value as JsonElement).Name = name;
     }
     Childs.Add(value as JsonNode);
     m_items.Add(name, value as JsonNode);
 }
        /// <summary>
        /// Add a Menu Tree Node if user in in the list of Authorized roles.
        /// Thanks to abain for fixing authorization bug.
        /// </summary>
        /// <param name="tabIndex">Index of the tab</param>
        /// <param name="myTab">Tab to add to the MenuTreeNodes collection</param>
        protected virtual void AddMenuTreeNode(int tabIndex, PageStripDetails myTab) //MH:
        {
            if (PortalSecurity.IsInRoles(myTab.AuthorizedRoles))
            {
                MenuTreeNode mn = new MenuTreeNode(myTab.PageName);

                mn.Link   = giveMeUrl(myTab.PageName, myTab.PageID);
                mn.Height = Height;
                mn.Width  = Width;
                mn        = RecourseMenu(tabIndex, myTab.Pages, mn);
                Childs.Add(mn);
            }
        }
Exemplo n.º 19
0
 // まで訪問していないランダムの子ノードを返す
 public Node ExpandChildNode()
 {
     if (!child_inited_)
     {
         child_inited_ = true;
         InitNotVisitChilds();
     }
     --NotVisitNum;
     ++ChildNum;
     var ret = NotVisitChilds.Dequeue();
     Childs.Add(ret);
     return ret;
 }
        /// <summary>
        /// Adds the shop home node.
        /// </summary>
        private void AddShopHomeNode()
        {
            PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];
            int            tabIDShop      = portalSettings.ActivePage.PageID;

            MenuTreeNode mn = new MenuTreeNode(General.GetString("PRODUCT_HOME", "Shop Home"));

            // change the link to stay on the same page and call a category product

            mn.Link  = HttpUrlBuilder.BuildUrl(tabIDShop);
            mn.Width = Width;
            Childs.Add(mn);
        }
Exemplo n.º 21
0
        public MachineBuilder UseMachine()
        {
            var existing = Childs.FirstOrDefault(x => x is MachineBuilder);

            if (null != existing)
            {
                return((MachineBuilder)existing);
            }

            var builder = new MachineBuilder(this);

            Childs.Add(builder);
            return(builder);
        }
Exemplo n.º 22
0
        public Person(ulong id, string name, Country country, int childLevel)
        {
            Id      = id;
            Name    = name;
            Country = country;

            if (childLevel < 3)
            {
                foreach (var i in Enumerable.Range(0, 10))
                {
                    Childs.Add(new Child(name + $"-child{childLevel}", childLevel + 1));
                }
            }
        }
Exemplo n.º 23
0
        public Rule With(IFileBuilder builder, Action <Rule> setChild = null)
        {
            var rule = new Rule(Runner, builder);

            Childs.Add(rule);
            Runner.AllRules.Add(rule);

            if (setChild != null)
            {
                setChild(rule);
            }

            return(this);
        }
Exemplo n.º 24
0
        public Node AddChild(char c)
        {
            Node childNode;

            if (Childs.ContainsKey(c))
            {
                childNode = Childs[c];
            }
            else
            {
                childNode = new Node(c);
                Childs.Add(c, childNode);
            }
            return(childNode);
        }
        /// <summary>
        /// Shops the desktop navigation.
        /// </summary>
        /// <param name="myTab">My tab.</param>
        private void ShopDesktopNavigation(PageStripDetails myTab)
        {
            if (PortalSecurity.IsInRoles(myTab.AuthorizedRoles))
            {
                MenuTreeNode mn = new MenuTreeNode(myTab.PageName);

                mn.Link =
                    HttpUrlBuilder.BuildUrl("~/" + HttpUrlBuilder.DefaultPage, myTab.ParentPageID,
                                            "ItemID=" + myTab.PageID.ToString());
                mn.Height = Height;
                mn.Width  = Width;
                mn        = RecourseMenuShop(0, myTab.Pages, mn, myTab.ParentPageID);
                Childs.Add(mn);
            }
        }
        /// <summary>
        /// constructor that takes a go and a parent node
        /// </summary>
        public Node(GameObject go, Node parent)
        {
            // assign parent
            Parent = parent;

            // assign game object
            GameObject = go;

            // get the original transforms
            P0 = go.transform.position;
            R0 = go.transform.rotation;
            S0 = go.transform.localScale;

            // check whether game object has a mesh
            HasMesh = go.GetComponent <MeshFilter>() != null;

            // get starting bounds
            if (HasMesh)
            {
                Bounds = go.GetComponent <Renderer>().bounds;
            }
            else
            {
                Bounds = new Bounds(go.transform.position, Vector3.zero);
            }

            // get original material
            if (HasMesh)
            {
                Material = go.GetComponent <Renderer>().material;
            }
            else
            {
                Material = null;
            }

            // add collider if doesn't exist
            if (HasMesh && go.GetComponent <Collider>() == null)
            {
                go.AddComponent <MeshCollider>();
            }

            // check childs
            foreach (Transform child in go.transform)
            {
                Childs.Add(new Node(child.gameObject, this));
            }
        }
Exemplo n.º 27
0
 // This constructor allows users to insert Sdml element, attributes and comments as part of one SdmlObject
 public SdmlBaseElement(params ISDMLObject[] elements)
 {
     foreach (var item in elements)
     {
         if (item.GetType().IsSubclassOf(typeof(SdmlBaseAttribute)))
         {
             ((ISDMLAttribute)item).Owner = this;
             Attributes.Add(((ISDMLAttribute)item));
         }
         else if (item.GetType().IsSubclassOf(typeof(SdmlBaseElement)))
         {
             ((ISDMLDataElement)item).Parent = this;
             Childs.Add((ISDMLDataElement)item);
         }
     }
 }
Exemplo n.º 28
0
        public async void GetChild()
        {
            try
            {
                Childs.Clear();
                var pagechild = await _businessPage.GetAllByIdParent(Fichier.ID);

                foreach (Page page in pagechild.OrderBy(x => x.Ordre))
                {
                    Childs.Add(new PageViewModel(page));
                }
            }
            catch (Exception ex)
            {
                //throw ex;
            }
        }
Exemplo n.º 29
0
 public void AddChild(Node child)
 {
     if (child.Level <= Level)
     {
         throw new InvalidOperationException(nameof(Node));
     }
     if (child is null)
     {
         throw new NullReferenceException(nameof(child));
     }
     if (Childs is null)
     {
         Childs = new List <Node>();
     }
     Childs.Add(child);
     child.Parent = this;
 }
Exemplo n.º 30
0
        public void ParseLogger(String[] loggerParts, Int32 level)
        {
            if (level == LoggerLevel)
            {
                LoggerCount++;
                return;
            }
            //do I have a child logger for this name?
            String name = loggerParts.Take(level + 1).Aggregate((s1, s2) => s1 + "." + s2);
            var    cvm  = Childs.SingleOrDefault(vm => vm.LoggerPrefix.Equals(name));

            if (cvm == null)
            {
                cvm = new LoggerViewModel(name);
                Childs.Add(cvm);
            }
            cvm.ParseLogger(loggerParts, level + 1);
        }