//Open and choose a folder where the downloads will go to private void ChooseDownloadFolder() { try { using (FolderBrowserDialog fbd = new FolderBrowserDialog()) { //Venster openen DialogResult result = fbd.ShowDialog(); //Nakijken of dat venster succesvol is geopend en pad is gekozen if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath)) { //Pad opslaan if (fbd.SelectedPath.Last() != '\\') { fbd.SelectedPath += @"\\";//2 backslashen toegevoegd. Niet 1 } DownloadFolder = fbd.SelectedPath; Console.WriteLine("Downloadpad veranderd naar: " + fbd.SelectedPath); FeedbackColor = "White"; FeedbackList.Add("Downloadpad veranderd naar " + fbd.SelectedPath); } } } catch (Exception ex) { FeedbackColor = "Red"; FeedbackList.Add("Failed to open folder: " + ex.Message); } }
/// <summary> /// Feedback geven op de afgelopen sessie /// </summary> /// <param name="feedbacktxt">feedback tekst</param> /// <param name="gebruiker">Gebruiker Object</param> public void FeedbackGeven(string feedbacktxt, Gebruiker gebruiker, int score) { if (StatusSessie != StatusSessie.Gesloten) { throw new FeedbackException("Je kan geen feedback geven op een niet afgelopen sessie."); } if (gebruiker.StatusGebruiker != StatusGebruiker.Actief) { throw new GeenActieveGebruikerException("Je moet een actieve gebruiker zijn om feedback te kunnen geven"); } if (score < 1 || score > 5) { throw new FeedbackException("Score moet tussen 1 en 5 liggen"); } foreach (Feedback f in FeedbackList) { if (f.Auteur == gebruiker) { throw new FeedbackException("Gebruiker heeft al feedback gegeven."); } } if (gebruiker.Aanwezig(this)) { Feedback feedback = new Feedback(gebruiker, feedbacktxt, DateTime.Now, score); FeedbackList.Add(feedback); } else { throw new AanwezigException("Gebruiker was niet aanwezig of niet ingeschreven en kan dus geen feedback geven!"); } }
private void OnListFeedback(FeedbackList response, Dictionary <string, object> customData) { Log.Debug("TestCompareComplyV1.OnListFeedback()", "ListFeedback Response: {0}", customData["json"].ToString()); Test(response != null); Test(response.Feedback != null); listFeedbackTested = true; }
/// <summary> /// Verwijderd de meegeven feedback /// </summary> /// <param name="feedbackId">int feedbackId</param> /// <param name="gebruiker">Gebruiker object</param> public void VerwijderFeedback(int feedbackId, Gebruiker gebruiker) { bool succes = false; foreach (Feedback feedback in FeedbackList) { if (feedback.FeedbackID == feedbackId) { if (gebruiker == feedback.Auteur || (gebruiker is Verantwoordelijke && (gebruiker as Verantwoordelijke).IsHoofdverantwoordelijke == true)) { succes = true; FeedbackList.Remove(feedback); break; } else { throw new FeedbackException("Feedback is niet verwijderd. Controleer of je de auteur bent van de gekozen feedback of de juiste rechten hebt."); } } } if (!succes) { throw new FeedbackException("Feedback kon niet gevonden worden. Feedback is niet verwijderd."); } }
// GET: Feedback public ActionResult Index() { FeedbackList c1 = new FeedbackList(); c1.Feedback = (db.Feedbacks.ToList()); return(View(c1)); }
public EVERadioVM() { EVERadioSessions = new List <EVERadioSession>(); //Alle sessies ophalen en tonen GetAllSessions(); //Feedback invullen FeedbackList.Add("Hello I'm feedback. Please press 'Download All' to start"); FeedbackColor = "White"; }
public SerializeFeedback() { dateTime = DateTime.Today; date = string.Format("{0}-{1}-{2}", dateTime.Day, dateTime.Month, dateTime.Year); try { feedbackList = deserializeFeedback(); } catch { feedbackList = new FeedbackList(); } }
public bool AddFeedBack(string stdname, string CourseN, string Desc) { try { IFeedback thefb = UserFactory.GetFeedback(stdname, CourseN, Desc); FeedbackList.Add(thefb); DataLayer.addNewFeedBackToDB(thefb); return(true); } catch (System.Exception excep) { return(false); } }
//Start downloaden van een bestand private async Task DownloadFileAsync(string url, string naam) { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3; try { using (WebClient wc = new WebClient()) { wc.DownloadProgressChanged += Client_DownLoadProcessChanged; //Om tussentijdse feedback te kunnen geven. wc.DownloadFileCompleted += Client_DownloadProcessComplete; //Om feedback te kunnen geven bij voltooing //Make instance off class library DownloadEVERadioSessions downloadEVERadioSessionsClassLib = new DownloadEVERadioSessions(); if (UseProxy) //Use a proxy if the user wants to { GetProxyModel proxyinfo = downloadEVERadioSessionsClassLib.GetRandomProxy(); //Get a random proxy wc.Proxy = new WebProxy(proxyinfo.Ip, proxyinfo.Port); //Proxy instellen } //timer per download starten EVERadioSession evers = EVERadioSessions.Find(f => f.FileName == naam.Split('\\').Last()); evers.StopWatch.Start(); //Extra informatie per download bijhouden. evers.TimeStarted = DateTime.Now; await wc.DownloadFileTaskAsync(new Uri(url), naam); } } catch (Exception ex) { Console.WriteLine(ex.Message); if (ex.Message == "Unable to connect to the remote server") { FeedbackList.Add("Error, try again with Proxy enabled"); } else { FeedbackList.Add("Bestand: " + naam.Split('\\').Last() + " - Something went wrong, maybe this helps: " + ex.Message); } FeedbackColor = "Red"; } }
//Download de geselecteerde sessies private void DownloadSelected() { try { //Sessies ophalen die geselecteerd zijn foreach (EVERadioSession sessie in EVERadioSessions.Where(item => item.IsSelected)) { HandleSession(sessie); } } catch (Exception ex) { Console.WriteLine("Foutboodschap: " + ex.Message); FeedbackColor = "Red"; FeedbackList.Add("DownloadSelected failed: " + ex.Message); } }
public ActionResult Index([Bind(Include = "CustomerId, CustomerName, CustomerFeedback")] Feedback newCustomer) { ModelState.Clear(); FeedbackList cl = new FeedbackList(); cl.newCustomers = new Feedback { CustomerName = "", CustomerFeedback = "" }; if (!CreateFeedback(newCustomer)) { cl.newCustomers = newCustomer; } cl.Feedback = db.Feedbacks.ToList(); return(PartialView(cl)); }
//Open Filezilla private void OpenFileZilla() { try { //Gaat in regedit zoeken naar het pad aan de hand van onderstaande waarde //(onderstaande waarde heb ik zelf in regedit opgezocht om dit te weten voor filezilla) //Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\filezilla.exe Process pcss = new Process(); pcss.StartInfo.Arguments = "--local=" + _downloadfolder + " --site=0/Thuis"; pcss.StartInfo.FileName = "Filezilla.exe"; pcss.Start(); //Process.Start("Filezilla.exe"); } catch (Exception ex) { FeedbackColor = "Red"; FeedbackList.Add("Filezilla niet geopend: " + ex.Message); } }
//Get all the sessions and show them in the overviewlist private void GetAllSessions() { try { using (WebClient client = new WebClient()) { //We downloaden de EVE-Radio pagina string htmlCode = client.DownloadString("https://gamingnow.net/gn_rewind/rewind/"); //We splitsen de herbeluister divs op basis van hun ID string[] stringSeperators = new string[] { "<div class='parentPresent' style='display:none;'>" }; string[] rewinds = htmlCode.Split(stringSeperators, StringSplitOptions.None).Skip(1).ToArray();//Het eerste dat we eruit halen is rommel. //Nu gaan we voor elk van de gevonden rewinds de starturl opzoeken foreach (string rewind in rewinds) { //We vinden de startpositie van de tekst die we willen, de eindpositie, en halen daar de lengte uit. int startPos = rewind.IndexOf("Listen from: <a href='#' onclick=\"javascript:doCmd({rewind:'") + "Listen from: <a href='#' onclick=\"javascript:doCmd({rewind:'".Length; int length = rewind.IndexOf("'}); return false;\">Start") - startPos; string downloadUrl = rewind.Substring(startPos, length); string bestandsnaam = downloadUrl.Split('/').Last(); //Starten met downloadsnelheidsberekening Stopwatch sw = new Stopwatch(); EVERadioSessions.Add(new EVERadioSession() { FilePath = downloadUrl, FileName = bestandsnaam, StopWatch = sw, IsDownloading = false }); } } } catch (Exception ex) { Console.WriteLine(ex.Message); FeedbackColor = "Red"; FeedbackList.Add("Failed getting all sessions. Maybe this helps: " + ex.Message); } }
//Download all the sessions private void DownloadAll() { try { //Give feedback to user FeedbackList.Add("We started downloading ALL THE SONGS"); FeedbackColor = "Green"; //We overlopen alle EVE Radio sessies die we willen downloaden foreach (EVERadioSession sessie in EVERadioSessions) { HandleSession(sessie); } } catch (Exception ex) { Console.WriteLine("Foutboodschap: " + ex.Message); FeedbackColor = "Red"; FeedbackList.Add("DownloadAll failed: " + ex.Message); } }
public IEnumerator TestListFeedback() { Log.Debug("CompareComplyServiceV1IntegrationTests", "Attempting to ListFeedback..."); FeedbackList listFeedbackResponse = null; service.ListFeedback( callback: (DetailedResponse <FeedbackList> response, IBMError error) => { Log.Debug("CompareComplyServiceV1IntegrationTests", "ListFeedback result: {0}", response.Response); listFeedbackResponse = response.Result; Assert.IsNotNull(listFeedbackResponse); Assert.IsNotNull(listFeedbackResponse.Feedback); Assert.IsTrue(listFeedbackResponse.Feedback.Count > 0); Assert.IsNull(error); }, feedbackType: "element_classification", includeTotal: true ); while (listFeedbackResponse == null) { yield return(null); } }
/// <summary> /// Checks if a session is downloading /// Starts downloading session if not already downloading /// </summary> /// <param name="sessie"></param> private void HandleSession(EVERadioSession sessie) { string localpath = _downloadfolder + sessie.FileName; if (sessie.IsDownloading)//Als het bestand aan het downloaden is, gaan we het niet onderbreken { FeedbackList.Add("Song " + sessie.FileName + " is already downloading."); } else { if (!IsFullSession(localpath))//Als het een volledig bestand is moeten we het niet opnieuw downloaden { sessie.IsDownloading = true; sessie.Achtergrondkleur = "Orange"; DownloadFileAsync(sessie.FilePath, localpath);//Aanzetten om bestanden te downloaden } else { sessie.IsDownloading = false; sessie.Achtergrondkleur = "GreenYellow"; sessie.Progress = 100; } } }
/// <summary> /// List the feedback in documents. /// </summary> /// <param name="feedbackType">An optional string that filters the output to include only feedback with the /// specified feedback type. The only permitted value is `element_classification`. (optional)</param> /// <param name="before">An optional string in the format `YYYY-MM-DD` that filters the output to include only /// feedback that was added before the specified date. (optional)</param> /// <param name="after">An optional string in the format `YYYY-MM-DD` that filters the output to include only /// feedback that was added after the specified date. (optional)</param> /// <param name="documentTitle">An optional string that filters the output to include only feedback from the /// document with the specified `document_title`. (optional)</param> /// <param name="modelId">An optional string that filters the output to include only feedback with the specified /// `model_id`. The only permitted value is `contracts`. (optional)</param> /// <param name="modelVersion">An optional string that filters the output to include only feedback with the /// specified `model_version`. (optional)</param> /// <param name="categoryRemoved">An optional string in the form of a comma-separated list of categories. If /// this is specified, the service filters the output to include only feedback that has at least one category /// from the list removed. (optional)</param> /// <param name="categoryAdded">An optional string in the form of a comma-separated list of categories. If this /// is specified, the service filters the output to include only feedback that has at least one category from /// the list added. (optional)</param> /// <param name="categoryNotChanged">An optional string in the form of a comma-separated list of categories. If /// this is specified, the service filters the output to include only feedback that has at least one category /// from the list unchanged. (optional)</param> /// <param name="typeRemoved">An optional string of comma-separated `nature`:`party` pairs. If this is /// specified, the service filters the output to include only feedback that has at least one `nature`:`party` /// pair from the list removed. (optional)</param> /// <param name="typeAdded">An optional string of comma-separated `nature`:`party` pairs. If this is specified, /// the service filters the output to include only feedback that has at least one `nature`:`party` pair from the /// list removed. (optional)</param> /// <param name="typeNotChanged">An optional string of comma-separated `nature`:`party` pairs. If this is /// specified, the service filters the output to include only feedback that has at least one `nature`:`party` /// pair from the list unchanged. (optional)</param> /// <param name="pageLimit">An optional integer specifying the number of documents that you want the service to /// return. (optional, default to 10)</param> /// <param name="cursor">An optional string that returns the set of documents after the previous set. Use this /// parameter with the `page_limit` parameter. (optional)</param> /// <param name="sort">An optional comma-separated list of fields in the document to sort on. You can optionally /// specify the sort direction by prefixing the value of the field with `-` for descending order or `+` for /// ascending order (the default). Currently permitted sorting fields are `created`, `user_id`, and /// `document_title`. (optional)</param> /// <param name="includeTotal">An optional boolean value. If specified as `true`, the `pagination` object in the /// output includes a value called `total` that gives the total count of feedback created. (optional)</param> /// <param name="customData">Custom data object to pass data including custom request headers.</param> /// <returns><see cref="FeedbackList" />FeedbackList</returns> public FeedbackList ListFeedback(string feedbackType = null, DateTime?before = null, DateTime?after = null, string documentTitle = null, string modelId = null, string modelVersion = null, string categoryRemoved = null, string categoryAdded = null, string categoryNotChanged = null, string typeRemoved = null, string typeAdded = null, string typeNotChanged = null, long?pageLimit = null, string cursor = null, string sort = null, bool?includeTotal = null, Dictionary <string, object> customData = null) { if (string.IsNullOrEmpty(VersionDate)) { throw new ArgumentNullException("versionDate cannot be null."); } FeedbackList result = null; try { IClient client = this.Client.WithAuthentication(_tokenManager.GetToken()); var restRequest = client.GetAsync($"{this.Endpoint}/v1/feedback"); restRequest.WithArgument("version", VersionDate); if (!string.IsNullOrEmpty(feedbackType)) { restRequest.WithArgument("feedback_type", feedbackType); } if (before != null) { restRequest.WithArgument("before", before); } if (after != null) { restRequest.WithArgument("after", after); } if (!string.IsNullOrEmpty(documentTitle)) { restRequest.WithArgument("document_title", documentTitle); } if (!string.IsNullOrEmpty(modelId)) { restRequest.WithArgument("model_id", modelId); } if (!string.IsNullOrEmpty(modelVersion)) { restRequest.WithArgument("model_version", modelVersion); } if (!string.IsNullOrEmpty(categoryRemoved)) { restRequest.WithArgument("category_removed", categoryRemoved); } if (!string.IsNullOrEmpty(categoryAdded)) { restRequest.WithArgument("category_added", categoryAdded); } if (!string.IsNullOrEmpty(categoryNotChanged)) { restRequest.WithArgument("category_not_changed", categoryNotChanged); } if (!string.IsNullOrEmpty(typeRemoved)) { restRequest.WithArgument("type_removed", typeRemoved); } if (!string.IsNullOrEmpty(typeAdded)) { restRequest.WithArgument("type_added", typeAdded); } if (!string.IsNullOrEmpty(typeNotChanged)) { restRequest.WithArgument("type_not_changed", typeNotChanged); } if (pageLimit != null) { restRequest.WithArgument("page_limit", pageLimit); } if (!string.IsNullOrEmpty(cursor)) { restRequest.WithArgument("cursor", cursor); } if (!string.IsNullOrEmpty(sort)) { restRequest.WithArgument("sort", sort); } if (includeTotal != null) { restRequest.WithArgument("include_total", includeTotal); } if (customData != null) { restRequest.WithCustomData(customData); } restRequest.WithHeader("X-IBMCloud-SDK-Analytics", "service_name=compare-comply;service_version=v1;operation_id=ListFeedback"); result = restRequest.As <FeedbackList>().Result; if (result == null) { result = new FeedbackList(); } result.CustomData = restRequest.CustomData; } catch (AggregateException ae) { throw ae.Flatten(); } return(result); }
/// <summary> /// Load Feedback list /// </summary> protected void LoadFeedBack() { FeedbackList.DataSource = _fm.GetFeedBack(); FeedbackList.DataBind(); }
public FeefoClientResponse(FeedbackList feedbackList) { FeedbackList = feedbackList; }
//Feedback-------------------------------------------------------------------------------// void Feedback_Save() { FeedbackList newList = new FeedbackList(); newList.Listname = "Feedbacks"; FeedbackController fbC = gameController.transform.FindChild("FeedBackController").GetComponent<FeedbackController>(); if (fbC.archivedListOfFeedbacks.Count != 0) { for (int i = 0; i < fbC.archivedListOfFeedbacks.Count; i++) { newList.Add(fbC.archivedListOfFeedbacks[i]); } } System.Type[] sheet = { typeof(FeedBack) }; XmlSerializer serializer = new XmlSerializer(typeof(FeedbackList), sheet); FileStream fs = new FileStream(fullPath + feedbackPath, FileMode.Create); serializer.Serialize(fs, newList); fs.Close(); newList = null; }