Example #1
0
 private UpdateManager(string serverName, string dbName, string userName, string password, bool integratedSecurity)
 {
     res = Localization.Instance.Resources;
     if (integratedSecurity)
         connectionString = string.Format("data source={0};initial catalog={1};persist security info=False;Integrated Security=SSPI;", serverName, dbName);
     else
         connectionString = string.Format("data source={0};initial catalog={1};persist security info=False;user id={2};Password={3};", serverName, dbName, userName, password);
     using (SqlConnection conn = new SqlConnection(connectionString))
     {
         try
         {
             conn.Open();
         }
         catch
         {
             throw new Exception(res.CantConnect);
         }
         parameters = new string[,] {
             {"%Creating table%",res.CreatingTable},
             {"%Creating procedure%",res.CreatingProcedure},
             {"%Updating database to version%",res.UpdateDBToVer}
         };
     }
     versionList = GetVersionList();
     versions = versionList.ToArray();
     currVersion = GetDBVersion();
     versionList.Sort();
     if (versionList.Count > 0)
         maxVersion = versionList[versionList.Count - 1];
     else
         maxVersion = new Version();
 }
Example #2
0
 public Versions(Version[] versionsArray, string[] namesArray)
 {
     VersionsArray = versionsArray;
     NamesArray = namesArray;
 }
        private void LoadScripts()
        {
            Assembly assembly = Assembly.GetExecutingAssembly();

            String[] res = assembly.GetManifestResourceNames();

            List<Version> scripts = new List<Version>();

            for (int i = 0; i < res.Length; i++)
            {
                int index = res[i].IndexOf("sql");
                if (index != -1)
                {
                    string version = res[i].Substring(index - 8, 7);
                    using (StreamReader reader = new StreamReader(
                        assembly.GetManifestResourceStream(res[i]),
                        Encoding.GetEncoding(1251)))
                    {
                        string script = reader.ReadToEnd();

                        scripts.Add(new Version(version, script));
                    }
                }
            }
            versions = scripts.ToArray();
            Array.Sort(versions);
        }
		void InternalGetClrVersions ()
		{
			char [] anychars = new char [] { ';', ')' };
			string s = useragent;
			ArrayList list = null;
			int idx;
			while ((s != null) && (idx = s.IndexOf (".NET CLR ")) != -1) {
				int end = s.IndexOfAny (anychars, idx + 9);
				if (end == -1)
					break;

				string ver = s.Substring (idx + 9, end - idx - 9);
				Version v = null;
				try {
					v = new Version (ver);
					if (clrVersion == null || v > clrVersion)
						clrVersion = v;

					if (list == null)
						list = new ArrayList (4);

					list.Add (v);
				} catch { }
				s = s.Substring (idx + 9);
			}
			
			if (list == null || list.Count == 0) {
				clrVersion = new Version ();
#if NET_2_0
				clrVersions = null;
#else
				clrVersions = new Version [1] { clrVersion };
#endif
			} else {
				list.Sort ();
				clrVersions = (Version []) list.ToArray (typeof (Version));
			}
		}
 public VisualStudioSpec(
     Version version,
     string dotNetFrameworkSdkRegistryKey,
     string windowsSdkRegistryKey,
     string windowsSdkRegistryInstallationFolderName,
     Version[] supportedDotNetFrameworkVersions)
 {
     _version = version;
     _dotNetFrameworkSdkRegistryKey = dotNetFrameworkSdkRegistryKey;
     _windowsSdkRegistryKey = windowsSdkRegistryKey;
     _windowsSdkRegistryInstallationFolderName = windowsSdkRegistryInstallationFolderName;
     _supportedDotNetFrameworkVersions = supportedDotNetFrameworkVersions;
 }
Example #6
0
 public Project Clean(Project project)
 {
     Basics = project.Basics;
     Versions = (OrderByVersion(project.Versions)).ToArray();
     return this;
 }
 public PackageAdapter(Version version, Version[] packages)
 {
     this.version = version;
     this.packages = packages;
 }