Beispiel #1
0
        public AboutViewModel(IUnityContainer uc, IDialogService dialog) : base(dialog)
        {
            _uc = uc;
            string   info = string.Empty;
            Assembly asm  = Assembly.GetExecutingAssembly();
            //info = asm.FullName;
            string svnInfo = string.Empty;

            object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), true);
            if (attributes.Length > 0)
            {
                AssemblyDescriptionAttribute descriptionAttribute = attributes[0] as AssemblyDescriptionAttribute;
                svnInfo = descriptionAttribute.Description;
            }

            var prod = new ProductInfo(); // .VersionInfo;

            _productInfo = prod.VersionInfo.Title + ", Open Source Version";
            _releaseInfo = prod.VersionInfo.Version; // ProductInfo.GetTfsInfoString();
            _versionInfo = prod.VersionInfo.Version; // GetRunningVersion();

            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                _versionInfo = string.Format($"{ad.CurrentVersion.Major}.{ad.CurrentVersion.Minor}.{ad.CurrentVersion.Build}.{ad.CurrentVersion.Revision}");
            }

            _NugetPackages         = new BindingList <NugetPackage>(new NugetPackages().Packages);
            _IsNewReleaseAvailable = prod.IsNewReleaseAvailable;
            _NewVersion            = $"Neue Version {prod.LatestVersion} verfügbar:";
        }
Beispiel #2
0
        public Form1()
        {
            InitializeComponent();

            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad =
                    System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                this.Text = String.Format("Loot Logger - {0}", ad.CurrentVersion);


                if (Stealth.Client.GetConnectedStatus() == false)
                {
                    MessageBox.Show("Please connect a profile in Stealth and try again.");
                }
            }

            Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Stealth");
            Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Stealth\\LootLogger");
            Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Stealth\\LootLogger\\Export");

            string _myDocuments = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            ScriptsPath = _myDocuments + "\\Stealth\\LootLogger";

            ArmorFilePath   = ScriptsPath + "\\armor.xml";
            JewelryFilePath = ScriptsPath + "\\jewelry.xml";
            WeaponFilePath  = ScriptsPath + "\\weapons.xml";
            ShieldFilePath  = ScriptsPath + "\\shields.xml";

            ArmorExportPath   = ScriptsPath + "\\Export\\armor.xml";
            JewelryExportPath = ScriptsPath + "\\Export\\jewelry.xml";
            WeaponExportPath  = ScriptsPath + "\\Export\\weapons.xml";
            ShieldExportPath  = ScriptsPath + "\\Export\\shields.xml";
        }
        private Settings()
        {
            FirstTime = false;

            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment cd =
                    System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                Version = cd.CurrentVersion.ToString();
            }
            else
            {
                Version = DevelopmentVersion;
            }
            _appVersionFolder = KnownFolders.GetAppVersionFolder(Version);
            //DbCache = new DbCache(AppVersionFolder + "\\ms.video.downloader.settings.sqlite");
            _configuration = GetApplicationConfiguration();

            if (_configuration != null)
            {
                _fileSystem = new S3FileSystem(_configuration.S3AccessKey, _configuration.S3SecretAccessKey, _configuration.S3RegionHost, _configuration.S3BucketName);
                return;
            }
            FirstTime      = true;
            _configuration = new ApplicationConfiguration {
                Guid = Guid.NewGuid(), S3IsActive = false
            };
            SetApplicationConfiguration(_configuration);
            _fileSystem = new S3FileSystem(_configuration.S3AccessKey, _configuration.S3SecretAccessKey, _configuration.S3RegionHost, _configuration.S3BucketName);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                this.Title += " (v. " + ad.CurrentVersion.ToString() + ")";
            }

            this.varsCache.BindWithTextBox("consumer_key", this.consumerKeyTextbox);
            this.varsCache.BindWithTextBox("consumer_secret", this.consumerSecretTextbox);
            this.varsCache.BindWithTextBox("token", this.tokenTextbox);
            this.varsCache.BindWithTextBox("token_secret", this.tokenSecretTextbox);

            /* We use a "mother installation" for the first USOS API request. We need to
             * get a list of all USOS API installations. */

            var motherInstallation = new ApiInstallation
            {
                base_url = "http://apps.usos.edu.pl/" // will change when out of Beta!
            };

            this.apiConnector = new ApiConnector(motherInstallation);
            this.apiConnector.BeginRequest += new EventHandler(apiConnector_BeginRequest);
            this.apiConnector.EndRequest   += new EventHandler(apiConnector_EndRequest);

            /* Fill up the installations list. */

            try
            {
                this.installationsComboBox.Items.Clear();
                var installations = this.apiConnector.GetInstallations();
                installations.Add(new ApiInstallation()
                {
                    base_url = "http://127.0.0.1:8000/"
                });
                foreach (var installation in installations)
                {
                    this.installationsComboBox.Items.Add(new ComboBoxItem
                    {
                        Content = installation.base_url,
                        Tag     = installation
                    });
                }
            }
            catch (WebException)
            {
                MessageBox.Show("Error occured when trying to access USOS API mother server. Could not populate USOS API installations list.",
                                "Network error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }

            if (this.installationsComboBox.Items.Count > 0)
            {
                /* Now we have a list of all installations in a combo box. We choose
                 * one of them. */

                this.installationsComboBox.SelectedIndex = 0;
                this.ReloadInstallation();
            }
        }
Beispiel #5
0
 private void RefreshVersionInfo()
 {
     if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
     {
         System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
         this.lblVersion.Text = ad.CurrentVersion.ToString();
     }
 }
Beispiel #6
0
        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Version version = Version.Parse(Application.ProductVersion);

            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                version = ad.CurrentVersion;
            }
            MessageBox.Show(Application.ProductName + Environment.NewLine + Resources.WfaMain_aboutToolStripMenuItem_Click_Version__ + version + Environment.NewLine, Resources.WfaMain_aboutToolStripMenuItem_Click_Nintex_Workflow_Analyzer);
        }
Beispiel #7
0
        public static string getVersion()
        {
            String versionID = "Debug";

            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                versionID = ad.CurrentVersion.ToString();
            }

            return(versionID);
        }
Beispiel #8
0
 public string program_version()
 {
     if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
     {
         System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
         return("v. " + ad.CurrentVersion.ToString());
     }
     else
     {
         return("Testing");
     }
 }
Beispiel #9
0
 /// <summary>
 /// 取得發行版本資訊
 /// </summary>
 /// <returns></returns>
 string GetProductVersion()
 {
     if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
     {
         System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
         return(ad.CurrentVersion.ToString());
     }
     else
     {
         return("Debug Mode");
     }
 }
Beispiel #10
0
        public AboutDialog()
        {
            InitializeComponent();

            var version = "Develop";

            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                version = ad.CurrentVersion.ToString();
            }

            NameBlock.Text = $"Flexi serial terminal {version}";
        }
        public About()
        {
            InitializeComponent();

            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                txtVersion.Text = ad.CurrentVersion.ToString();
            }
            else
            {
                Assembly        assembly = Assembly.GetExecutingAssembly();
                FileVersionInfo fvi      = FileVersionInfo.GetVersionInfo(assembly.Location);
                txtVersion.Text = fvi.ProductVersion;
            }
        }
Beispiel #12
0
        public About()
        {
            InitializeComponent();

            //  About form just loads readme.txt now.

            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                this.Text = String.Format("About {0} {1}", AssemblyTitle, ad.CurrentVersion);
            }
            else
            {
                this.Text = String.Format("About {0}", AssemblyTitle);
            }

            this.richTextBox1.LoadFile("readme.txt", RichTextBoxStreamType.PlainText);
        }
Beispiel #13
0
        private string GetVersion()
        {
            //// Get the entry point.
            //Assembly entryPoint = Assembly.GetEntryAssembly();

            //// Get the name of the assembly.
            //AssemblyName entryPointName = entryPoint.GetName();

            //// Get the version.
            //Version entryPointVersion = entryPointName.Version;

            string ver = Application.ProductVersion.ToString(CultureInfo.CurrentCulture);

            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad =
                    System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                ver = ad.CurrentVersion.ToString();
            }

            return(ver);
        }
Beispiel #14
0
        private void TwEX_FormEditor_Load(object sender, EventArgs e)
        {
            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment cd = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                string publishVersion = cd.CurrentVersion.ToString();
                Text = "TwEX Trader : Short Armed Trading Tools Version " + publishVersion;
            }
            else
            {
                Text = "TwEX Trader : Short Armed Trading Tools";
            }

            FormPreference preference = FormPreferences.FirstOrDefault(item => item.Name == Name);

            if (preference != null)
            {
                //LogManager.AddLogMessage(Name, "toolStripButton_Form_Click", "FOUND : " + preference.Name + " | " + preference.Font.FontFamily + " | " + preference.Size + " | " + preference.Location);
                SetBounds(preference.Location.X, preference.Location.Y, preference.Size.Width, preference.Size.Height);
                Font = new Font(preference.Font.FontFamily, preference.Font.Size, preference.Font.Style);
            }
            else
            {
                //LogManager.AddLogMessage(Name, "toolStripButton_Form_Click", "NOT FOUND ADDING : " + form.Name + " | " + form.Location);
                UpdateFormPreferences(this, true);
            }

            LocationChanged += delegate { UpdateFormPreferences(this, true); };
            SizeChanged     += delegate { UpdateFormPreferences(this, true); };
            FontChanged     += delegate { UpdateFormPreferences(this, true); };
            FormClosing     += delegate { UpdateFormPreferences(this, false); };

            ContentManager.Initialize();

            Task.Factory.StartNew(() => CryptoCompare.Initialize());
            //LogManager.AddLogMessage(Name, "TwEX_FormEditor_Load", "Load Complete", LogManager.LogMessageType.LOG);
        }
Beispiel #15
0
        private void DisplayVersion()
        {
            var version = string.Format(" {0}", ((System.Reflection.AssemblyFileVersionAttribute)
                                                     (System.Reflection.Assembly.GetExecutingAssembly().
                                                     GetCustomAttributes(typeof(System.Reflection.AssemblyFileVersionAttribute),
                                                                         false)[0])).Version);

            // var a =  Application.ResourceAssembly.GetCustomAttributes;

            Version v     = Assembly.GetExecutingAssembly().GetName().Version;
            string  About = string.Format(CultureInfo.InvariantCulture, @"YourApp Version {0}.{1}.{2} (r{3})", v.Major, v.Minor, v.Build, v.Revision);

            //        var ver = Windows.ApplicationModel.Package.Current.Id.Version;

            //        var attribute = (AssemblyVersionAttribute)Assembly
            //.GetExecutingAssembly()
            //.GetCustomAttributes(typeof(AssemblyVersionAttribute), true)
            //.Single();
            //        var a =  attribute.Version;


            //System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
            //FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
            //string version2 = fvi.FileVersion;

            //System.Deployment.Application.ApplicationDeployment ad =
            //     System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
            //version = string.Format("gggc: {0}", ad.CurrentVersion.ToString());

            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad =
                    System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                version = string.Format(" {0}", ad.CurrentVersion.ToString());
            }
            // Title = "BiG - Grupo Guadiana GC ";

            string strWeek = DateTime.Now.DayOfWeek.ToString();

            CultureInfo ciCurr  = CultureInfo.CurrentCulture;
            int         weekNum = ciCurr.Calendar.GetWeekOfYear(DateTime.Now, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);

            int days     = ciCurr.Calendar.GetDayOfYear(DateTime.Now);
            int leftDays = 0;

            if (ciCurr.Calendar.IsLeapDay(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day))
            {
                leftDays = 366 - days;
            }
            else
            {
                leftDays = 365 - days;
            }
            //return weekNum;

            this.sbiUser.Content     = "Usuario: " + GlobalModule.ActualUserName;
            this.sbiUserName.Content = GlobalModule.ActualName;
            this.sbiDate.Content     = "" + DateTime.Now.ToLongDateString();
            // this.sbiDays.Content = "Semana: " + weekNum.ToString() + "| Dias Transcurridos: " + days.ToString() + " | Quedan: " + leftDays.ToString();
            this.sbiVersion.Content = "Versión: " + version;

            this.sbiIP.Content = "" + GlobalModule.GetLocalIP();

            lblVersion.Content = "versión: " + version;
        }
Beispiel #16
0
        public void CheckForShortcut()
        {
            try
            {
                if (System.Diagnostics.Debugger.IsAttached)
                {
                    return;
                }
                System.Deployment.Application.ApplicationDeployment ad = default(System.Deployment.Application.ApplicationDeployment);
                ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;

                if ((ad.IsFirstRun))
                {
                    System.Reflection.Assembly code = System.Reflection.Assembly.GetExecutingAssembly();
                    string company     = string.Empty;
                    string description = string.Empty;

                    if ((Attribute.IsDefined(code, typeof(System.Reflection.AssemblyCompanyAttribute))))
                    {
                        System.Reflection.AssemblyCompanyAttribute ascompany = null;
                        ascompany = (System.Reflection.AssemblyCompanyAttribute)Attribute.GetCustomAttribute(code, typeof(System.Reflection.AssemblyCompanyAttribute));
                        company   = ascompany.Company;
                    }

                    if ((Attribute.IsDefined(code, typeof(System.Reflection.AssemblyTitleAttribute))))
                    {
                        System.Reflection.AssemblyTitleAttribute asdescription = null;
                        asdescription = (System.Reflection.AssemblyTitleAttribute)Attribute.GetCustomAttribute(code, typeof(System.Reflection.AssemblyTitleAttribute));
                        description   = asdescription.Title;
                    }

                    if ((company != string.Empty & description != string.Empty))
                    {
                        //description = Replace(description, "_", " ")

                        string desktopPath = string.Empty;
                        desktopPath = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "\\", description, ".appref-ms");

                        string shortcutName = string.Empty;
                        shortcutName = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Programs), "\\", company, "\\", description, ".appref-ms");

                        if (!File.Exists(shortcutName))
                        {
                            shortcutName = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Programs), "\\", company, "\\", description, " - 1 .appref-ms");
                        }

                        if (!File.Exists(shortcutName))
                        {
                            shortcutName = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Programs), "\\", company, "\\", description, " - 2 .appref-ms");
                        }

                        System.IO.File.Copy(shortcutName, desktopPath, true);
                    }
                    else
                    {
                        System.Windows.MessageBox.Show("Missing company or description: " + company + " - " + description);
                    }
                }
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(GetErrorText(ex));
            }
        }
        ///
        /// Handles the thread exception.
        ///
        public void Application_ThreadException(
            object sender, ThreadExceptionEventArgs e)
        {
            try
            {
                string fn = "";
                //write exception2 log
                try
                {
                    try
                    {
                        string capt;

                        if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
                        {
                            System.Deployment.Application.ApplicationDeployment ad = System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                            capt = ad.CurrentVersion.ToString();
                        }
                        else
                        {
                            capt = Assembly.GetExecutingAssembly().GetName().Version.ToString() + " (local)";
                        }

                        string err = string.Format("{0};{2}; {1}", DateTime.Now, e.Exception.ToString(), capt);
                        if (ThreadExceptionHandler.SendErrorMessage(err))
                        {
                            fn = "::WWW::";
                        }
                        else
                        {
                            throw new Exception(err);
                        }
                    }
                    catch (Exception excp)
                    {
                        MessageBox.Show(string.Format("error sending data:{0}\n Saving to file...", excp.Message));

                        using (FileStream fs = new FileStream(Properties.Settings.Default.ErrorLogName, FileMode.Append, FileAccess.Write, FileShare.None))
                        {
                            StreamWriter wr = new StreamWriter(fs);
                            wr.WriteLine(DateTime.Now);
                            wr.WriteLine(e.Exception.ToString());
                            wr.WriteLine("-".PadLeft(128, '-'));
                            wr.Flush();
                            wr.Close();
                            fn = fs.Name;
                        }
                    }
                }
                catch { MessageBox.Show("Exception log saving denied!"); }
                // Exit the program if the user clicks Abort.

                DialogResult result = ShowThreadExceptionDialog(e.Exception, (!string.IsNullOrEmpty(fn) ? (fn.Equals("::WWW::")?"Отчёт отправлен разработчику.":string.Format("Отчёт сохранён в {0}", fn)) : "Отчёт не сохранён."));
                if (result == DialogResult.Retry)
                {
                    System.Diagnostics.Process.Start(Application.ExecutablePath);
                    Application.Exit();
                }
                if (result == DialogResult.Abort)
                {
                    Application.Exit();
                }
            }
            catch
            {
                // Fatal error, terminate program

                try
                {
                    MessageBox.Show("Epic fail...",
                                    "Epic fail...",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Stop);
                }
                finally
                {
                    Application.Exit();
                }
            }
        }