コード例 #1
0
        static public bool RepackageAssetInWorkspaces(MOG_Filename assetFilename, BackgroundWorker worker)
        {
            bool bFailed = false;

            // Walk through all of our workspaces
            foreach (MOG_ControllerSyncData workspace in mWorkspaces.Values)
            {
                // Check if this is the current workspace?  or
                // Check if this workspace is active?
                if (workspace == MOG_ControllerProject.GetCurrentSyncDataController() ||
                    workspace.IsAlwaysActive())
                {
                    // Proceed to add the asset to this workspace
                    MOG_Filename workspaceAsset = MOG_Filename.GetLocalUpdatedTrayFilename(workspace.GetSyncDirectory(), assetFilename);
                    if (!workspace.RepackageAssetInLocalWorkspace(workspaceAsset))
                    {
                        bFailed = true;
                    }
                }
            }

            if (!bFailed)
            {
                return(true);
            }
            return(false);
        }
コード例 #2
0
        public static void MarkLocalAssetBlessed(MOG_Filename assetFilename, string blessedTimestamp)
        {
            // Walk through all of our workspaces
            foreach (MOG_ControllerSyncData workspace in mWorkspaces.Values)
            {
                // Check if this is the current workspace?  or
                // Check if this workspace is active?
                if (workspace == MOG_ControllerProject.GetCurrentSyncDataController() ||
                    workspace.IsAlwaysActive())
                {
                    // Build the expected path to this asset in our local workspace
                    MOG_Filename workspaceAsset = MOG_Filename.GetLocalUpdatedTrayFilename(workspace.GetSyncDirectory(), assetFilename);
                    // Open the local asset
                    MOG_ControllerAsset localAsset = MOG_ControllerAsset.OpenAsset(workspaceAsset);
                    if (localAsset != null)
                    {
                        // Stamp this locally update asset with the newly blessed revision timestamp
                        localAsset.GetProperties().BlessedTime = blessedTimestamp;

                        // Change the state of this asset to blessed
                        MOG_ControllerInbox.UpdateInboxView(localAsset, MOG_AssetStatusType.Blessed);
                        localAsset.Close();
                    }
                }
            }
        }
コード例 #3
0
        static public bool RemoveAssetFromWorkspaces(MOG_Filename assetFilename, bool bRespectAutoUpdate, BackgroundWorker worker)
        {
            bool bFailed = false;

            // Walk through all of our workspaces
            foreach (MOG_ControllerSyncData workspace in mWorkspaces.Values)
            {
                // Check if this is the current workspace?  or
                // Check if this workspace is active?
                if (workspace == MOG_ControllerProject.GetCurrentSyncDataController() ||
                    workspace.IsAlwaysActive())
                {
                    // Check if we have been instructed to respect the auto update flag?
                    if (bRespectAutoUpdate)
                    {
                        // Check if this workspace has the auto update enabled?
                        if (!workspace.IsAutoUpdateEnabled())
                        {
                            // Skip this workspace as it doesn't have the auto update enabled
                            continue;
                        }
                    }

                    // Proceed to add the asset to this workspace
                    MOG_Filename workspaceAsset = MOG_Filename.GetLocalUpdatedTrayFilename(workspace.GetSyncDirectory(), assetFilename);
                    if (!workspace.RemoveAssetFromLocalWorkspace(workspaceAsset, worker))
                    {
                        bFailed = true;
                    }
                }
            }

            if (!bFailed)
            {
                return(true);
            }
            return(false);
        }