Example #1
0
        static void OnProjectWindowItemGUI(string guid, Rect selectionRect)
        {
            if (string.IsNullOrEmpty(guid))
            {
                return;
            }

            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            AssetStatus assetStatus = mAssetStatusCache.GetStatusForGuid(guid);

            LockStatusData lockStatusData =
                ClassifyAssetStatus.IsLockedRemote(assetStatus) ?
                mAssetStatusCache.GetLockStatusData(guid) :
                null;

            string tooltipText = GetTooltipText(
                assetStatus,
                lockStatusData);

            DrawOverlayIcon.ForStatus(
                selectionRect,
                assetStatus,
                tooltipText);
        }
 public void Recycle(AssetStatus status)
 {
     if (status.Object.AsGameObject != null)
     {
         status.Object.AsGameObject.transform.SetParent(null, false);
     }
 }
        public void Init(IEntity entity, AssetStatus status)
        {
            var playerEntity = entity as PlayerEntity;
            var hitboxConfig = status.Object.AsGameObject;

            HitBoxComponentUtility.InitHitBoxComponent(playerEntity.entityKey.Value, playerEntity, hitboxConfig);
        }
Example #4
0
        public InventaryViewModel(string inventary)
        {
            Title = inventary;

            AssetStatus broken = new AssetStatus {
                Lookup = "CAS", Label = "Broken"
            };
            AssetStatus moved = new AssetStatus {
                Lookup = "DEM", Label = "Being moved"
            };
            Site strasbourg = new Site {
                City = "Strasbourg"
            };
            Site bruxelles = new Site {
                City = "Bruxelles"
            };

            Items = new ObservableCollection <Asset>
            {
                new Asset {
                    AssetId = Guid.NewGuid().ToString(), Name = "PHS 04C065", AssetStatus = broken, Site = bruxelles
                },
                new Asset {
                    AssetId = Guid.NewGuid().ToString(), Name = "WIC M01047", AssetStatus = moved, Site = strasbourg
                },
            };
        }
Example #5
0
            internal static Texture GetOverlayIcon(AssetStatus status)
            {
                switch (status)
                {
                case AssetStatus.Ignored:
                    return(Images.GetIgnoredOverlayIcon());

                case AssetStatus.Private:
                    return(Images.GetPrivatedOverlayIcon());

                case AssetStatus.Added:
                    return(Images.GetAddedOverlayIcon());

                case AssetStatus.Checkout:
                    return(Images.GetCheckedOutOverlayIcon());

                case AssetStatus.OutOfDate:
                    return(Images.GetOutOfSyncOverlayIcon());

                case AssetStatus.Conflicted:
                    return(Images.GetConflictedOverlayIcon());

                case AssetStatus.DeletedOnServer:
                    return(Images.GetDeletedRemoteOverlayIcon());

                case AssetStatus.Locked:
                    return(Images.GetLockedLocalOverlayIcon());

                case AssetStatus.LockedRemote:
                    return(Images.GetLockedRemoteOverlayIcon());
                }

                return(null);
            }
Example #6
0
        /// <summary>
        /// Adds an asset to the database
        /// </summary>
        /// <param name="name">The name of the asset</param>
        /// <param name="creator">The ID of the creator</param>
        /// <param name="status">The current status of the asset</param>
        /// <param name="tag">Tag for the asset</param>
        /// <param name="software">The software used to create the asset</param>
        /// <param name="notes">The notes of the asset</param>
        public void AddAsset(string name, int creator, AssetStatus status, AssetType tag, string software, string notes = "1.0")
        {
            string commandText = "INSERT INTO Asset ( Assetname, Creator, Notes, Status, Tag, Software ) VALUES " +
                                 "('" + name + "'," + creator + ",'" + notes + "','" + status + "','" + tag + "', '" + software + "')";

            ExecuteCommand(commandText);
        }
Example #7
0
        internal IEnumerator DownLoad()
        {
            mStatus = AssetStatus.Status_Loading;
            if (mCurWWW != null)
            {
                UnLoad(false);
                mCurWWW = null;
            }
            mCurWWW = new WWW(mAssetUrl);
            mCurWWW.threadPriority = mThreadPriority;

            yield return(mCurWWW);

            OnDonwloaded();
            mIsDone = true;

            if (!string.IsNullOrEmpty(error))
            {
                mResult = AssetResult.Result_Error;
            }
            else
            {
                mResult = AssetResult.Result_Succeed;
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,AssetStatusName")] AssetStatus assetStatus)
        {
            if (id != assetStatus.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(assetStatus);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AssetStatusExists(assetStatus.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(assetStatus));
        }
Example #9
0
        static bool IsOpenForEdit(string assetPath, out string message)
        {
            message = string.Empty;

            if (!IsEnabled)
            {
                return(true);
            }

            if (assetPath.StartsWith("ProjectSettings/"))
            {
                return(true);
            }

            if (ForceCheckout)
            {
                return(true);
            }

            if (MetaPath.IsMetaPath(assetPath))
            {
                assetPath = MetaPath.GetPathFromMetaPath(assetPath);
            }

            AssetStatus status = mAssetStatusCache.GetStatusForPath(
                Path.GetFullPath(assetPath));

            if (ClassifyAssetStatus.IsAdded(status) ||
                ClassifyAssetStatus.IsCheckedOut(status))
            {
                return(true);
            }

            return(!ClassifyAssetStatus.IsControlled(status));
        }
 protected void PushToOldResource(AssetStatus old, ICommonResourceActions action)
 {
     if (old != null)
     {
         _oldResource.Enqueue(RemoveAssetStatus.Allocate(old, action));
     }
 }
        internal static Data ForAssetStatus(AssetStatus status)
        {
            switch (status)
            {
            case AssetStatus.Ignored:
                return(BuildData.ForIgnored());

            case AssetStatus.Private:
                return(BuildData.ForPrivated());

            case AssetStatus.Added:
                return(BuildData.ForAdded());

            case AssetStatus.Checkout:
                return(BuildData.ForCheckedOut());

            case AssetStatus.OutOfDate:
                return(BuildData.ForOutOfDate());

            case AssetStatus.Conflicted:
                return(BuildData.ForConflicted());

            case AssetStatus.DeletedOnServer:
                return(BuildData.ForDeletedOnServer());

            case AssetStatus.Locked:
                return(BuildData.ForLocked());

            case AssetStatus.LockedRemote:
                return(BuildData.ForLockedRemote());
            }

            return(null);
        }
Example #12
0
        static AssetStatus CalculateStatus(
            string fullPath,
            string wkPath,
            IgnoredFilesFilter ignoredFilter)
        {
            if (!IsOnWorkspace(fullPath, wkPath))
            {
                return(AssetStatus.None);
            }

            WorkspaceTreeNode treeNode = Plastic.API.GetWorkspaceTreeNode(fullPath);

            if (CheckWorkspaceTreeNodeStatus.IsPrivate(treeNode))
            {
                return(ignoredFilter.IsIgnored(fullPath) ?
                       AssetStatus.Ignored : AssetStatus.Private);
            }

            if (CheckWorkspaceTreeNodeStatus.IsAdded(treeNode))
            {
                return(AssetStatus.Added);
            }

            AssetStatus result = AssetStatus.Controlled;

            if (CheckWorkspaceTreeNodeStatus.IsCheckedOut(treeNode) &&
                !CheckWorkspaceTreeNodeStatus.IsDirectory(treeNode))
            {
                result |= AssetStatus.Checkout;
            }

            return(result);
        }
Example #13
0
        public ActionResult DeleteConfirmed(int id)
        {
            AssetStatus assetstatus = db.AssetStatuses.Find(id);

            db.AssetStatuses.Remove(assetstatus);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #14
0
        public static RemoveAssetStatus Allocate(AssetStatus status, ICommonResourceActions actions)
        {
            var ret = ObjectAllocatorHolder <RemoveAssetStatus> .Allocate();

            ret.Actions = actions;
            ret.Status  = status;
            return(ret);
        }
Example #15
0
 /// <summary>
 /// Convert an AssetStatus to a StatusLabel by its Id.
 /// </summary>
 /// <param name="status">The AssetStatus to convert.</param>
 /// <returns>The StatusLabel corresponding to the provided AssetStatus.</returns>
 /// <exception cref="SnipeSharp.Exceptions.ApiErrorException">If there was an error accessing the API, or the status label does not exist.</exception>
 /// <exception cref="System.ArgumentNullException">If <paramref name="status"/> is null.</exception>
 public StatusLabel FromAssetStatus(AssetStatus status)
 {
     if (null == status)
     {
         throw new ArgumentNullException(paramName: nameof(status));
     }
     return(Get(status.StatusId));
 }
Example #16
0
 // Called when asset status changed.
 public void onDepositStatusChanged(FloatingAsset sender, AssetStatus status, long param)
 {
     if (status == AssetStatus.CANCELING)
     {
         deposits.remove(sender);
         recalcTotalAssets();
     }
 }
            AssetStatus IAssetStatusCache.GetStatusForPath(string fullPath)
            {
                AssetStatus status = AssetStatus.None;

                mData.TryGetValue(fullPath, out status);

                return(status);
            }
Example #18
0
        internal static string GetStatusString(AssetStatus assetStatus)
        {
            if (ClassifyAssetStatus.IsPrivate(assetStatus))
            {
                return(PlasticLocalization.GetString(
                           PlasticLocalization.Name.Private));
            }

            if (ClassifyAssetStatus.IsIgnored(assetStatus))
            {
                return(PlasticLocalization.GetString(
                           PlasticLocalization.Name.StatusIgnored));
            }

            if (ClassifyAssetStatus.IsAdded(assetStatus))
            {
                return(PlasticLocalization.GetString(
                           PlasticLocalization.Name.StatusAdded));
            }

            if (ClassifyAssetStatus.IsConflicted(assetStatus))
            {
                return(PlasticLocalization.GetString(
                           PlasticLocalization.Name.StatusConflicted));
            }

            if (ClassifyAssetStatus.IsDeletedOnServer(assetStatus))
            {
                return(PlasticLocalization.GetString(
                           PlasticLocalization.Name.StatusDeletedOnServer));
            }

            if (ClassifyAssetStatus.IsLockedRemote(assetStatus))
            {
                return(PlasticLocalization.GetString(
                           PlasticLocalization.Name.StatusLockedRemote));
            }

            if (ClassifyAssetStatus.IsOutOfDate(assetStatus))
            {
                return(PlasticLocalization.GetString(
                           PlasticLocalization.Name.StatusOutOfDate));
            }

            if (ClassifyAssetStatus.IsLocked(assetStatus))
            {
                return(PlasticLocalization.GetString(
                           PlasticLocalization.Name.StatusLockedMe));
            }

            if (ClassifyAssetStatus.IsCheckedOut(assetStatus))
            {
                return(PlasticLocalization.GetString(
                           PlasticLocalization.Name.StatusCheckout));
            }

            return(string.Empty);
        }
Example #19
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            AssetStatus assetStatus = await db.AssetStatuses.FindAsync(id);

            db.AssetStatuses.Remove(assetStatus);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public void OnLoadFailed(IEntity entity, AssetStatus status)
        {
            var player = entity as PlayerEntity;

            if (player != null)
            {
                Logger.InfoFormat("P1 LoadFailed: {0}", player.entityKey);
            }
        }
 public static void Initialize(TestContext context)
 {
     _typeOfString = typeof(string).AssemblyQualifiedName;
     _typeOfInt = typeof(int).AssemblyQualifiedName;
     _typeOfAssetEditable = new AssetEditable().GetType().AssemblyQualifiedName;
     _typeOfAssetStatus = new AssetStatus().GetType().AssemblyQualifiedName;
     _typeOfBool = typeof(bool).AssemblyQualifiedName;
     _typeOfAssetType = new AssetType().GetType().AssemblyQualifiedName;
 }
Example #22
0
 internal LockStatusData(
     AssetStatus status,
     string lockedBy,
     string workspaceName)
 {
     Status        = status;
     LockedBy      = lockedBy;
     WorkspaceName = workspaceName;
 }
Example #23
0
 public void OnDonwloadFinish()
 {
     m_isDone       = true;
     m_bAllowDelete = true;
     if (AssetBundle != null)
     {
         m_status = AssetStatus.Status_Loaded;
         AssetFactory.Instance.ChangeAssetState(this, true);
     }
 }
Example #24
0
        protected override void OnCleanUp()
        {
            if (Status != null)
            {
                Status.ReleaseReference();
            }

            Status  = null;
            Actions = null;
        }
Example #25
0
 public ActionResult Edit(AssetStatus assetstatus)
 {
     if (ModelState.IsValid)
     {
         db.Entry(assetstatus).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(assetstatus));
 }
Example #26
0
        public ActionResult Delete(int id = 0)
        {
            AssetStatus assetstatus = db.AssetStatuses.Find(id);

            if (assetstatus == null)
            {
                return(HttpNotFound());
            }
            return(View(assetstatus));
        }
Example #27
0
        private static void OnProjectItemGUI(string guid, Rect selectionRect)
        {
            if (SettingsUpdater.ShowIcon == false)
            {
                return;
            }

            string assetPath = AssetDatabase.GUIDToAssetPath(guid);

            if (string.IsNullOrEmpty(assetPath))
            {
                return;
            }

            AssetStatus type = SVNFileStatusCache.GetStatus(assetPath);

            Texture icon = null;

            switch (type)
            {
            case AssetStatus.None:
                icon = committedTexture;
                break;

            case AssetStatus.Added:
                icon = addedTexture;
                break;

            case AssetStatus.Modify:
                icon = modifiedTexture;
                break;

            case AssetStatus.Delete:
                break;

            case AssetStatus.New:
                icon = newTexture;
                break;

            case AssetStatus.Conflict:
                icon = conflictedTexture;
                break;

            case AssetStatus.External:
                icon = externalTexture;
                break;
            }

            if (icon == null)
            {
                return;
            }

            GUI.DrawTexture(new Rect(selectionRect.xMin - 8, selectionRect.yMin - 2, 16, 16), icon);
        }
 public DatabaseAsset(int id, string assetname, string notes, DatabaseUser creator, AssetType type, AssetStatus status, string software, int pegiRating = 3)
 {
     ID           = id;
     Assetname    = assetname;
     Notes        = notes;
     this.creator = creator;
     Type         = type;
     Status       = status;
     PegiRating   = pegiRating;
     Software     = software;
 }
Example #29
0
        private void OnDonwloaded()
        {
            mbAllowDelete = true;
            //对Assetbundle做一次引用
            if (assetBundle != null)
            {
            }

            mStatus = AssetStatus.Status_Loaded;
            AssetManager.Instance.ChangeAssetState(this, true);
        }
 private static void SetStatus(string path, AssetStatus status)
 {
     if (statusCache.ContainsKey(path))
     {
         statusCache[path] = status;
     }
     else
     {
         statusCache.Add(path, status);
     }
 }
        public async Task <IActionResult> Create([Bind("Id,AssetStatusName")] AssetStatus assetStatus)
        {
            if (ModelState.IsValid)
            {
                _context.Add(assetStatus);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(assetStatus));
        }
Example #32
0
        /// <summary>
        /// Initialize 
        /// Initialize the Manifest Cache parameters 
        /// </summary>
        private void Initialize()
        {
            DownloadToGo = false;
            ManifestUri = null;
            RedirectUri = null;
            StoragePath = string.Empty;
            MinBitrate = 0;
            MaxBitrate = 0;
            MaxError = 20;
            DownloadMethod = 1;
            MaxMemoryBufferSize = 256000;
            VideoChunkList = new List<ChunkCache>();
            AudioChunkList = new List<ChunkCache>();
            AudioDownloadedBytes = 0;
            AudioDownloadedChunks = 0;
            AudioSavedBytes = 0;
            VideoDownloadedBytes = 0;
            VideoDownloadedChunks = 0;
            VideoSavedBytes = 0;
            AudioTemplateUrl = string.Empty;
            VideoTemplateUrl = string.Empty;

            BaseUrl = string.Empty;
            RedirectBaseUrl = string.Empty;

            ListAudioTracks = new List<AudioTrack>();
            ListVideoTracks = new List<VideoTrack>();
            SelectVideoTrackIndex = -1;
            SelectAudioTrackIndex = -1;
            SelectedVideoTrackIndex = -1;
            SelectedAudioTrackIndex = -1;

            DownloadedPercentage = 0;
            VideoTemplateUrlType = videoString;
            AudioTemplateUrlType = audioString;
            IsPlayReadyLicenseAcquired = false;
            mStatus = AssetStatus.Initialized;

        }
Example #33
0
 /// <summary>
 /// RestoreStatus
 /// Restore the manifest status based on the chunks downloaded or saved on disk
 /// </summary>
 /// <param name=""></param>
 /// <returns>true if success</returns>
 public bool RestoreStatus()
 {
     mStatus = AssetStatus.Initialized;
     if((this.VideoBitrate>0)&&
         (this.AudioBitrate > 0))
         mStatus = AssetStatus.ManifestDownloaded;
     if ((this.VideoSavedChunks > 0) ||
         (this.AudioSavedChunks > 0))
         mStatus = AssetStatus.DownloadingChunks;
     if ((this.VideoSavedChunks == this.VideoChunks) &&
         (this.AudioSavedChunks == this.AudioChunks))
         mStatus = AssetStatus.ChunksDownloaded;            
     return true;
 }
Example #34
0
        /// <summary>
        /// This method is invoked when the status of an asset in the MediaCache has changed.
        /// Parameter: The status of the asset: 
        /// - Initialized
        /// - DownloadingManifest
        /// - ManifestDownloaded
        /// - DownloadingChunks
        /// - AssetPlayable (for Progressive Download only - Not applicable for DownloadToGo)
        /// - ChunksDownloaded
        /// - Errorxxxxx
        /// </summary>
        private async void Cache_StatusProgress(MediaCache sender, Uri manifestUri, AssetStatus assetStatus)
        {
            LogMessage("Download status: " + assetStatus.ToString() + " for manifest: " + manifestUri.ToString());
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
                async () =>
                {
                    if (assetStatus == AssetStatus.ChunksDownloaded)
                    {
                        // if the asset is fully downloaded and the asset is protected with PlayReady, the PlayReady License can be acquired.
                        // The PlayReady License is automatically acquired by the MediaCache after calling mediaCache.StartDownload
                        // The step below is normally not required for persistent license
                        if (mediaCache.IsAssetProtected(manifestUri))
                        {
                            LogMessage("As the downloaded content is protected License Acquisition required, LicenseUrl: " + (!string.IsNullOrEmpty(PlayReadyLicenseUrl) ? PlayReadyLicenseUrl : "null") + " CustomData: " + PlayReadyChallengeCustomData);
                            bool result = await mediaCache.GetPlayReadyLicense(manifestUri, (!string.IsNullOrEmpty(PlayReadyLicenseUrl) ? new Uri(PlayReadyLicenseUrl) : null), PlayReadyChallengeCustomData);
                            if (result == true)
                                LogMessage("Acquisition License successful");
                            else
                                LogMessage("Acquisition License failed");
                        }
                    }
                    UpdateControls();
                });

        }
Example #35
0
 private void ManifestCache_StatusProgress(object sender, AssetStatus e)
 {
     if (StatusProgressEvent != null)
     {
         ManifestCache mc = sender as ManifestCache;
         if (mc != null)
         {
             StatusProgressEvent(this, mc.ManifestUri,e);
         }
     }
 }