Example #1
0
        private void DoOpen(AssetList assets, bool alreadyOpen)
        {
            if (alreadyOpen)
            {
                foreach (var asset in assets)
                {
                    bool found = false;
                    int  count = assetList.Count;

                    for (int i = 0; i < count; i++)
                    {
                        if (assetList[i].path == asset.path)
                        {
                            found        = true;
                            assetList[i] = asset;
                            break;
                        }
                    }

                    if (!found)
                    {
                        assetList.Add(asset);
                    }
                }
            }
            else
            {
                assetList.AddRange(assets);
            }

            RefreshList();
        }
Example #2
0
        static internal AssetList ConsolidateAssetList(AssetList assets, CheckoutMode mode)
        {
            var consolidatedAssetArray = Internal_ConsolidateAssetList(assets.ToArray(), mode);
            var consolidatedAssetList  = new AssetList();

            consolidatedAssetList.AddRange(consolidatedAssetArray);
            return(consolidatedAssetList);
        }
Example #3
0
        /// <summary>
        /// <para>Create an optimised list of assets by removing children of folders in the same list.</para>
        /// </summary>
        public AssetList FilterChildren()
        {
            AssetList list = new AssetList();

            list.AddRange(this);
            using (List <Asset> .Enumerator enumerator = base.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
Example #4
0
        public AssetList FilterChildren()
        {
            AssetList assetList = new AssetList();

            assetList.AddRange(this);
            foreach (Asset asset in this)
            {
                assetList.RemoveAll((Asset p) => p.IsChildOf(asset));
            }
            return(assetList);
        }
Example #5
0
        // Create an optimised list of assets by removing children of folders in the same list
        public AssetList FilterChildren()
        {
            AssetList unique = new AssetList();

            unique.AddRange(this);

            foreach (Asset asset in this)
            {
                unique.RemoveAll(p => p.IsChildOf(asset));
            }

            return(unique);
        }
Example #6
0
        public AssetList FilterChildren()
        {
            AssetList assetList = new AssetList();

            assetList.AddRange(this);
            using (List <Asset> .Enumerator enumerator = base.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Asset asset = enumerator.Current;
                    assetList.RemoveAll((Asset p) => p.IsChildOf(asset));
                }
            }
            return(assetList);
        }
Example #7
0
        internal static bool HandlePreCheckoutCallback(ref string[] paths, ref ChangeSet changeSet)
        {
            if (preCheckoutCallback == null)
            {
                return(true);
            }

            var assetList = new AssetList();

            assetList.AddRange(paths.Select(GetAssetByPath).Where(a => a != null));

            try
            {
                var    id   = changeSet == null ? ChangeSet.defaultID : changeSet.id;
                string desc = null;
                if (preCheckoutCallback(assetList, ref id, ref desc))
                {
                    var task = CheckAndCreateUserSuppliedChangeSet(id, desc, ref changeSet);
                    if (task != null)
                    {
                        Debug.LogError(
                            "Tried to create/rename remote ChangeSet to match the one specified in user-supplied callback but failed with error code: " +
                            task.resultCode);
                        return(false);
                    }

                    paths = assetList.Where(a => a != null).Select(a => a.path).ToArray();
                }
                else
                {
                    Debug.LogWarning("User-created pre-checkout callback has blocked this checkout.");
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                Debug.LogWarning("User-created pre-checkout callback has thrown an exception: " + ex.Message);
                return(false);
            }

            return(true);
        }
Example #8
0
        /// <summary>
        ///   <para>Create an optimised list of assets by removing children of folders in the same list.</para>
        /// </summary>
        public AssetList FilterChildren()
        {
            AssetList assetList = new AssetList();

            assetList.AddRange((IEnumerable <Asset>) this);
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            AssetList.\u003CFilterChildren\u003Ec__AnonStoreyC0 childrenCAnonStoreyC0 = new AssetList.\u003CFilterChildren\u003Ec__AnonStoreyC0();
            using (List <Asset> .Enumerator enumerator = this.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    // ISSUE: reference to a compiler-generated field
                    childrenCAnonStoreyC0.asset = enumerator.Current;
                    // ISSUE: reference to a compiler-generated method
                    assetList.RemoveAll(new Predicate <Asset>(childrenCAnonStoreyC0.\u003C\u003Em__22F));
                }
            }
            return(assetList);
        }
Example #9
0
        public AssetList FilterChildren()
        {
            AssetList list = new AssetList();

            list.AddRange(this);