Ejemplo n.º 1
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            if (!gridView.SelectedRows.Any())
            {
                return;
            }

            // May not always work
            var tmpl = templates[gridView.SelectedRow];
            var fn   = Path.Combine(templatesDir.FullName, tmpl.Identifier);

            var watch = new Stopwatch();

            using (var p = OpenHelper.OpenProc(fn))
            {
                if (p != null)
                {
                    watch.Start();
                    p.WaitForExit();
                    watch.Stop();
                }
                else
                {
                    MessageBox.Show(T._("Es konnte kein Editor gestartet werden! Bitte öffnen Sie die Datei \"{0}\" in einem Texteditor.", fn), "FPLedit");
                }
            }
            ReloadTemplates();
        }
Ejemplo n.º 2
0
 public ActionResult SaveMsg(string msg)
 {
     try
     {
         var item = new bjf_leavemessage()
         {
             type       = false,
             parentid   = 0,
             message    = msg,
             position   = "",
             createtime = DateTime.Now,
             name       = "匿名",
             browser    = OpenHelper.GetSysVersion(),
             ip         = OpenHelper.GetIp()
         };
         var a = Request.Browser.Version;
         LogHelper.log.Error(a);
         LeaveMsgManager.GetInstance().SaveMsg(item);
         return(Json(new { state = 0, msg = "操作成功" }));
     }
     catch (Exception e)
     {
         LogHelper.log.Debug(e.Message);
         return(Json(new { state = 1, msg = e.Message }));
     }
 }
Ejemplo n.º 3
0
 public void SaveItem(bjf_user submitItem)
 {
     if (submitItem.id == 0)
     {
         submitItem.createid   = 1;
         submitItem.updateid   = 1;
         submitItem.createtime = DateTime.Now;
         submitItem.updatetime = DateTime.Now;
         submitItem.openid     = OpenHelper.CreateOpenId();
         submitItem.password   = EncryAndDecryptHelper.Encryption(submitItem.password);
         submitItem.idcard     = EncryAndDecryptHelper.Encryption(submitItem.idcard);
         submitItem.mobile     = EncryAndDecryptHelper.Encryption(submitItem.mobile);
         this.Add(submitItem);
     }
     else
     {
         var item = this.GetItemById(submitItem.id);
         item.loginname  = submitItem.loginname;
         item.username   = submitItem.username;
         item.password   = EncryAndDecryptHelper.Encryption(submitItem.password);
         item.idcard     = EncryAndDecryptHelper.Encryption(submitItem.idcard);
         item.email      = submitItem.email;
         item.mobile     = EncryAndDecryptHelper.Encryption(submitItem.mobile);
         item.comment    = submitItem.password;
         item.isadmin    = submitItem.isadmin;
         item.updateid   = 1;
         item.updatetime = DateTime.Now;
         this.Update(item);
     }
     this.Save();
 }
Ejemplo n.º 4
0
 private void Button_OnClick(object sender, RoutedEventArgs e)
 {
     if (sender is Button button)
     {
         OpenHelper.OpenUrl(button.Tag.ToString());
     }
 }
Ejemplo n.º 5
0
 private void AmiiboLabel_OnPointerPressed(object sender, PointerPressedEventArgs e)
 {
     if (sender is TextBlock)
     {
         OpenHelper.OpenUrl("https://amiiboapi.com");
     }
 }
Ejemplo n.º 6
0
        private void OpenLogsFolder_Pressed(object sender, EventArgs args)
        {
            string logPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs");

            new DirectoryInfo(logPath).Create();

            OpenHelper.OpenFolder(logPath);
        }
Ejemplo n.º 7
0
        public Control GetControl(IPluginInterface pluginInterface)
        {
            var mg = new UpdateManager(pluginInterface.Settings);

#pragma warning disable CA2000
            var cb = new CheckBox {
                Text = T._("Automatische Überprüfung auf Updates beim Programmstart aktivieren.")
            };
            var privacyTitle = new Label {
                Text = T._("Datenschutz:"), Font = SystemFonts.Bold()
            };
            var label = new Label {
                Text = T._("Dabei wird Ihre IP-Adresse und der verwendete Betriebssystemtyp an den Server übermittelt; Die IP-Adresse wird nur anonymisiert in Log-Dateien gespeichert; ein Rückschluss auf einzelne Benutzer ist daher nicht möglich.")
            };
            var checkButton = new Button {
                Text = T._("Auf neue Version prüfen")
            };
#pragma warning restore CA2000
            var stack = new StackLayout(cb, privacyTitle, label, checkButton)
            {
                Padding     = new Padding(10),
                Orientation = Orientation.Vertical,
                Spacing     = 5
            };
            cb.CheckedBinding.Bind(() => mg.AutoUpdateEnabled, (b) => mg.AutoUpdateEnabled = b ?? false);

            checkButton.Click += (s, e) =>
            {
                mg.CheckResult = (newAvail, vi) =>
                {
                    if (newAvail)
                    {
                        DialogResult res = MessageBox.Show(T._("Eine neue Programmversion ({0}) ist verfügbar!\n{1}\nJetzt zur Download-Seite wechseln, um die neue Version herunterzuladen?", vi.NewVersion, vi.Description ?? ""),
                                                           T._("Neue FPLedit-Version verfügbar"), MessageBoxButtons.YesNo);

                        if (res == DialogResult.Yes)
                        {
                            OpenHelper.Open(vi.DownloadUrl);
                        }
                    }
                    else
                    {
                        MessageBox.Show(T._("Sie benutzen bereits die aktuelle Version!"),
                                        T._("Auf neue Version prüfen"));
                    }
                };
                mg.CheckError = ex =>
                {
                    MessageBox.Show(T._("Verbindung mit dem Server fehlgeschlagen!"),
                                    T._("Auf neue Version prüfen"));
                };

                mg.CheckAsync();
                checkButton.Enabled = false;
            };

            return(stack);
        }
Ejemplo n.º 8
0
        public void SaveItem()
        {
            var submitItem = new bjf_loginlog();

            submitItem.ip         = OpenHelper.GetIp();
            submitItem.userid     = Convert.ToInt32(SessionHelper.GetSession("userid"));
            submitItem.logintime  = DateTime.Now;
            submitItem.createtime = DateTime.Now;
            submitItem.updatetime = DateTime.Now;
            this.Add(submitItem);
            this.Save();
        }
Ejemplo n.º 9
0
 public void SaveItem(bjf_role submitItem)
 {
     if (submitItem.id == 0)
     {
         submitItem.createid   = 1;
         submitItem.updateid   = 1;
         submitItem.createtime = DateTime.Now;
         submitItem.updatetime = DateTime.Now;
         submitItem.openid     = OpenHelper.CreateOpenId();
         this.Add(submitItem);
     }
     else
     {
         var item = this.GetItemById(submitItem.id);
         item.rolename   = submitItem.rolename;
         item.rolecode   = submitItem.rolecode;
         item.isuse      = submitItem.isuse;
         item.updateid   = 1;
         item.updatetime = DateTime.Now;
         this.Update(item);
     }
     this.Save();
 }
Ejemplo n.º 10
0
        private void UploadPartialFile(string fileName, HttpRequestBase request, List <ViewDataUploadFilesResult> statuses)
        {
            if (request.Files.Count != 1)
            {
                throw new HttpRequestValidationException("Attempt to upload chunked file containing more than one fragment per request");
            }
            var file        = request.Files[0];
            var inputStream = file.InputStream;

            var saveName = this.GetSaveName(fileName);
            var fullName = Path.Combine(StorageRoot, saveName);

            using (var fs = new FileStream(fullName, FileMode.Append, FileAccess.Write))
            {
                var buffer = new byte[1024];

                var l = inputStream.Read(buffer, 0, 1024);
                while (l > 0)
                {
                    fs.Write(buffer, 0, l);
                    l = inputStream.Read(buffer, 0, 1024);
                }
                fs.Flush();
                fs.Close();
            }
            statuses.Add(new ViewDataUploadFilesResult()
            {
                openid      = OpenHelper.CreateOpenId(),
                name        = fileName,
                save_name   = saveName,
                size        = file.ContentLength,
                type        = file.ContentType,
                url         = GetHttpFileUrl(saveName),
                delete_url  = Url.Action("Delete?id=" + saveName),
                delete_type = "GET",
            });
        }
Ejemplo n.º 11
0
        private void UploadWholeFile(HttpRequestBase request, List <ViewDataUploadFilesResult> statuses)
        {
            for (int i = 0; i < request.Files.Count; i++)
            {
                var file     = request.Files[i];
                var saveName = this.GetSaveName(file.FileName);

                var fullPath = Path.Combine(StorageRoot, saveName);

                file.SaveAs(fullPath);

                statuses.Add(new ViewDataUploadFilesResult()
                {
                    openid      = OpenHelper.CreateOpenId(),
                    name        = file.FileName,
                    save_name   = saveName,
                    size        = file.ContentLength,
                    type        = file.ContentType,
                    url         = GetHttpFileUrl(saveName),
                    delete_url  = Url.Action("Delete?id=" + saveName),
                    delete_type = "GET",
                });
            }
        }
Ejemplo n.º 12
0
 private void GitHubButton_Pressed(object sender, ButtonPressEventArgs args)
 {
     OpenHelper.OpenUrl("https://github.com/Ryujinx/Ryujinx");
 }
Ejemplo n.º 13
0
 private void FolderButton_Click(object sender, EventArgs e) => OpenHelper.Open(Path.GetDirectoryName(crash_fn));
Ejemplo n.º 14
0
 private void MailButton_Click(object sender, EventArgs e) => OpenHelper.Open("mailto:[email protected]?subject=Bugreport%20FPLedit");
Ejemplo n.º 15
0
 private void ContributorsButton_Pressed(object sender, ButtonPressEventArgs args)
 {
     OpenHelper.OpenUrl("https://github.com/Ryujinx/Ryujinx/graphs/contributors?type=a");
 }
Ejemplo n.º 16
0
 private void TwitterButton_Pressed(object sender, ButtonPressEventArgs args)
 {
     OpenHelper.OpenUrl("https://twitter.com/RyujinxEmu");
 }
Ejemplo n.º 17
0
 private void AmiiboApiButton_Pressed(object sender, ButtonPressEventArgs args)
 {
     OpenHelper.OpenUrl("https://amiiboapi.com");
 }
Ejemplo n.º 18
0
 private void Open_Ryu_Folder(object sender, EventArgs args)
 {
     OpenHelper.OpenFolder(AppDataManager.BaseDirPath);
 }
Ejemplo n.º 19
0
 private void PatreonButton_Pressed(object sender, ButtonPressEventArgs args)
 {
     OpenHelper.OpenUrl("https://www.patreon.com/ryujinx");
 }
Ejemplo n.º 20
0
 //
 // Events
 //
 private void RyujinxButton_Pressed(object sender, ButtonPressEventArgs args)
 {
     OpenHelper.OpenUrl("https://ryujinx.org");
 }
Ejemplo n.º 21
0
 private void DiscordButton_Pressed(object sender, ButtonPressEventArgs args)
 {
     OpenHelper.OpenUrl("https://discordapp.com/invite/N2FmfVc");
 }
Ejemplo n.º 22
0
 public void OpenUrl(string address, bool isInternal = false) => OpenHelper.Open(address);