Search results for query: *

  • Users: ConsKa
  • Content: Threads
  • Order by date
  1. C

    Resolved MVVM - persistent API key between viewmodels

    I have an application that is hard coded with an API key....it works, perfectly fine. I created a login screen so other people can use it with their API key. It will not hold the API key, I have tried assigning it to a public property, I have tried creating a class to hold it in a property and...
  2. C

    Resolved DataGrid - can't get it to load with async method?

    Using MVVM and Caliburn.Micro I was able to create a BindableCollection<Details> I was able to manually add something to this and put it into a DataGrid, by simply naming the DataGrid after the BindableCollection, code looked like this: public BindableCollection<Details> Request { get; set; }...
  3. C

    Resolved HttpClient Response IsSuccessStatusCode firing twice?

    I have the following code and I cannot for the life of my answer why it is firing twice.... HttpClient httpClient = new HttpClient(); HttpRequestMessage request = new HttpRequestMessage(); request.RequestUri = new Uri(shortUrl); request.Method = HttpMethod.Get; request.Headers.Add("Key", api)...
  4. C

    Question Further Regex assistance sought

    So I been reading up on Regex like a mad man the last couple of days, but there is something that just isn't clicking. I have a Regex that does 'almost' exactly what I want: names = Regex.Replace(names, @"(^\w)|(\s\w)|(\W\w)", m => m.Value.ToUpper()); This goes through the string and...
  5. C

    Question First MVVM applicaiton - still a lot in ViewModel Button - advice sought

    So I completed my first MVVM application. I know it isn't great, but quite proud of actually managing to separate it all out and have it still function. It is a pretty simple string manipulation application - so not overly proud...besides I think Caliburn.Micro is doing most of the work. I...
  6. C

    Resolved Best Syntax for input / outcome process?

    Sorry for the title, I think if I knew how to ask this question, I would likely know the answer to the question. The process I had in mind is of a group of names: William Bill Billie Billy Will Willy If any one of those is entered, then the remaining list is output. I have a lot of names I...
  7. C

    Resolved Regex Failures beyond my understanding

    I am trying to match a word and replace with a capitalised version, and I don't understand why the word is not being seen? I have used: @"\bor\b", "OR" Which I add to a dictionary as key and value, with the regex being the key. My understanding, and all my reading seems to suggest, that this...
  8. C

    Resolved Large Json response - displaying certain items

    I am calling an API that is quite long, and despite my best efforts, I have been unable to get the examples to work and I am not entirely sure where to go from here. I have no issue obtaining the json as a string. When I did json to classes, I get the below (though it is even longer). public...
  9. C

    Resolved API call which includes an API Key in C# application

    Sorry if this is in the wrong place, I wasn't sure where to put it. I honestly cannot believe how difficult I have found googling this question. I would have thought it was really obvious, if you need to include an API key, then how do you go about putting that into your get...
  10. C

    Resolved Iterating through and writing to excel speed issue

    This is using Microsoft Office Interop. I have a Dictionary with two data types, one data type matches an entry in a master excel. I am currently using a For loop to loop over the entries, and where there is a match, write the Dictionary data in the two cells to the left. I understand that I...
  11. C

    Resolved This has me a little confused...Columns in Excel.

    So I made a simple program, and what it does is read through ExcelOne and collects two pieces of data (Col A and Col B), then compares Col A from ExcelOne to a column in ExcelTwo and where there is a match adds Col A and B from ExcelOne to ExcelTwo - then saves ExcelTwo as a new spreadsheet...
  12. C

    Question Logic in class breaking binding

    So after a bit of a wrangle I managed to write some code that would allow me to read a text file, split it and place it into an array and then bind that array to text boxes - it isn't great, as there are 60 entries in the Array, and splitting them into the textboxes was a pain - but it works. I...
  13. C

    Question Iterating through textbox populating from textfile

    This had stumped me for awhile, I keep returning to it and feel I get a little closer - but honestly, I could be getting further away. At the bottom is my winform code - directly below is my WPF code. This kinda works, it is late, 3.30am and I have not perfectly refined it (it doesn't populate...
  14. C

    Resolved SQL Test causing significant form loading time

    I noted my form takes awhile to load after an initial Message box requesting the user confirm a new session or not. Looking through it, it appears that the delay occurs at this part: Program.cs: static void main() Application.EnableVisualStyles()...
  15. C

    Question Significant delay in code execution - any tips?

    At the click of a button I check to see if an excel is open, if it is a message pops up to close it - once closed the following code is called: 1. Record all excel process IDs in a hashtable; 2. Export data to an excel spreadsheet; 3. Kill any excel processes that do not exist in the hashtable...
  16. C

    Resolved Class and form interaction

    So as part of my learning experience, I have been shifting as much code as I could muster to defined classes to limit the length of my Form.cs. I have done this for each of the things that I can think of doing in terms of file naming, time capturing, data storage. However, quite a lot of my...
  17. C

    Resolved Filter Listbox using textbox

    I have done this in a Winform application, and understand how that is done, but in WPF, I don't have a binding source instead I have a DataTable/DataView with a {Binding Column} in the XAML file. So when I come to filter the Listbox I am struggling a little - either getting a syntax error or...
  18. C

    Resolved just close application?

    My form relies on a SQL database view, and I wanted to catch if the user could not connect. The code I have shown to test the SQL connection all appears to work (I can block my connection and receive the message, unblocking and the application loads) The problem is closing the form. You can...
  19. C

    Question Iterate through a list & iterate through a DataTable to produce a result?

    Firstly, I am not sure this is the best way of doing this. I have imported data from an excel to create a DataTable. I then have data input that I need to parse out and create a (small L) list of items. I then want to check whether any of those items appear in the DataTable and if they do...
  20. C

    Question Created my first class library - looking for advice

    I hope it is ok to ask this sort of question, if it is not appropriate please delete the post and I will know what is appropriate. I am learning C# and I am trying to 'refactor' my code (which is one huge 1,000 line Win Form. So I created my first class library and I just wanted to run it by...
Back
Top Bottom