예제 #1
0
        private static void Main(string[] args)
        {
            var info = AppsScriptSourceCodeManager.Initialize(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName).Result;

            Console.WriteLine(info.MyResult);

            if (info.IsSuccess)
            {
                try
                {
                    Console.WriteLine("Please wait... Creating a new Google App Script Project!");
                    AppsScriptSourceCodeManager.CreateNewGASProject("Library Test Demo").Wait();
                }
                catch (AppsScriptSourceCodeManager.InfoException ex)
                {
                    Console.WriteLine(ex);
                }

                Console.ReadLine();

                foreach (var str in AppsScriptSourceCodeManager.GetScriptInfo())
                {
                    Console.WriteLine(str);
                }
            }
            Console.Read();
        }
예제 #2
0
 public static void DisplayInfo()
 {
     try
     {
         foreach (string str in AppsScriptSourceCodeManager.GetScriptInfo())
         {
             PrintCentered(str);
         }
     }
     catch (Exception ex) { Debug.WriteLine(ex); }
 }
예제 #3
0
 public static void ClearCredentials()
 {
     try
     {
         var res = AppsScriptSourceCodeManager.ClearCredentials().Result;
         printTaskResult(res.ToString(), res.IsSuccess);
     }
     catch (Exception ex)
     {
         PrintErrorCentered(ex.Message);
     }
 }
예제 #4
0
 public static void UpdateDeploymentVersionNumber(int VersionNumber)
 {
     try
     {
         var res = AppsScriptSourceCodeManager.UpdateDeploymentVersionNumber(VersionNumber).Result;
         printTaskResult(res.ToString(), res.IsSuccess);
     }
     catch (Exception ex)
     {
         PrintErrorCentered(ex.Message);
     }
 }
예제 #5
0
 public static void CreateManifestFile()
 {
     try
     {
         var res = AppsScriptSourceCodeManager.CreateNewAppsScriptManifestJSONFile().Result;
         printTaskResult(res.ToString(), res.IsSuccess);
     }
     catch (Exception ex)
     {
         PrintErrorCentered(ex.Message);
     }
 }
예제 #6
0
 public static void CreateSourceCodeFile(string Name, AppsScriptSourceCodeManager.FILE_TYPES F, bool Sync)
 {
     try
     {
         var res = AppsScriptSourceCodeManager.AddNewSourceFile(Name, F, Sync).Result;
         printTaskResult(res.ToString(), res.IsSuccess);
     }
     catch (Exception ex)
     {
         PrintErrorCentered(ex.Message);
     }
 }
예제 #7
0
 public static void DownloadFilesVersion(int VersionNumber)
 {
     try
     {
         var res = AppsScriptSourceCodeManager.DownloadFiles(VersionNumber).Result;
         printTaskResult(res.ToString(), res.IsSuccess);
     }
     catch (Exception ex)
     {
         PrintErrorCentered(ex.Message);
     }
 }
예제 #8
0
 public static void CreateGASProject(string Name)
 {
     try
     {
         var res = AppsScriptSourceCodeManager.CreateNewGASProject(Name).Result;
         printTaskResult(res.ToString(), res.IsSuccess);
     }
     catch (Exception ex)
     {
         PrintErrorCentered(ex.Message);
     }
 }
예제 #9
0
 public static void InitializeLibrary()
 {
     try
     {
         var res = AppsScriptSourceCodeManager.Initialize(SourceCode).Result;
         printTaskResult(res.ToString(), res.IsSuccess);
         DisplayInfo();
     }
     catch (Exception ex)
     {
         PrintErrorCentered(ex.Message);
     }
 }
예제 #10
0
 public static bool CreateNewVersionAndUpdateDeployment(string Description)
 {
     try
     {
         var res = AppsScriptSourceCodeManager.CreateNewVersionAndUpdateDeployment(Description).Result;
         printTaskResult(res.ToString(), res.IsSuccess);
         return(res.IsSuccess);
     }
     catch (Exception ex)
     {
         PrintErrorCentered(ex.Message);
         return(false);
     }
 }
예제 #11
0
 public static bool VersionBackupThenUploadFiles()
 {
     try
     {
         var res = AppsScriptSourceCodeManager.PreVersionAndSyncChanges().Result;
         printTaskResult(res.ToString(), res.IsSuccess);
         return(res.IsSuccess);
     }
     catch (Exception ex)
     {
         PrintErrorCentered(ex.Message);
         return(false);
     }
 }
예제 #12
0
        public static void GetWatchers()
        {
            if (AutoSync && watchers == null)
            {
                watchers = AppsScriptSourceCodeManager.GetWatchers();

                watchers?.ForEach(fw =>
                {
                    fw.NotifyFilter = System.IO.NotifyFilters.LastWrite;
                    fw.Changed     += fw_Changed;

                    fw.EnableRaisingEvents = true;
                });
            }
        }
예제 #13
0
 /// <summary>
 /// Lists the versions of your project
 /// </summary>
 /// <returns>Boolean representing the success of this execution.</returns>
 public static bool ListProjectVersions()
 {
     try
     {
         var result = AppsScriptSourceCodeManager.ListVersions().Result;
         if (result.IsSuccess)
         {
             versions = result.MyResult;
             result.MyResult?.ForEach(v => PrintCentered(string.Format(" Version #{0}, Create Time {1}, Description {2}", v.VersionNumber, v.CreateTime, v.Description)));
             return(true);
         }
         else
         {
             PrintErrorCentered(result.AdditionalInformation);
             return(false);
         }
     }
     catch (Exception ex)
     {
         PrintErrorCentered(ex.Message);
         return(false);
     }
 }