public static HalanVersionInfo GetVersionInfo(string productName, Version currentVersion)
        {
            BasicHttpBinding_IProductManager p = new BasicHttpBinding_IProductManager();

              LatestVersionRequest req = new LatestVersionRequest();
              req.ProductName = productName;
              req.CurrentProductVersion = currentVersion.ToString(4);

              LatestVersionResponse resp = p.GetLatestVersion(req);

              if( resp.ProductVersion.IsValid() ) {
            HalanVersionInfo r = new HalanVersionInfo();

            Version larestVer = new Version(resp.ProductVersion);
            r.Product = productName;
            r.ReleaseDate = resp.ReleaseDate;
            r.Status = ( larestVer <= currentVersion ) ? VersionStatus.Latest : VersionStatus.Old;
            r.LatestVersion = larestVer;
            r.Features = resp.Features;
            r.Url = resp.Url.Default("http://blog.halan.se/page/Service-Bus-MQ-Manager.aspx?update=true&v=" + currentVersion.ToString());
            return r;
              }

              return null;
        }
Esempio n. 2
0
        private void WriteCopyright()
        {
            Assembly executingAssembly = Assembly.GetExecutingAssembly();

            System.Version version = executingAssembly.GetName().Version;

#if NETCF_1_0
            writer.WriteLine("NUnitLite version {0}", version.ToString());
            writer.WriteLine("Copyright 2007, Charlie Poole");
#else
            object[] objectAttrs = executingAssembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false);
            AssemblyProductAttribute productAttr = (AssemblyProductAttribute)objectAttrs[0];

            objectAttrs = executingAssembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
            AssemblyCopyrightAttribute copyrightAttr = (AssemblyCopyrightAttribute)objectAttrs[0];

            writer.WriteLine(String.Format("{0} version {1}", productAttr.Product, version.ToString(3)));
            writer.WriteLine(copyrightAttr.Copyright);
#endif
            writer.WriteLine();

            string clrPlatform = Type.GetType("Mono.Runtime", false) == null ? ".NET" : "Mono";
            writer.WriteLine("Runtime Environment -");
            writer.WriteLine("    OS Version: {0}", Environment.OSVersion);
            writer.WriteLine("  {0} Version: {1}", clrPlatform, Environment.Version);
            writer.WriteLine();
        }
Esempio n. 3
0
        public void Export(IEnumerable<ApplicationStatistics> statistics, Version version, TimeSpan sessionDuration, Guid appKey)
        {
            var statToExport = Mapper.Map<IEnumerable<ApplicationStatistics>, IEnumerable<StatisticEntry>>(statistics);
            var app = Get.Scalars().GetApplicationByAppKey(appKey);
            if (app == null)
            {
                Get.Exporter().Insert(new Application()
                {
                    ApplicationKey = Guid.NewGuid(),
                    InstallationDate = DateTime.Today,
                    LastUpdate = DateTime.Today,
                    UpdateVersion = DateTime.Today,
                    Version = version.ToString(),
                });
            }
            else if (app.Version != version.ToString())
            {
                Get.Exporter().Update(app);
            }

            Get.Exporter().Insert(statToExport);
            Get.Exporter().Insert(new SessionDuration()
            {
                Duration = sessionDuration,
                TimeStamp = DateTime.Today,
                Version = version.ToString(),
            });
        }
Esempio n. 4
0
 private static string GetCompilerVersionString(Version version)
 {
     if (version > new Version(4, 5))
         return "v" + version.ToString(3); //v 4.5.1
     else
         return "v" + version.ToString(2);
 }
Esempio n. 5
0
        static int LaunchApp(Version latestVersion, string partialExePath, string args, bool runAsAdmin)
        {
            int statusCode = 0;
            string completeExePath = Path.Combine(Environment.CurrentDirectory,
                                                  latestVersion.ToString(),
                                                  partialExePath);

            var info = new ProcessStartInfo(completeExePath)
            {
                WorkingDirectory = Path.Combine(Environment.CurrentDirectory,
                                                latestVersion.ToString()),
                Arguments = args
            };

            if (runAsAdmin)
            {
                info.Verb = "runas";
                info.UseShellExecute = true;
            }

            try
            {
                Process.Start(info);
            }
            catch (Exception e)
            {
                ShowErrorMessageBox(e.GetType().ToString());
                statusCode = 1;
            }

            return statusCode;
        }
Esempio n. 6
0
        public static string CompabilityText(Type type, string PluginToInstall, string PluginCompatible, string PluginName, System.Version currVersion, System.Version minVersion)
        {
            string result = string.Format(PluginToInstall, minVersion.ToString(), PluginName);

            try
            {
                if (type != null)
                {
                    if (currVersion.CompareTo(minVersion) >= 0)
                    {
                        result = string.Format(OtherPluginVersion, currVersion.ToString(), PluginName) + " " +
                                 PluginCompatible;
                    }
                    else
                    {
                        result = string.Format(OtherPluginVersion, currVersion.ToString(), PluginName) + " " +
                                 string.Format(PluginToInstall, minVersion.ToString(), PluginName);
                    }
                }
            }
            catch (Exception)
            {
            }
            return(result);
        }
    public static void BumpVersionNumber()
    {
        // Did we reuse or load ourself?
        bool didReuse = false;

        // Create a holder
        Object projectSettings = null;

        // Make our path.
        string settingsPath = Application.dataPath.Replace("/Assets", "/ProjectSettings/ProjectSettings.asset");

        // Find if it's already loaded
        projectSettings = Resources.FindObjectsOfTypeAll <Object>().Where(a => string.Compare(a.GetType().FullName, PLAYER_SETTINGS_ASSEMBLY_NAME) == 0).FirstOrDefault();

        if (projectSettings == null)
        {
            Object[] loadedObjects = InternalEditorUtility.LoadSerializedFileAndForget(settingsPath);

            // For funzies print out each object defined in the ProjectSettings.asset yaml.
            for (int i = 0; i < loadedObjects.Length; i++)
            {
                if (string.Compare(loadedObjects[i].GetType().FullName, PLAYER_SETTINGS_ASSEMBLY_NAME) == 0)
                {
                    projectSettings = loadedObjects[i];
                    Debug.Log("We loaded a new instance of: " + loadedObjects[i].GetType().FullName);
                    didReuse = false;
                    break;
                }
            }
        }
        else
        {
            Debug.Log("We reused a current instance of " + projectSettings.GetType().FullName);
            didReuse = true;
        }

        // Create a way to edit it
        SerializedObject serializedProjectSettings = new SerializedObject(projectSettings);
        // Get our bundle version field.
        SerializedProperty bundleVersion = serializedProjectSettings.FindProperty("bundleVersion");
        // Cast it as a version
        Version version = new Version(bundleVersion.stringValue);

        // Log our current.
        Debug.Log("Old Version: " + version.ToString());
        // Bump the build version
        version = new Version(version.Major, version.Minor, version.Build + 1);
        // Save it back.
        bundleVersion.stringValue = version.ToString();
        // Log new version
        Debug.Log("New Version: " + version.ToString());
        // Save serialized object
        serializedProjectSettings.ApplyModifiedProperties();

        if (!didReuse)
        {
            // Save back to disk. (Only if we are the only watcher)
            InternalEditorUtility.SaveToSerializedFileAndForget(new Object[] { projectSettings }, settingsPath, true);
        }
    }
Esempio n. 8
0
        private static void WriteJekyllRelease(Options options, Version newVersion)
        {
            var    dateTime = DateTime.Now.ToString("yyyy-MM-dd");
            string text     = String.Format(MarkdownTemplate, newVersion.ToString(3), dateTime);
            var    format   = string.Format("{0}-v{1}.markdown", dateTime, newVersion.ToString(3));

            File.WriteAllText(Path.Combine(options.LocalRepo, "_posts", format), text);
        }
Esempio n. 9
0
 private void WriteToolInfo(string name, string fileVersion, Version assemblyVersion)
 {
     _writer.WriteObjectStart("tool");
     _writer.Write("name", name);
     _writer.Write("version", assemblyVersion.ToString());
     _writer.Write("fileVersion", fileVersion);
     _writer.Write("semanticVersion", assemblyVersion.ToString(fieldCount: 3));
     _writer.WriteObjectEnd();
 }
Esempio n. 10
0
 public void OnDestroy()
 {
     if (version != null && !setReminder)
     {
         Debug.Log("Closed window, reminding again tomorrow");
         EditorPrefs.SetString("AstarRemindUpdateDate", System.DateTime.UtcNow.AddDays(1).ToString(System.Globalization.CultureInfo.InvariantCulture));
         EditorPrefs.SetString("AstarRemindUpdateVersion", version.ToString());
     }
 }
Esempio n. 11
0
        public UpdateForm(MLifterUpdateHandler updateHandler, Version newVersion)
        {
            UpdateHandler = updateHandler;

            InitializeComponent();

            labelTitle.Text = string.Format(Resources.HEADER, newVersion.ToString(3));
            textBoxDescription.Rtf = Resources.DESCRIPTION;
            labelDownloadTitle.Text = string.Format(Resources.TITLE, newVersion.ToString(3));
            labelDownloadNote.Text = Resources.NOTE;
        }
Esempio n. 12
0
    void Awake()
    {
        if (Application.isPlaying)
        {
            QualitySettings.vSyncCount = 0;
        }

        QualitySettings.antiAliasing = 0;
        cfuStatus = "PSXEffects v" + version.ToString();

        CheckForUpdates();
    }
 public virtual void UpdateConfig(string assemblyname, Version assemblyVersion, string culture, string publicKeyToken, string codeBaseLocation = null)
 {
     string invariant = CrmAdoConstants.Invariant;
     string name = CrmAdoConstants.Name;
     string description = CrmAdoConstants.Description;
     string typeName = CrmAdoConstants.DbProviderFactorTypeName;
     string fullyQualifiedAssemblyName = string.Format("{0}, Version={1}, Culture={2}, PublicKeyToken={3}", assemblyname, assemblyVersion.ToString(), culture, publicKeyToken);
     Utils.RegisterDataProviderInMachineConfig(Utils.GetNET40Version(), invariant, name, description, typeName, fullyQualifiedAssemblyName);
     if(!string.IsNullOrEmpty(codeBaseLocation))
     {
         Utils.RegisterAssemblyCodeBaseInMachineConfig(Utils.GetNET40Version(), assemblyname, publicKeyToken, culture, assemblyVersion.ToString(), codeBaseLocation);
     }
 }
Esempio n. 14
0
        internal static int Main(String[] args)
        {
            // --- Check input ---

            if (args.Length != 2)
            {
                Console.Error.WriteLine("Invalid number of parameters. Expected path to version.txt and output filename.");
                return -1;
            }

            // --- Read in Dapple's major, minor and build numbers from version.txt ---

            Version oMajorMinorBuild = new Version(File.ReadAllText(args[0]));

            // --- Calculate the Dapple version number by the number of days that have passed since DappleEpoch.
            // --- This will overflow in approx. 27.4 years.  That should be long enough.

            DateTime oNow = DateTime.Now;
            int iRevision = (oNow - DappleEpoch).Days;
            if (iRevision > 9999)
            {
                Console.Error.WriteLine("DynamicAssemblyInfo cannot complete the operation: too many days have passed since the epoch. Update DynamicAssemblyInfo's epoch to be newer.");
                return -2;
            }
            Version oVersion = new Version(oMajorMinorBuild.Major, oMajorMinorBuild.Minor, oMajorMinorBuild.Build, (oNow - DappleEpoch).Days);

            // --- Generate output file ---

            StringBuilder output = new StringBuilder();
            output.AppendLine("// -----------------------------------------------------------------------------");
            output.AppendLine("// This file has been generated by DynamicAssemblyInfo.exe");
            output.AppendLine("// -----------------------------------------------------------------------------");
            output.AppendLine();
            output.AppendLine("using System.Reflection;");
            output.AppendLine("using System.Runtime.InteropServices;");
            output.AppendLine();
            output.AppendLine("[assembly: AssemblyCompanyAttribute(\"Geosoft Inc.\")]");
            output.AppendLine("[assembly: AssemblyProductAttribute(\"Dapple\")]");
            output.AppendLine("[assembly: AssemblyCopyrightAttribute(\"Copyright © " + oNow.Year.ToString(CultureInfo.InvariantCulture) + "\")]");
            output.AppendLine("[assembly: AssemblyTrademarkAttribute(\"\")]");
            output.AppendLine("[assembly: AssemblyVersionAttribute(\"" + oVersion.ToString(4) + "\")]");
            output.AppendLine("[assembly: AssemblyFileVersion(\"" + oVersion.ToString(4) + "\")]");
            output.AppendLine("[assembly: AssemblyDelaySignAttribute(false)]");
            output.AppendLine("[assembly: AssemblyKeyNameAttribute(\"\")]");
            output.AppendLine("[assembly: ComVisible(false)]");

            File.WriteAllText(args[1], output.ToString());

            return 0;
        }
Esempio n. 15
0
        private void checkUpdates()
        {
            Utilities.Log("Checking for new version");
            using (WebClient updateChecker = new WebClient())
            {

                try
                {
                    Version newVersion = new Version(updateChecker.DownloadString(new Uri("https://raw.github.com/ron975/Battlelogium/master/currentreleaseversion")));
                    Utilities.Log("Downloaded version number");
                    if (newVersion > currentVersion)
                    {
                        Utilities.Log(String.Format("currentVersion = {0}, newVersion = {1}", currentVersion.ToString(), newVersion.ToString()));
                        dispatcher.BeginInvoke(new Action(delegate
                        {
                            if (Utilities.ShowChoiceDialog("There is a new version available. Open the thread on the Steam Users' Forums? You can disable version checking in config.ini", "New Version Available", "Open Forum Thread", "Ignore Update"))
                            {
                                Process.Start("http://forums.steampowered.com/forums/showthread.php?t=3140249");
                            }
                        }));
                    }
                }
                catch
                {
                    Utilities.Log("Unable to get new version");
                    return;
                }
            }
        }
Esempio n. 16
0
		private void FormCentralManager_Load(object sender,EventArgs e) {
			if(!GetConfigAndConnect()){
				return;
			}
			Cache.Refresh(InvalidType.Prefs);
			Version storedVersion=new Version(PrefC.GetString(PrefName.ProgramVersion));
			Version currentVersion=Assembly.GetAssembly(typeof(Db)).GetName().Version;
			if(storedVersion.CompareTo(currentVersion)!=0){
				MessageBox.Show(Lan.g(this,"Program version")+": "+currentVersion.ToString()+"\r\n"
					+Lan.g(this,"Database version")+": "+storedVersion.ToString()+"\r\n"
					+Lan.g(this,"Versions must match.  Please manually connect to the database through the main program in order to update the version."));
				Application.Exit();
				return;
			}
			if(PrefC.GetString(PrefName.CentralManagerPassHash)!=""){
				FormCentralPasswordCheck FormCPC=new FormCentralPasswordCheck();
				FormCPC.ShowDialog();
				if(FormCPC.DialogResult!=DialogResult.OK){
					Application.Exit();
					return;
				}
			}
			_listConnectionGroups=ConnectionGroups.GetListt();
			comboConnectionGroups.Items.Clear();
			comboConnectionGroups.Items.Add("All");
			for(int i=0;i<_listConnectionGroups.Count;i++) {
				comboConnectionGroups.Items.Add(_listConnectionGroups[i].Description);
			}
			comboConnectionGroups.SelectedIndex=0;//Select 'All' on load.
			FillGrid();
		}
Esempio n. 17
0
 private void CatalogForm_Load(object sender, EventArgs e)
 {
     PopulateList.PopulateProductList(productList);
     productList.Sorting = SortOrder.Ascending;
     Version ver = new Version(Application.ProductVersion);
     tsVersion.Text = "v" + ver.ToString(2);
 }
        public void AddPlugin(string id, string name, Version version,
            Icon icon, string description, string disabledReason)
        {
            if (icon == null)
                icon = Resources.DefaultPluginIcon;

            Image smallIcon = new Icon(icon, new Size(16, 16)).ToBitmap();
            Image bigIcon = new Icon(icon, new Size(32, 32)).ToBitmap();

            var pluginInfo = new PluginInfo()
            {
                Id = id,
                Name = name,
                Version = version != null ? version.ToString() : "",
                SmallIcon = smallIcon,
                BigIcon = bigIcon,
                Description = description ?? name,
                DisabledReason = disabledReason
            };

            int rowIndex = pluginGrid.Rows.Add(pluginInfo.SmallIcon, pluginInfo.Name, pluginInfo.Version);
            DataGridViewRow row = pluginGrid.Rows[rowIndex];
            row.Tag = pluginInfo;

            if (disabledReason != null)
                row.DefaultCellStyle.ForeColor = Color.LightGray;
        }
Esempio n. 19
0
        public frmDHCP4IPTV()
        {
            InitializeComponent();

            m_bInitializing = true;
            GetNICList();
            RetrieveSettings();
            m_bInitializing = false;

            UpdateStatus("Idle; only use the MAC address of your set-top box!");

            if (chkStartMinimized.Checked)
            {
                this.WindowState = FormWindowState.Minimized;
            }

            m_DHCP = new DHCP();

            System.Version verCur = Assembly.GetExecutingAssembly().GetName().Version;
            this.Text += " v" + verCur.ToString() + " by Muyz ©2010";

            if (chkStartWithWindows.Checked)
            {
                btnStart_Click(null, null);
            }
        }
Esempio n. 20
0
		private string extractVersion(XmlDocument doc)
		{
			if (doc != null)
			{				
				XmlNamespaceManager nsManager = new XmlNamespaceManager(doc.NameTable);
				XmlNodeList nodes = doc.GetElementsByTagName("title");
				Version version = new Version();
				foreach (XmlNode node in nodes)
				{
					Regex versionRe = new Regex(@"d?nGREP\s+(?<version>[\d\.]+)\.\w+");

					if (versionRe.IsMatch(node.InnerText))
					{
						Version tempVersion = new Version(versionRe.Match(node.InnerText).Groups["version"].Value);
						if (version == null || version.CompareTo(tempVersion) < 0)
							version = tempVersion;
					}
				}
				return version.ToString();
			}
			else
			{
				return null;
			}
		}
        /// <summary>
        /// Used to get the correct package file from the repo for the current umbraco version
        /// </summary>
        /// <param name="packageGuid"></param>
        /// <param name="userId"></param>
        /// <param name="currentUmbracoVersion"></param>
        /// <returns></returns>
        public string GetPackageFile(string packageGuid, int userId, System.Version currentUmbracoVersion)
        {
            // log
            Audit.Add(AuditTypes.PackagerInstall,
                      string.Format("Package {0} fetched from {1}", packageGuid, this.Guid),
                      userId, -1);

            var fileByteArray = Webservice.GetPackageFile(packageGuid, currentUmbracoVersion.ToString(3));

            //successfull
            if (fileByteArray.Length > 0)
            {
                // Check for package directory
                if (Directory.Exists(IOHelper.MapPath(Settings.PackagerRoot)) == false)
                {
                    Directory.CreateDirectory(IOHelper.MapPath(Settings.PackagerRoot));
                }

                using (var fs1 = new FileStream(IOHelper.MapPath(Settings.PackagerRoot + Path.DirectorySeparatorChar + packageGuid + ".umb"), FileMode.Create))
                {
                    fs1.Write(fileByteArray, 0, fileByteArray.Length);
                    fs1.Close();
                    return("packages\\" + packageGuid + ".umb");
                }
            }

            return("");
        }
Esempio n. 22
0
 public UpdateReadyViewModel(IUpdateService updateController, AppContracts contracts, Version newVersion, List<Release> changelog) {
     _UpdateController = updateController;
     _Contracts = contracts;
     NewVersion = newVersion.ToString();
     DisplayName = string.Format("Update ready - {0}", _Contracts.ApplicationName);
     Changelog = changelog.Where(r => r.ReleaseVersion > contracts.ApplicationVersion).OrderByDescending(r => r.ReleaseVersion).ToList();
 }
Esempio n. 23
0
        /// <summary>
        /// Generates an output version file
        /// </summary>
        /// <param name="outfile">Output file name</param>
        /// <param name="resname">Input embedded resource file name</param>
        /// <param name="product">Input product name</param>
        /// <param name="version">Version</param>
        private static void GenerateOutputFromResource(string outfile, string resname, string product, Version version)
        {
            DateTime now = DateTime.Now;
            string filedata = String.Empty;

            // Make sure the destination file isn't read-only if it already exists
            if (File.Exists(outfile)) File.SetAttributes(outfile, FileAttributes.Normal);

            // Load the resoucre file into a string for manipulation
            using (StreamReader sr = new StreamReader(typeof(main).Assembly.GetManifestResourceStream(typeof(main), resname)))
            {
                filedata = sr.ReadToEnd();
            }

            //
            // REPLACEMENT STRINGS - ADD AS MANY HERE AS YOU WANT
            //

            filedata = filedata.Replace("%%PRODUCTNAME%%", product);
            filedata = filedata.Replace("%%VERSION%%", version.ToString(4));
            filedata = filedata.Replace("%%YYYY%%", now.ToString("yyyy"));
            filedata = filedata.Replace("%%VERSIONMAJOR%%", version.Major.ToString());
            filedata = filedata.Replace("%%VERSIONMINOR%%", version.Minor.ToString());
            filedata = filedata.Replace("%%VERSIONBUILD%%", version.Build.ToString());
            filedata = filedata.Replace("%%VERSIONREVISION%%", version.Revision.ToString());
            filedata = filedata.Replace("%%MMDDH%%", now.ToString("Mdd") + Math.Floor(now.Hour / 2.5).ToString());

            // Write the modified resoucre file out to disk as the new version file
            using(StreamWriter sw = new StreamWriter(File.Open(outfile, FileMode.Create, FileAccess.Write, FileShare.None)))
            {
                sw.Write(filedata);
                sw.Flush();
            }
        }
Esempio n. 24
0
        public static string GetRToolsPath(Version rToolsVersion)
        {
            if (Platform.GetPlatform() != System.PlatformID.Win32NT)
                return null;

            if (rToolsVersion == null)
                return null;

            string rToolsPath = null;

            string programRegKey = @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall";
            using (Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(programRegKey))
            {
                foreach (string subKey_name in key.GetSubKeyNames())
                {
                    using (Microsoft.Win32.RegistryKey subKey = key.OpenSubKey(subKey_name))
                    {
                        if (subKey.GetValueNames().Contains("DisplayName") && subKey.GetValue("DisplayName").ToString().Contains("Rtools " + rToolsVersion.ToString()))
                        {
                            if (subKey.GetValueNames().Contains("InstallLocation"))
                                rToolsPath = subKey.GetValue("InstallLocation").ToString();
                        }
                    }
                }
            }

            return rToolsPath;
        }
Esempio n. 25
0
        internal UpdateManager(string packageId, Version currentVersion, IPackageRepository packageRepository, string appPathBase, string nuGetCachePath)
        {
            _packageId = packageId;
            _currentVersion = currentVersion;
            _packageRepository = packageRepository;
            _pathProvider = new PathProvider(packageId, appPathBase, nuGetCachePath);

            _logger.Debug("Package id:      " + packageId);
            _logger.Debug("Current version: " + (currentVersion != null ? currentVersion .ToString() : "<none>"));
            try {
                _logger.Debug("Package source:  " + packageRepository.Source);
            } catch (System.Net.WebException) {
                _logger.Warn("Package source:  accessing packageRepository.Source failed, assuming the nuget feed isn't available");
            }
            _logger.Debug("Target folder:   " + _pathProvider.AppPathBase);
            _logger.Debug("Cache folder:    " + _pathProvider.NuGetCachePath);

            Environment.SetEnvironmentVariable("NuGetCachePath", _pathProvider.NuGetCachePath);

            var progressProvider = _packageRepository as IProgressProvider;
            if (progressProvider != null) {
                progressProvider.ProgressAvailable += ProgressProviderOnProgressAvailable;
            }

            var httpClientEvents = _packageRepository as IHttpClientEvents;
            if (httpClientEvents != null) {
                httpClientEvents.SendingRequest += (sender, args) => _logger.Info("requesting {0}", args.Request.RequestUri);
            }
        }
Esempio n. 26
0
        private static void WriteCopyright()
        {
            Assembly executingAssembly = Assembly.GetExecutingAssembly();

            System.Version version = executingAssembly.GetName().Version;

            string productName   = "NUnit";
            string copyrightText = "Copyright (C) 2002-2007 Charlie Poole.\r\nCopyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.\r\nCopyright (C) 2000-2002 Philip Craig.\r\nAll Rights Reserved.";

            object[] objectAttrs = executingAssembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false);
            if (objectAttrs.Length > 0)
            {
                productName = ((AssemblyProductAttribute)objectAttrs[0]).Product;
            }

            objectAttrs = executingAssembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
            if (objectAttrs.Length > 0)
            {
                copyrightText = ((AssemblyCopyrightAttribute)objectAttrs[0]).Copyright;
            }

            Console.WriteLine(String.Format("{0} version {1}", productName, version.ToString(3)));
            Console.WriteLine(copyrightText);
            Console.WriteLine();

            Console.WriteLine("Runtime Environment - ");
            RuntimeFramework framework = RuntimeFramework.CurrentFramework;

            Console.WriteLine(string.Format("   OS Version: {0}", Environment.OSVersion));
            Console.WriteLine(string.Format("  CLR Version: {0} ( {1} )",
                                            Environment.Version, framework.GetDisplayName()));

            Console.WriteLine();
        }
Esempio n. 27
0
        public void DeletePackage(RequestContext context)
        {
            // Only accept delete requests
            if (!context.HttpContext.Request.HttpMethod.Equals("DELETE", StringComparison.OrdinalIgnoreCase))
            {
                context.HttpContext.Response.StatusCode = 404;
                return;
            }

            // Extract route values
            RouteData routeData = context.RouteData;

            // Extract the apiKey, packageId and make sure the version if a valid version string
            // (fail to parse if it's not)
            string feedIdentifier = routeData.GetRequiredString("feedIdentifier");
            string apiKey = routeData.GetRequiredString("apiKey");
            string packageId = routeData.GetRequiredString("packageId");
            Version version = new Version(routeData.GetRequiredString("version"));

            // Authenticate
            if (!feedSecurity.Authenticate(context.HttpContext, feedIdentifier, apiKey))
            {
                return;
            }

            packageRepository.DeletePackage(feedIdentifier, packageId, version.ToString());

            // Evict the cache
            var cacheService = System.Web.Mvc.DependencyResolver.Current.GetService(typeof(ICacheService)) as ICacheService;
            cacheService.Remove(string.Format("packages_{0}", feedIdentifier));
        }
        private void CheckVersionForm_Load(object sender, EventArgs e)
        {
            Version serverVer = new Version(1, 0, 0, 0);
            ManifestResolver r = new ManifestResolver(Program.UpdateURL, VersionOption.Stable);
            try
            {
                r.Resolve();
                serverVer = r.ReleaseManifest.Version;
            }
            catch
            {
            }

            lblLastest.Text = "最新版本 : " + serverVer;

            Version localVersion = new Version("1.0.0.0");
            try
            {
                ReleaseManifest rm = new ReleaseManifest();
                rm.Load(Path.Combine(Application.StartupPath, "release.xml"));
                localVersion = rm.Version;
            }
            catch
            {
                localVersion = MainForm.Version;
            }
            lblCurrent.Text = "目前版本 : " + localVersion.ToString();
        }
		private void FormCentralManager_Load(object sender,EventArgs e) {
			IsStartingUp=true;
			if(!GetConfigAndConnect()){
				return;
			}
			Cache.Refresh(InvalidType.Prefs);
			Version storedVersion=new Version(PrefC.GetString(PrefName.ProgramVersion));
			Version currentVersion=Assembly.GetAssembly(typeof(Db)).GetName().Version;
			if(storedVersion.CompareTo(currentVersion)!=0){
				MessageBox.Show("Program version: "+currentVersion.ToString()+"\r\n"
					+"Database version: "+storedVersion.ToString()+"\r\n"
					+"Versions must match.  Please manually connect to the database through the main program in order to update the version.");
				Application.Exit();
				return;
			}
			if(PrefC.GetString(PrefName.CentralManagerPassHash)!=""){
				FormCentralPasswordCheck formC=new FormCentralPasswordCheck();
				formC.ShowDialog();
				if(formC.DialogResult!=DialogResult.OK){
					Application.Exit();
					return;
				}
			}
			FillGrid();
			IsStartingUp=false;
		}
Esempio n. 30
0
        private static IEnumerable<string> GetGacAssemblyPaths(string gacPath, string name, Version version, string publicKeyToken)
        {
            if (version != null && publicKeyToken != null)
            {
                yield return Path.Combine(gacPath, name, version + "__" + publicKeyToken, name + ".dll");
                yield break;
            }

            var gacAssemblyRootDir = new DirectoryInfo(Path.Combine(gacPath, name));
            if (!gacAssemblyRootDir.Exists)
            {
                yield break;
            }

            foreach (var assemblyDir in gacAssemblyRootDir.GetDirectories())
            {
                if (version != null && !assemblyDir.Name.StartsWith(version.ToString(), StringComparison.Ordinal))
                {
                    continue;
                }

                if (publicKeyToken != null && !assemblyDir.Name.EndsWith(publicKeyToken, StringComparison.Ordinal))
                {
                    continue;
                }

                var assemblyPath = Path.Combine(assemblyDir.ToString(), name + ".dll");
                if (File.Exists(assemblyPath))
                {
                    yield return assemblyPath;
                }
            }
        }
Esempio n. 31
0
        private static void WriteCopyright()
        {
            Assembly executingAssembly = Assembly.GetExecutingAssembly();

            System.Version version = executingAssembly.GetName().Version;

            object[] objectAttrs = executingAssembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false);
            AssemblyProductAttribute productAttr = (AssemblyProductAttribute)objectAttrs[0];

            objectAttrs = executingAssembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
            AssemblyCopyrightAttribute copyrightAttr = (AssemblyCopyrightAttribute)objectAttrs[0];

            Console.WriteLine(String.Format("{0} version {1}", productAttr.Product, version.ToString(3)));
            Console.WriteLine(copyrightAttr.Copyright);
            Console.WriteLine();

            Console.WriteLine("Runtime Environment - ");
            RuntimeFramework framework = RuntimeFramework.CurrentFramework;

            Console.WriteLine(string.Format("   OS Version: {0}", Environment.OSVersion));
            Console.WriteLine(string.Format("  CLR Version: {0} ( {1} )",
                                            Environment.Version, framework.GetDisplayName()));

            Console.WriteLine();
        }
Esempio n. 32
0
 public static void DACPlaying(DACPlayInfo playInfo, PPTVData.Entity.ChannelDetailInfo channelInfo,Version clientVersion)
 {
     string content = "Action=0&A=" + playInfo.castType.ToString() + "&B=1&C=6&D=" + GetUserId() + "&E=";
     content += (clientVersion==null?"":clientVersion.ToString());
     content += "&F=" + channelInfo.TypeID.ToString();
     content += "&G=" + channelInfo.VID.ToString();
     content += "&H=" + channelInfo.Title;
     content += "&I=" + playInfo.playTime.ToString("0");
     content += "&J=" + playInfo.mp4Name;
     content += "&K=" + playInfo.programSource.ToString();
     content += "&L=" + playInfo.prepareTime.ToString("0");
     content += "&M=" + playInfo.bufferTime.ToString("0");
     content += "&N=" + playInfo.allBufferCount.ToString();
     content += "&O=" + playInfo.dragCount.ToString();
     content += "&P=" + playInfo.dragBufferTime.ToString("0");
     content += "&Q=" + playInfo.playBufferCount.ToString();
     content += "&R=" + playInfo.connType.ToString();
     content += "&S=" + playInfo.isPlaySucceeded.ToString();
     content += "&T=";
     content += "&U=";
     content += "&V=" + playInfo.averageDownSpeed.ToString();
     content += "&W=" + playInfo.stopReason.ToString();
     content += "&Y1=0";
     content += "&Y2=" + DeviceExtendedProperties.GetValue("DeviceName").ToString();
     content += "&Y3=" + System.Environment.OSVersion.Version.ToString();
     _instance = new DACFactory();
     _instance.DACSend(content);
 }
Esempio n. 33
0
        private bool WriteVersionToFile()
        {
            System.Version version = new System.Version(_major, _minor, _build, _revision);
            Log.LogMessage(MessageImportance.Low, Properties.Resources.VersionModifiedValue, version.ToString());

            if (String.IsNullOrEmpty(_versionFile))
            {
                return(true);
            }

            try
            {
                File.WriteAllText(_versionFile, version.ToString());
            }
            catch (Exception ex)
            {
                Log.LogError(Properties.Resources.VersionWriteException,
                             _versionFile, ex.Message);
                return(false);
            }

            Log.LogMessage(MessageImportance.Low, Properties.Resources.VersionWrote, _versionFile);

            return(true);
        }
Esempio n. 34
0
        public Form1()
        {
            InitializeComponent();

            timer_rss.Start();

            for (int i = 0; i < SingleCPUManager.GetCPUCount(); i++)
            {
                SingleCPUList.Add(new SingleCPUManager(i, 200, 4, 30));
            }

            //バージョンの取得
            System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
            System.Version             ver = asm.GetName().Version;
            label_version.Text = $"Assembly Version {ver.ToString()}";

            // 最大化
            this.WindowState = FormWindowState.Maximized;

            // 「埋め込みリソース」から画像を取得
            System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();

            Icon1 = new Bitmap(myAssembly.GetManifestResourceStream(@"SimScreenSaver.img.v2-02.png"));
            Icon2 = new Bitmap(myAssembly.GetManifestResourceStream(@"SimScreenSaver.img.v2-03.png"));
            Icon3 = new Bitmap(myAssembly.GetManifestResourceStream(@"SimScreenSaver.img.v2-04.png"));
            Icon4 = new Bitmap(myAssembly.GetManifestResourceStream(@"SimScreenSaver.img.v2-05.png"));
            Icons = new Bitmap[] { Icon1, Icon2, Icon3, Icon4 };
        }
Esempio n. 35
0
        public override HealthCheck Check()
        {
            if (OsInfo.IsWindows)
            {
                return new HealthCheck(GetType());
            }

            var versionString = _runtimeInfo.RuntimeVersion;
            var versionMatch = VersionRegex.Match(versionString);

            if (versionMatch.Success)
            {
                var version = new Version(versionMatch.Groups["version"].Value);

                if (version == new Version(3, 4, 0) && HasMonoBug18599())
                {
                    _logger.Debug("mono version 3.4.0, checking for mono bug #18599 returned positive.");
                    return new HealthCheck(GetType(), HealthCheckResult.Error, "your mono version 3.4.0 has a critical bug, you should upgrade to a higher version");
                }

                if (version == new Version(4, 4, 0) || version == new Version(4, 4, 1))
                {
                    _logger.Debug("mono version {0}", version);
                    return new HealthCheck(GetType(), HealthCheckResult.Error, $"your mono version {version} has a bug that causes issues connecting to indexers/download clients");
                }

                if (version >= new Version(3, 10))
                {
                    _logger.Debug("mono version is 3.10 or better: {0}", version.ToString());
                    return new HealthCheck(GetType());
                }
            }

            return new HealthCheck(GetType(), HealthCheckResult.Warning, "mono version is less than 3.10, upgrade for improved stability");
        }
Esempio n. 36
0
        private void InitSettings()
        {
            // Initialize settings
            if (!ApplicationData.Current.LocalSettings.Values.ContainsKey("HtmlFontSize"))
            {
                ApplicationData.Current.LocalSettings.Values.Add("HtmlFontSize", "DefaultHtmlFontSize");
            }

            if (!ApplicationData.Current.LocalSettings.Values.ContainsKey("BoolLoadImages"))
            {
                ApplicationData.Current.LocalSettings.Values.Add("BoolLoadImages", false);
            }

            //Setting controls
            var rb = this.FindName(ApplicationData.Current.LocalSettings.Values["HtmlFontSize"].ToString()) as RadioButton;
            rb.IsChecked = true;

            tsImageLoad.IsOn = Boolean.Parse(ApplicationData.Current.LocalSettings.Values["BoolLoadImages"].ToString());

            Version version = new Version(Package.Current.Id.Version.Major,
                Package.Current.Id.Version.Minor,
                Package.Current.Id.Version.Build,
                Package.Current.Id.Version.Revision);

            tbPackageVersion.Text = version.ToString();
        }
 public string resolve_version()
 {
     string version = "0";
     Version ver = new Version();
     
     if (file_system.directory_exists(up_folder))
     {
         var files = file_system.get_directory_info_from(up_folder)
             .GetFiles("*." + extension).OrderBy(x => x.Name);
         long max = 0;
         foreach (var file in files)
         {
             string fileName = Path.GetFileNameWithoutExtension(file.Name);
             if (fileName.Contains("_")) fileName = fileName.Substring(0, fileName.IndexOf("_"));
             if (fileName.Contains(".")) //using ##.##.##_description.sql format
             {
                 Version tmp = new Version(fileName);
                 if (tmp > ver)
                 {
                     ver = tmp;
                     version = ver.ToString();
                 }
             }
             else //using ###_description.sql format
             {
                 long fileNumber = 0;
                 long.TryParse(fileName, out fileNumber);
                 max = Math.Max(max, fileNumber);
                 version = max.ToString();
             }
         }
         Log.bound_to(this).log_an_info_event_containing(" Found version {0} from up directory.", version);
     }
     return version;
 }
Esempio n. 38
0
        private void GetInfo()
        {
            if (this.assembly != null)
            {
                this.outputItems = new List <ITaskItem>();
                ITaskItem t = new TaskItem(this.NetAssembly.GetMetadata("FileName"));

                // get the PublicKeyToken
                byte[]        pt = this.assembly.GetName().GetPublicKeyToken();
                StringBuilder s  = new System.Text.StringBuilder();
                for (int i = 0; i < pt.GetLength(0); i++)
                {
                    s.Append(pt[i].ToString("x2", CultureInfo.InvariantCulture));
                }

                // set some other metadata items
                t.SetMetadata("PublicKeyToken", s.ToString());
                t.SetMetadata("FullName", this.assembly.GetName().FullName);
                t.SetMetadata("Culture", this.assembly.GetName().CultureInfo.Name);
                t.SetMetadata("CultureDisplayName", this.assembly.GetName().CultureInfo.DisplayName);
                t.SetMetadata("AssemblyVersion", this.assembly.GetName().Version.ToString());

                // get the assembly file version
                FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(this.assembly.Location);
                System.Version  v           = new System.Version(versionInfo.FileMajorPart, versionInfo.FileMinorPart, versionInfo.FileBuildPart, versionInfo.FilePrivatePart);
                t.SetMetadata("FileVersion", v.ToString());
                this.outputItems.Add(t);
            }
        }
Esempio n. 39
0
        protected PluginBase(Version version)
        {
            ChampName = Player.ChampionName;
            Version   = version;

            Game.PrintChat("Sigma" + ChampName + " Loaded. Version: " + Version.ToString() + " - By Fluxy");

            Utility.DelayAction.Add(250, () =>
            {
                SpellList.Add(Q);
                SpellList.Add(W);
                SpellList.Add(E);
                SpellList.Add(R);
            });

            Hydra  = new Items.Item(3074, 175f);
            Tiamat = new Items.Item(3077, 175f);
            DFG    = new Items.Item(3128, 750f);


            IgniteSlot = Player.GetSpellSlot("SummonerDot");

            createConfigs();
            eventsLoad();
            extraEvents();
            addOW();
        }
Esempio n. 40
0
 public static string GetVersion(string fileVersionText)
 {
     var fileVersion = new Version(fileVersionText);
     var version = new Version(fileVersion.Major, fileVersion.Minor);
     var text = version.ToString();
     return text;
 }
Esempio n. 41
0
 /// <summary>
 /// バージョンを取得する
 /// </summary>
 /// <returns></returns>
 public static string GetVersion()
 {
     System.Reflection.Assembly     assembly = Assembly.GetExecutingAssembly();
     System.Reflection.AssemblyName asmName  = assembly.GetName();
     System.Version version = asmName.Version;
     return(version.ToString());
 }
Esempio n. 42
0
    //static bool versionError = false;

    //private FSGUIPopup warningPopup;
    //private string KSPversion = string.Empty;
    //private string expectedVersion = string.Empty;

    //public void Start()
    public static bool IsCompatible()
    {
        //string KSPversion = Versioning.version_major + "." + Versioning.version_minor + "." + Versioning.Revision;
        //string expectedVersion = CompatibleWithMajor + "." + CompatibleWithMinor + "." + CompatibleWithRevision;

        //Debug.Log("Firespitter version check. KSP version: " + KSPversion);

        FSversion = Assembly.GetExecutingAssembly().GetName().Version;

        Debug.Log("firespitter.dll version: " + FSversion.ToString() + ", compiled for KSP " + CompatibleWithMajor + "." + CompatibleWithMinor + "." + CompatibleWithRevision);

        if (Versioning.version_major != CompatibleWithMajor
            ||
            Versioning.version_minor != CompatibleWithMinor
            ||
            Versioning.Revision != CompatibleWithRevision)
        {
            //warnPlayer();
            return(false);
        }
        else
        {
            return(true);
        }
    }
        /// <summary>
        /// Gets the number of commits in the longest single path between
        /// the specified commit and the most distant ancestor (inclusive)
        /// that set the version to the value at <paramref name="commit"/>.
        /// </summary>
        /// <param name="commit">The commit to measure the height of.</param>
        /// <param name="repoRelativeProjectDirectory">The repo-relative project directory for which to calculate the version.</param>
        /// <param name="baseVersion">Optional base version to calculate the height. If not specified, the base version will be calculated by scanning the repository.</param>
        /// <returns>The height of the commit. Always a positive integer.</returns>
        internal static int GetVersionHeight(this Commit commit, string repoRelativeProjectDirectory = null, Version baseVersion = null)
        {
            Requires.NotNull(commit, nameof(commit));
            Requires.Argument(repoRelativeProjectDirectory == null || !Path.IsPathRooted(repoRelativeProjectDirectory), nameof(repoRelativeProjectDirectory), "Path should be relative to repo root.");

            var tracker = new GitWalkTracker(repoRelativeProjectDirectory);

            var versionOptions = tracker.GetVersion(commit);

            if (versionOptions == null)
            {
                return(0);
            }

            var baseSemVer =
                baseVersion != null?SemanticVersion.Parse(baseVersion.ToString()) :
                    versionOptions.Version ?? SemVer0;

            var versionHeightPosition = versionOptions.VersionHeightPosition;

            if (versionHeightPosition.HasValue)
            {
                int height = commit.GetHeight(repoRelativeProjectDirectory, c => CommitMatchesVersion(c, baseSemVer, versionHeightPosition.Value, tracker));
                return(height);
            }

            return(0);
        }
Esempio n. 44
0
        private void UpdateToVersion(List list, System.Version metaPackShemaVersion)
        {
            var context = list.Context;

            if (metaPackShemaVersion <= new System.Version(0, 1, 5, 0))
            {
                AddTextField(list, "PackageId", "Package Id");
                AddTextField(list, "PackageVersion", "Version");
                AddMultiLineTextField(list, "PackageNuspecXml", "NuspecXml");
            }

            var rootFolder = list.RootFolder;

            context.Load(rootFolder);
            context.Load(rootFolder, f => f.Properties);

            context.ExecuteQuery();

            var properties = rootFolder.Properties;

            properties[schemaKey] = metaPackShemaVersion.ToString();
            rootFolder.Update();

            context.ExecuteQuery();
        }
Esempio n. 45
0
 internal static string GetProductNameAndVersion()
 {
     string name = Application.ProductName;
     int revision = new Version(Application.ProductVersion).Revision;
     string name_and_version = name.Insert(name.IndexOf(')'), ", revision " + revision.ToString());
     return name_and_version;
 }
        /// <summary>
        /// Handles the migrations by using reflection to grab instances of MigrationBase.
        /// </summary>
        /// <param name="currentVersion">The current version.</param>
        internal static void HandleMigrations(Version currentVersion)
        {
            LogHelper.Info<MigrationHelper>("Handling migrations based on current version =>" + currentVersion.ToString());

            var migrations = typeof(MigrationBase)
                .Assembly.GetTypes()
                .Where(t => t.IsSubclassOf(typeof(MigrationBase)) && !t.IsAbstract)
                .Select(t => (MigrationBase)Activator.CreateInstance(t))
                .OrderBy(x => x.TargetVersion);

            LogHelper.Info<MigrationHelper>("Total Migrations=>" + migrations.Count());

            foreach (var migration in migrations)
            {
                LogHelper.Info<MigrationHelper>("Examining migration =>" + migration.TargetVersion);

                if (migration.TargetVersion > currentVersion)
                {
                    LogHelper.Info<MigrationHelper>("Executing...");

                    try
                    {
                        migration.Excecute();
                    }
                    catch (Exception ex)
                    {
                        LogHelper.Error<MigrationHelper>("Migration failed: " + migration.GetType() + "\n" + ex.Message, ex);
                    }
                }
                else
                {
                    LogHelper.Info<MigrationHelper>("Skipped.");
                }
            }
        }
Esempio n. 47
0
        public static void Check()
        {
            try
            {
                using (var wb = new System.Net.WebClient())
                {
                    var raw = wb.DownloadString("https://raw.githubusercontent.com/011110001/EnsoulSharp/master/Zed%20is%20Back%20Bitches/Version.txt");

                    System.Version Version = Assembly.GetExecutingAssembly().GetName().Version;

                    if (raw != Version.ToString())
                    {
                        Chat.Print("<font color=\"#ff0000\">Zed is Back Bitches is outdated! Please update to {0}!</font>", raw);
                    }
                    else
                    {
                        Chat.Print("<font color=\"#ff0000\">Zed is Back Bitches is updated! Version : {0}!</font>", Version.ToString());
                    }
                }
            }
            catch
            {
                Chat.Print("<font color=\"#ff0000\">Failed to verify script version!</font>");
            }
        }
Esempio n. 48
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="json"></param>
        /// <returns></returns>
        public string Upgrade(string json)
        {
            // Determine the latest version supported by this upgrader
            List <System.Version> knownVersions = new List <System.Version>();

            foreach (var u in upgraders)
            {
                knownVersions.Add(System.Version.Parse(u.Key));
            }
            System.Version latestVersion = knownVersions.Max(x => x);


            // Determine the version of the data
            JObject j            = JObject.Parse(json);
            JToken  versionToken = j.SelectToken("jCSET_VERSION[0].Version_Id");

            if (versionToken == null)
            {
                throw new ApplicationException("Version could not be identifed corrupted assessment json");
            }
            System.Version version = ConvertFromStringToVersion(versionToken.Value <string>());


            while (version < latestVersion)
            {
                ICSETJSONFileUpgrade fileUpgrade = upgraders[version.ToString()];
                if (fileUpgrade != null)
                {
                    json    = fileUpgrade.ExecuteUpgrade(json);
                    version = fileUpgrade.GetVersion();
                }
            }
            return(json);
        }
Esempio n. 49
0
        private static void CheckVersion(UnityEditor.PackageManager.PackageInfo p)
        {
            SRP_VERSION = p.version.Replace("-preview", string.Empty);
            curVersion  = new System.Version(SRP_VERSION);

            LATEST_COMPATIBLE_VERSION = latestVersion.ToString();
            latestVersion             = new System.Version(p.versions.latestCompatible);

            MIN_SRP_VERSION = minVersion.ToString();

            //Within range of minimum and maximum versions
            if (curVersion >= minVersion && curVersion <= maxVersion)
            {
                VersionStatus = Version.Compatible;
            }
            //Outside range of compatible versions
            if (curVersion < minVersion || curVersion > maxVersion)
            {
                VersionStatus = Version.Incompatible;
            }
            if (curVersion < minVersion)
            {
                VersionStatus = Version.Outdated;
            }

            //HDRP isn't supported from 2018.3+ and will not be
            if (p.name == HDRP_PACKAGE_ID)
            {
                VersionStatus = Version.Incompatible;
            }

#if SCPE_DEV
            Debug.Log("<b>SRP Installation</b> " + p.name + " " + SRP_VERSION + " Installed (" + VersionStatus + ")");
#endif
        }
 internal static void SetEngineVersion(Version version)
 {
     if (version != null)
     {
         engineVersion = version.ToString();
     }
 }
Esempio n. 51
0
 public static void SetVersion(System.Version version)
 {
     Data.GlobalDb.GlobalSetting.AddOrUpdate(new Data.Models.GlobalSetting()
     {
         Name = "Version", Values = version.ToString()
     });
 }
Esempio n. 52
0
        public void Save()
        {
            try
            {
                ConfigNode node = HISTORIANCFG.Node;

                node.SetValue("Version", CurrentVersion.ToString(), true);
                node.SetValue("Layout", Layout, true);
                node.SetValue("EnableLauncherButton", EnableLauncherButton, true);
                node.SetValue("EnableToolbarButton", EnableToolbarButton, true);
                node.SetValue("AutoHideUI", AutoHideUI, true);
                node.SetValue("CustomText", CustomText, true);
                node.SetValue("PersistentCustomText", PersistentCustomText, true);
                node.SetValue("PersistentConfigurationWindow", PersistentConfigurationWindow, true);
                node.SetValue("DefaultSpaceCenterName", DefaultSpaceCenterName, true);
                node.SetValue("TimeToRememberLastAction", TimeToRememberLastAction, true);
                node.SetValue("KerbinDayNames", string.Join(";", KerbinDayNames), true);
                node.SetValue("KerbinMonthNames", string.Join(";", KerbinMonthNames), true);
                node.SetValue("RightClickAction", RightClickAction.ToString(), true);
                node.SetValue("DefaultNoCrewLabel", DefaultNoCrewLabel, true);
                node.SetValue("DefaultUnmannedLabel", DefaultUnmannedLabel, true);

                HISTORIANCFG.Save();

                Historian.Print($"Configuration saved at '{HISTORIANCFG.KspPath}'.");
            }
            catch
            {
                Historian.Print($"Failed to save configuration file '{HISTORIANCFG}'.");
            }
        }
Esempio n. 53
0
 public AppInfoPage()
 {
     InitializeComponent(); System.Reflection.Assembly assembly = Assembly.GetExecutingAssembly();
     System.Reflection.AssemblyName asmName = assembly.GetName();
     System.Version versions = asmName.Version;
     version.Text = "Version V." + versions.ToString();
 }
Esempio n. 54
0
        public override HealthCheck Check()
        {
            if (!OsInfo.IsMono)
            {
                return new HealthCheck(GetType());
            }

            var output = _processProvider.StartAndCapture("mono", "--version");

            foreach (var line in output.Standard)
            {
                var versionMatch = VersionRegex.Match(line);

                if (versionMatch.Success)
                {
                    var version = new Version(versionMatch.Groups["version"].Value);

                    if (version >= new Version(3, 2))
                    {
                        _logger.Debug("mono version is 3.2 or better: {0}", version.ToString());
                        return new HealthCheck(GetType());
                    }
                }
            }

            return new HealthCheck(GetType(), HealthCheckResult.Warning, "mono version is less than 3.2, upgrade for improved stability");
        }
Esempio n. 55
0
 /// <summary>
 /// Get Porting Kit registry record
 /// </summary>
 /// <param name="keySubPath">Путь ключа</param>
 /// <param name="key">Ключ</param>
 /// <returns></returns>
 public static string GetPortingKitRegistryValue(string keySubPath, string key)
 {
     try
     {
         System.Version version = Assembly.GetEntryAssembly().GetName().Version;
         using (RegistryKey key2 = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\.NETMicroFrameworkPortingKit"))
         {
             if (key2 == null)
             {
                 return("xxxxx-xxx-xxxxxxx-xxxxx");
             }
             System.Version version2 = new System.Version(0, 0, 0, 0);
             System.Version version3 = new System.Version(0, 0, 0, 0);
             foreach (string str in key2.GetSubKeyNames())
             {
                 if (str.Length >= 2)
                 {
                     System.Version version4 = new System.Version(str.Substring(1));
                     if ((version4.Major == version.Major) && (version4 > version3))
                     {
                         version3 = version4;
                     }
                     if (version4 > version2)
                     {
                         version2 = version4;
                     }
                 }
             }
             string str3 = null;
             if (version3.Major != 0)
             {
                 str3 = "v" + version3.ToString();
             }
             else if (version2.Major != 0)
             {
                 str3 = "v" + version2.ToString();
             }
             if (!string.IsNullOrEmpty(str3))
             {
                 string name = str3 + @"\" + keySubPath;
                 using (RegistryKey key3 = key2.OpenSubKey(name))
                 {
                     if (key3 == null)
                     {
                         return("xxxxx-xxx-xxxxxxx-xxxxx");
                     }
                     return((string)key3.GetValue(key));
                 }
             }
         }
     }
     catch (FormatException)
     {
     }
     catch (ArgumentException)
     {
     }
     return(null);
 }
Esempio n. 56
0
 internal TypeLib(Guid tlbId, System.Version version, string helpDirectory, int resourceId, int flags)
 {
     this.tlbid         = tlbId.ToString("B");
     this.version       = version.ToString(2);
     this.helpDirectory = helpDirectory;
     this.resourceid    = Convert.ToString(resourceId, 0x10);
     this.flags         = FlagsFromInt(flags);
 }
Esempio n. 57
0
        private void AboutForm_Load(object sender, System.EventArgs e)
        {
            // Set defaults:
            System.Version version         = Assembly.GetExecutingAssembly().GetName().Version;
            DateTime       compileDateTime = new DateTime(2000, 1, 1).AddDays(version.Build).AddSeconds(version.Revision * 2);

            labelVersion.Text = "v" + version.ToString() + " (" + compileDateTime.ToString() + ")";
        }
Esempio n. 58
0
        /// <summary>
        /// フォームロード時
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form1_Load(object sender, EventArgs e)
        {
            System.Reflection.Assembly     assembly = System.Reflection.Assembly.GetExecutingAssembly();
            System.Reflection.AssemblyName asmName  = assembly.GetName();
            System.Version version = asmName.Version;

            this.Text = Application.ProductName + " Ver." + version.ToString();
        }
Esempio n. 59
0
        private void About_Load(object sender, EventArgs e)
        {            
            System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            this.mobjLabelVersion.Text = String.Format(this.mobjLabelVersion.Text, version.ToString(), Gizmox.WebGUI.WGConst.Version.ToString());

            SetCredits();
        }
Esempio n. 60
0
        private void SetVersionInfo()
        {
            //自分自身のAssemblyを取得
            Assembly asm = Assembly.GetExecutingAssembly();

            //バージョンの取得
            System.Version ver = asm.GetName().Version;
            Version.Content = "ver." + ver.ToString();
        }