コード例 #1
0
        /// <summary>
        /// Create a FindInfo object initialized by the given parameters.
        /// </summary>
        /// <param name="parentFolder">List children of this folder.</param>
        /// <param name="inclFolders">Include child folders.</param>
        /// <param name="inclDocs">Include child documents.</param>
        /// <returns></returns>
        protected static FindInfo makeFindInfo(FWFolder parentFolder, bool inclFolders, bool inclDocs)
        {
            FindInfo     fi = new FindInfo();
            FindChildren fc = new FindChildren();

            fc.parentId     = Convert.ToString(parentFolder.Id);
            fi.findChildren = fc;

            if (inclFolders && inclDocs)
            {
                // do not need to constrain
            }
            else //(inclFolders || inclDocs)
            {
                FindByType ft = new FindByType();
                ft.typeStructures = inclFolders;
                ft.typeDocuments  = inclDocs;
                fi.findByType     = ft;
            }

            //FindOptions fo = new FindOptions();
            //fo.sortOrder = SortOrderC.NONE;
            //fi.findOptions = fo;

            return(fi);
        }
コード例 #2
0
        public static List <Sord> FindChildren(String objId, IXConnection ixConn, bool references)
        {
            Console.WriteLine("FindChildren: objId " + objId, " ixConn " + ixConn);
            try
            {
                ixConn.Ix.checkoutSord(objId, SordC.mbAll, LockC.NO);
            }
            catch (Exception)
            {
                return(new List <Sord>());
            }

            List <Sord>  children          = new List <Sord>();
            FindInfo     findInfo          = new FindInfo();
            FindChildren findChildren      = new FindChildren();
            FindByType   findByType        = new FindByType();
            FindByIndex  findByIndex       = new FindByIndex();
            Boolean      includeReferences = references;
            SordZ        sordZ             = SordC.mbAll;
            Boolean      recursive         = true;
            int          level             = 3;

            ObjKey[] objKeys = new ObjKey[] { };
            findChildren.parentId   = objId;
            findChildren.mainParent = !includeReferences;
            findChildren.endLevel   = (recursive) ? level : 1;
            findInfo.findChildren   = findChildren;
            findInfo.findByIndex    = findByIndex;

            FindResult findResult = new FindResult();

            try
            {
                int idx = 0;
                findResult = ixConn.Ix.findFirstSords(findInfo, 1000, sordZ);
                while (true)
                {
                    for (int i = 0; i < findResult.sords.Length; i++)
                    {
                        children.Add(findResult.sords[i]);
                    }
                    if (!findResult.moreResults)
                    {
                        break;
                    }
                    idx       += findResult.sords.Length;
                    findResult = ixConn.Ix.findNextSords(findResult.searchId, idx, 1000, sordZ);
                }
            }
            finally
            {
                if (findResult != null)
                {
                    ixConn.Ix.findClose(findResult.searchId);
                }
            }
            return(children);
        }
コード例 #3
0
    void Start()
    {
        instance                   = this;
        this.Panel                 = GameObject.Find("UI Root (2D)").transform.Search("Suit_Upgrade_Panel").gameObject;
        this.methoddata            = InventoryPanelScript.instance.GetType().GetMethod("RepositionInventory", BindingFlags.NonPublic | BindingFlags.Instance);
        this.Suit_Slot_Colliders   = new GameObject[4, 4];
        this.Suit_Slots_Blocks     = new UISprite[4, 4];
        this.Suit_Slots_Highlights = new UISprite[4, 4];
        GameObject gameObject = FindChildren.FindChild(this.Panel, "Suit_Slot1_Collider");

        gameObject.AddComponent <SuitPanelIconScript>();
        UISprite component  = FindChildren.FindChild(this.Panel, "Suit_Slot1_Block").GetComponent <UISprite>();
        UISprite component2 = FindChildren.FindChild(this.Panel, "Suit_Slot1_Highlight").GetComponent <UISprite>();

        UILabel component3 = FindChildren.FindChild(this.Panel, "Suit_Power_Label").GetComponent <UILabel>();
        UILabel component6 = FindChildren.FindChild(this.Panel, "Suit_Radius_Label").GetComponent <UILabel>();

        component6.gameObject.SetActive(false);
        this.SuitPowerLabel = component3;

        this.Suit_Slot_Colliders[0, 0]   = gameObject;
        this.Suit_Slots_Blocks[0, 0]     = component;
        this.Suit_Slots_Highlights[0, 0] = component2;
        for (int i = 0; i < 4; i++)
        {
            for (int j = 0; j < 4; j++)
            {
                if (i != 0 || j != 0)
                {
                    int        num         = 1 + i + j * 10;
                    Vector3    b           = new Vector3((float)(82 * i), (float)(-79 * j), 0f);
                    GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate(gameObject, gameObject.transform.position + b, gameObject.transform.rotation);
                    gameObject2.transform.parent        = gameObject.transform.parent;
                    gameObject2.transform.localScale    = gameObject.transform.localScale;
                    gameObject2.transform.localPosition = gameObject.transform.localPosition + b;
                    gameObject2.name = string.Format("Suit_Slot{0}_Collider", num);
                    gameObject2.AddComponent <SuitPanelIconScript>();
                    this.Suit_Slot_Colliders[i, j] = gameObject2;
                    UISprite component4 = ((GameObject)UnityEngine.Object.Instantiate(component.gameObject, component.transform.position + b, component.transform.rotation)).GetComponent <UISprite>();
                    component4.transform.parent        = component.transform.parent;
                    component4.transform.localScale    = component.transform.localScale;
                    component4.transform.localPosition = component.transform.localPosition + b;
                    component4.name = string.Format("Suit_Slot{0}_Block", num);
                    this.Suit_Slots_Blocks[i, j] = component4;
                    UISprite component5 = ((GameObject)UnityEngine.Object.Instantiate(component2.gameObject, component2.transform.position + b, component2.transform.rotation)).GetComponent <UISprite>();
                    component5.transform.parent        = component2.transform.parent;
                    component5.transform.localScale    = component2.transform.localScale;
                    component5.transform.localPosition = component2.transform.localPosition + b;
                    component5.name = string.Format("Suit_Slot{0}_Highlight", num);
                    this.Suit_Slots_Highlights[i, j] = component5;
                }
            }
        }
        this.mStartPos = base.gameObject.transform.localPosition;
        this.Panel.gameObject.SetActive(false);
    }