Ejemplo n.º 1
0
        internal static void DownloadRepository(string unityAccessToken, string[] commandLineArgs)
        {
            Dictionary <string, string> args = CommandLineArguments.Build(commandLineArgs);

            mLog.DebugFormat(
                "Processing Unity arguments: {0}", string.Join(" ", commandLineArgs));

            string projectPath       = ParseArguments.ProjectPath(args);
            string cloudRepository   = ParseArguments.CloudProject(args);
            string cloudOrganization = ParseArguments.CloudOrganization(args);

            if (string.IsNullOrEmpty(projectPath) ||
                string.IsNullOrEmpty(cloudRepository) ||
                string.IsNullOrEmpty(cloudOrganization))
            {
                return;
            }

            SessionState.SetBool(
                SHOULD_PROJECT_BE_DOWNLOADED_KEY, true);

            PlasticApp.InitializeIfNeeded();

            DownloadRepositoryOperation downloadOperation =
                new DownloadRepositoryOperation();

            downloadOperation.DownloadRepositoryToPathIfNeeded(
                cloudRepository,
                cloudOrganization,
                Path.GetFullPath(projectPath),
                unityAccessToken);
        }
Ejemplo n.º 2
0
        static void Execute()
        {
            Dictionary <string, string> args = CommandLineArguments.Build(
                Environment.GetCommandLineArgs());

            mLog.DebugFormat(
                "Processing Unity arguments: {0}",
                string.Join(" ", Environment.GetCommandLineArgs()));

            string projectPath       = ParseArguments.ProjectPath(args);
            string cloudRepository   = ParseArguments.CloudProject(args);
            string cloudOrganization = ParseArguments.CloudOrganization(args);

            if (string.IsNullOrEmpty(projectPath) ||
                string.IsNullOrEmpty(cloudRepository) ||
                string.IsNullOrEmpty(cloudOrganization))
            {
                return;
            }

            PlasticApp.Initialize();

            DownloadRepositoryOperation downloadOperation = new DownloadRepositoryOperation();

            downloadOperation.DownloadRepositoryToPathIfNeeded(
                cloudRepository,
                cloudOrganization,
                Path.GetFullPath(projectPath));
        }
        // Adds about 500ms to startup time
        static AssetMenuItems()
        {
            PlasticApp.InitializeIfNeeded();
            sPlasticAPI = new PlasticAPI();

            Enable();
        }
Ejemplo n.º 4
0
        static void Execute(string unityAccessToken)
        {
            if (SessionState.GetInt(
                    IS_USER_BETA_PROGRAM_ALREADY_CALCULATED_KEY,
                    BETA_PROGRAM_NOT_CALCULATED) == BETA_PROGRAM_ENABLED)
            {
                PlasticMenuItem.Add();
                return;
            }

            PlasticApp.InitializeIfNeeded();

            EnableUserBetaProgramIfNeeded(unityAccessToken);
        }
        static void Execute(string unityAccessToken)
        {
            if (SessionState.GetBool(
                    IS_USER_BETA_PROGRAM_ALREADY_CALCULATED_KEY, false))
            {
                return;
            }

            SessionState.SetBool(
                IS_USER_BETA_PROGRAM_ALREADY_CALCULATED_KEY, true);

            PlasticApp.InitializeIfNeeded();

            EnableUserBetaProgramIfNeeded(unityAccessToken);
        }
Ejemplo n.º 6
0
        static void Execute(
            string unityAccessToken,
            string projectPath,
            string projectGuid)
        {
            string headCommitSha = GetCollabHeadCommitSha(projectPath, projectGuid);

            if (string.IsNullOrEmpty(headCommitSha))
                return;

            PlasticApp.InitializeIfNeeded();

            LaunchMigrationIfProjectIsArchivedAndMigrated(
                unityAccessToken,
                projectPath,
                projectGuid,
                headCommitSha);
        }
Ejemplo n.º 7
0
 static void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     PlasticApp.InitializeIfNeeded();
 }
Ejemplo n.º 8
0
 static void DelayedInitialization()
 {
     PlasticApp.InitializeIfNeeded();
     Enable();
 }
Ejemplo n.º 9
0
 static void BackgroundWorker_CompletedWork(object sender, RunWorkerCompletedEventArgs e)
 {
     PlasticApp.RegisterClientHandlersIfNeeded();
     Enable();
 }