示例#1
0
        public static bool InitializeMaintBinding()
        {
            int         num;
            PListConfig config = new PListConfig("Library/ServerPreferences.plist");
            string      user   = config["Maint UserName"];
            string      str2   = config["Maint Server"];
            string      str3   = config["Maint project name"];
            string      str4   = config["Maint database name"];
            string      str5   = config["Maint port number"];

            if (!int.TryParse(config["Maint Timeout"], out num))
            {
                num = 5;
            }
            if (((str2.Length == 0) || (str3.Length == 0)) || ((str4.Length == 0) || (user.Length == 0)))
            {
                AssetServer.SetProjectName(string.Empty);
                return(false);
            }
            AssetServer.SetProjectName(string.Format("{0} @ {1}", str3, str2));
            string[] textArray1       = new string[] { "host='", str2, "' user='******' password='******' dbname='", str4, "' port='", str5, "' sslmode=disable ", config["Maint Connection Settings"] };
            string   connectionString = string.Concat(textArray1);

            AssetServer.Initialize(user, connectionString, num);
            return(true);
        }
        public static bool InitializeMaintBinding()
        {
            PListConfig plistConfig = new PListConfig("Library/ServerPreferences.plist");
            string      str1        = plistConfig["Maint UserName"];
            string      server      = plistConfig["Maint Server"];
            string      str2        = plistConfig["Maint project name"];
            string      str3        = plistConfig["Maint database name"];
            string      str4        = plistConfig["Maint port number"];
            int         result;

            if (!int.TryParse(plistConfig["Maint Timeout"], out result))
            {
                result = 5;
            }
            if (server.Length == 0 || str2.Length == 0 || (str3.Length == 0 || str1.Length == 0))
            {
                AssetServer.SetProjectName(string.Empty);
                return(false);
            }
            AssetServer.SetProjectName(string.Format("{0} @ {1}", (object)str2, (object)server));
            string connectionString = "host='" + server + "' user='******' password='******' dbname='" + str3 + "' port='" + str4 + "' sslmode=disable " + plistConfig["Maint Connection Settings"];

            AssetServer.Initialize(str1, connectionString, result);
            return(true);
        }
示例#3
0
        public static bool SettingsAreValid()
        {
            PListConfig pListConfig = new PListConfig("Library/ServerPreferences.plist");
            string      text        = pListConfig["Maint UserName"];
            string      text2       = pListConfig["Maint Server"];
            string      text3       = pListConfig["Maint database name"];
            string      text4       = pListConfig["Maint Timeout"];
            string      text5       = pListConfig["Maint port number"];

            return(text.Length != 0 && text2.Length != 0 && text3.Length != 0 && text4.Length != 0 && text5.Length != 0);
        }
示例#4
0
        public static bool SettingsAreValid()
        {
            PListConfig config = new PListConfig("Library/ServerPreferences.plist");
            string      str    = config["Maint UserName"];
            string      str2   = config["Maint Server"];
            string      str3   = config["Maint database name"];
            string      str4   = config["Maint Timeout"];
            string      str5   = config["Maint port number"];

            return((((str.Length != 0) && (str2.Length != 0)) && ((str3.Length != 0) && (str4.Length != 0))) && (str5.Length != 0));
        }
 private void ClearConfig()
 {
     if (EditorUtility.DisplayDialog("Clear Configuration", "Are you sure you want to disconnect from Asset Server project and clear all configuration values?", "Clear", "Cancel"))
     {
         this.plc = new PListConfig("Library/ServerPreferences.plist");
         this.plc.Clear();
         this.plc.Save();
         this.LoadConfig();
         this.projectsLv.totalRows = 0;
         ASEditorBackend.InitializeMaintBinding();
         this.resetKeyboardControl = true;
     }
 }
示例#6
0
 private void ClearConfig()
 {
     if (EditorUtility.DisplayDialog("Clear Configuration", "Are you sure you want to disconnect from Asset Server project and clear all configuration values?", "Clear", "Cancel"))
     {
         this.plc = new PListConfig("Library/ServerPreferences.plist");
         this.plc.Clear();
         this.plc.Save();
         this.LoadConfig();
         this.projectsLv.totalRows = 0;
         ASEditorBackend.InitializeMaintBinding();
         this.resetKeyboardControl = true;
     }
 }
示例#7
0
        public static void Testing_SetActiveDatabase(string host, int port, string projectName, string dbName, string user, string pwd)
        {
            PListConfig config = new PListConfig("Library/ServerPreferences.plist");

            config["Maint Server"]              = host;
            config["Maint UserName"]            = user;
            config["Maint database name"]       = dbName;
            config["Maint port number"]         = port.ToString();
            config["Maint project name"]        = projectName;
            config["Maint Password"]            = string.Empty;
            config["Maint settings type"]       = "manual";
            config["Maint Timeout"]             = "5";
            config["Maint Connection Settings"] = string.Empty;
            config.Save();
        }
 private void GetDefaultPListConfig()
 {
   this.plc = new PListConfig("Library/ServerPreferences.plist");
   this.plc["Maint Server"] = string.Empty;
   this.plc["Maint UserName"] = string.Empty;
   this.plc["Maint database name"] = string.Empty;
   this.plc["Maint port number"] = string.Empty;
   this.plc["Maint project name"] = string.Empty;
   this.plc["Maint Password"] = string.Empty;
   if (this.plc["Maint settings type"] == string.Empty)
     this.plc["Maint settings type"] = "manual";
   if (this.plc["Maint Timeout"] == string.Empty)
     this.plc["Maint Timeout"] = "5";
   if (!(this.plc["Maint Connection Settings"] == string.Empty))
     return;
   this.plc["Maint Connection Settings"] = string.Empty;
 }
        public static bool InitializeMaintBinding()
        {
            PListConfig pListConfig = new PListConfig("Library/ServerPreferences.plist");
            string      text        = pListConfig["Maint UserName"];
            string      text2       = pListConfig["Maint Server"];
            string      text3       = pListConfig["Maint project name"];
            string      text4       = pListConfig["Maint database name"];
            string      text5       = pListConfig["Maint port number"];
            int         timeout;

            if (!int.TryParse(pListConfig["Maint Timeout"], out timeout))
            {
                timeout = 5;
            }
            bool result;

            if (text2.Length == 0 || text3.Length == 0 || text4.Length == 0 || text.Length == 0)
            {
                AssetServer.SetProjectName("");
                result = false;
            }
            else
            {
                AssetServer.SetProjectName(string.Format("{0} @ {1}", text3, text2));
                string connectionString = string.Concat(new string[]
                {
                    "host='",
                    text2,
                    "' user='******' password='******' dbname='",
                    text4,
                    "' port='",
                    text5,
                    "' sslmode=disable ",
                    pListConfig["Maint Connection Settings"]
                });
                AssetServer.Initialize(text, connectionString, timeout);
                result = true;
            }
            return(result);
        }
示例#10
0
		private void LoadConfig()
		{
			PListConfig pListConfig = new PListConfig("Library/ServerPreferences.plist");
			this.serverAddress = pListConfig["Maint Server"];
			this.userName = pListConfig["Maint UserName"];
			this.port = pListConfig["Maint port number"];
			this.projectName = pListConfig["Maint project name"];
			this.password = ASEditorBackend.GetPassword(this.serverAddress, this.userName);
			if (this.port != string.Empty && this.port != 10733.ToString())
			{
				this.serverAddress = this.serverAddress + ":" + this.port;
			}
			this.serversList = InternalEditorUtility.GetEditorSettingsList("ASServer", 20);
			this.serversLv.totalRows = this.serversList.Length;
			if (ArrayUtility.Contains<string>(this.serversList, this.serverAddress))
			{
				this.serversLv.row = ArrayUtility.IndexOf<string>(this.serversList, this.serverAddress);
			}
		}
示例#11
0
 public string this[string paramName]
 {
     get
     {
         Match match = PListConfig.GetRegex(paramName).Match(this.xml);
         return((!match.Success) ? string.Empty : match.Groups["Value"].Value);
     }
     set
     {
         Match match = PListConfig.GetRegex(paramName).Match(this.xml);
         if (match.Success)
         {
             this.xml = PListConfig.GetRegex(paramName).Replace(this.xml, "${Part1}" + value + "</string>");
         }
         else
         {
             this.WriteNewValue(paramName, value);
         }
     }
 }
示例#12
0
        private void LoadConfig()
        {
            PListConfig pListConfig = new PListConfig("Library/ServerPreferences.plist");

            this.serverAddress = pListConfig["Maint Server"];
            this.userName      = pListConfig["Maint UserName"];
            this.port          = pListConfig["Maint port number"];
            this.projectName   = pListConfig["Maint project name"];
            this.password      = ASEditorBackend.GetPassword(this.serverAddress, this.userName);
            if (this.port != string.Empty && this.port != 10733.ToString())
            {
                this.serverAddress = this.serverAddress + ":" + this.port;
            }
            this.serversList         = InternalEditorUtility.GetEditorSettingsList("ASServer", 20);
            this.serversLv.totalRows = this.serversList.Length;
            if (ArrayUtility.Contains <string>(this.serversList, this.serverAddress))
            {
                this.serversLv.row = ArrayUtility.IndexOf <string>(this.serversList, this.serverAddress);
            }
        }
示例#13
0
 private void GetDefaultPListConfig()
 {
     this.plc = new PListConfig("Library/ServerPreferences.plist");
     this.plc["Maint Server"]        = "";
     this.plc["Maint UserName"]      = "";
     this.plc["Maint database name"] = "";
     this.plc["Maint port number"]   = "";
     this.plc["Maint project name"]  = "";
     this.plc["Maint Password"]      = "";
     if (this.plc["Maint settings type"] == string.Empty)
     {
         this.plc["Maint settings type"] = "manual";
     }
     if (this.plc["Maint Timeout"] == string.Empty)
     {
         this.plc["Maint Timeout"] = "5";
     }
     if (this.plc["Maint Connection Settings"] == string.Empty)
     {
         this.plc["Maint Connection Settings"] = "";
     }
 }
		public static bool InitializeMaintBinding()
		{
			PListConfig pListConfig = new PListConfig("Library/ServerPreferences.plist");
			string text = pListConfig["Maint UserName"];
			string text2 = pListConfig["Maint Server"];
			string text3 = pListConfig["Maint project name"];
			string text4 = pListConfig["Maint database name"];
			string text5 = pListConfig["Maint port number"];
			int timeout;
			if (!int.TryParse(pListConfig["Maint Timeout"], out timeout))
			{
				timeout = 5;
			}
			if (text2.Length == 0 || text3.Length == 0 || text4.Length == 0 || text.Length == 0)
			{
				AssetServer.SetProjectName(string.Empty);
				return false;
			}
			AssetServer.SetProjectName(string.Format("{0} @ {1}", text3, text2));
			string connectionString = string.Concat(new string[]
			{
				"host='",
				text2,
				"' user='******' password='******' dbname='",
				text4,
				"' port='",
				text5,
				"' sslmode=disable ",
				pListConfig["Maint Connection Settings"]
			});
			AssetServer.Initialize(text, connectionString, timeout);
			return true;
		}
示例#15
0
 public static bool SettingsAreValid()
 {
     PListConfig config = new PListConfig("Library/ServerPreferences.plist");
     string str = config["Maint UserName"];
     string str2 = config["Maint Server"];
     string str3 = config["Maint database name"];
     string str4 = config["Maint Timeout"];
     string str5 = config["Maint port number"];
     return ((((str.Length != 0) && (str2.Length != 0)) && ((str3.Length != 0) && (str4.Length != 0))) && (str5.Length != 0));
 }
 public static bool SettingsAreValid()
 {
   PListConfig plistConfig = new PListConfig("Library/ServerPreferences.plist");
   return (plistConfig["Maint UserName"].Length == 0 || plistConfig["Maint Server"].Length == 0 || (plistConfig["Maint database name"].Length == 0 || plistConfig["Maint Timeout"].Length == 0) ? 1 : (plistConfig["Maint port number"].Length == 0 ? 1 : 0)) == 0;
 }
 public static bool InitializeMaintBinding()
 {
   PListConfig plistConfig = new PListConfig("Library/ServerPreferences.plist");
   string str1 = plistConfig["Maint UserName"];
   string server = plistConfig["Maint Server"];
   string str2 = plistConfig["Maint project name"];
   string str3 = plistConfig["Maint database name"];
   string str4 = plistConfig["Maint port number"];
   int result;
   if (!int.TryParse(plistConfig["Maint Timeout"], out result))
     result = 5;
   if (server.Length == 0 || str2.Length == 0 || (str3.Length == 0 || str1.Length == 0))
   {
     AssetServer.SetProjectName(string.Empty);
     return false;
   }
   AssetServer.SetProjectName(string.Format("{0} @ {1}", (object) str2, (object) server));
   string connectionString = "host='" + server + "' user='******' password='******' dbname='" + str3 + "' port='" + str4 + "' sslmode=disable " + plistConfig["Maint Connection Settings"];
   AssetServer.Initialize(str1, connectionString, result);
   return true;
 }
 public void InitOverviewPage(bool lastActionsResult)
 {
   if (!lastActionsResult)
   {
     this.needsSetup = true;
     this.sharedChangesets = (Changeset[]) null;
     this.sharedCommits = (AssetsItem[]) null;
     this.sharedDeletedItems = (AssetsItem[]) null;
   }
   else
   {
     PListConfig plistConfig = new PListConfig("Library/ServerPreferences.plist");
     this.connectionString = plistConfig["Maint UserName"] + " @ " + plistConfig["Maint Server"] + " : " + plistConfig["Maint project name"];
     if (this.UpdateNeedsRefresh())
       this.GetUpdates();
     this.needsSetup = this.sharedChangesets == null || AssetServer.HasConnectionError();
     this.InitCommits();
     this.DisplayedItemsChanged();
   }
 }
示例#19
0
        public static bool SettingsAreValid()
        {
            PListConfig plistConfig = new PListConfig("Library/ServerPreferences.plist");

            return((plistConfig["Maint UserName"].Length == 0 || plistConfig["Maint Server"].Length == 0 || (plistConfig["Maint database name"].Length == 0 || plistConfig["Maint Timeout"].Length == 0) ? 1 : (plistConfig["Maint port number"].Length == 0 ? 1 : 0)) == 0);
        }
		public static void Testing_SetActiveDatabase(string host, int port, string projectName, string dbName, string user, string pwd)
		{
			PListConfig pListConfig = new PListConfig("Library/ServerPreferences.plist");
			pListConfig["Maint Server"] = host;
			pListConfig["Maint UserName"] = user;
			pListConfig["Maint database name"] = dbName;
			pListConfig["Maint port number"] = port.ToString();
			pListConfig["Maint project name"] = projectName;
			pListConfig["Maint Password"] = string.Empty;
			pListConfig["Maint settings type"] = "manual";
			pListConfig["Maint Timeout"] = "5";
			pListConfig["Maint Connection Settings"] = string.Empty;
			pListConfig.Save();
		}
示例#21
0
 public static bool InitializeMaintBinding()
 {
     int num;
     PListConfig config = new PListConfig("Library/ServerPreferences.plist");
     string user = config["Maint UserName"];
     string str2 = config["Maint Server"];
     string str3 = config["Maint project name"];
     string str4 = config["Maint database name"];
     string str5 = config["Maint port number"];
     if (!int.TryParse(config["Maint Timeout"], out num))
     {
         num = 5;
     }
     if (((str2.Length == 0) || (str3.Length == 0)) || ((str4.Length == 0) || (user.Length == 0)))
     {
         AssetServer.SetProjectName(string.Empty);
         return false;
     }
     AssetServer.SetProjectName(string.Format("{0} @ {1}", str3, str2));
     string[] textArray1 = new string[] { "host='", str2, "' user='******' password='******' dbname='", str4, "' port='", str5, "' sslmode=disable ", config["Maint Connection Settings"] };
     string connectionString = string.Concat(textArray1);
     AssetServer.Initialize(user, connectionString, num);
     return true;
 }
		public static bool SettingsAreValid()
		{
			PListConfig pListConfig = new PListConfig("Library/ServerPreferences.plist");
			string text = pListConfig["Maint UserName"];
			string text2 = pListConfig["Maint Server"];
			string text3 = pListConfig["Maint database name"];
			string text4 = pListConfig["Maint Timeout"];
			string text5 = pListConfig["Maint port number"];
			return text.Length != 0 && text2.Length != 0 && text3.Length != 0 && text4.Length != 0 && text5.Length != 0;
		}
示例#23
0
 public void InitOverviewPage(bool lastActionsResult)
 {
     if (!lastActionsResult)
     {
         this.needsSetup = true;
         this.sharedChangesets = null;
         this.sharedCommits = null;
         this.sharedDeletedItems = null;
     }
     else
     {
         PListConfig config = new PListConfig("Library/ServerPreferences.plist");
         string[] textArray1 = new string[] { config["Maint UserName"], " @ ", config["Maint Server"], " : ", config["Maint project name"] };
         this.connectionString = string.Concat(textArray1);
         if (this.UpdateNeedsRefresh())
         {
             this.GetUpdates();
         }
         this.needsSetup = (this.sharedChangesets == null) || AssetServer.HasConnectionError();
         this.InitCommits();
         this.DisplayedItemsChanged();
     }
 }