|
C# 6.0 will have a way to more easily match constructor arguments with auto-properties, but there's nothing like what you want yet.
|
# ? Aug 19, 2014 21:42 |
|
|
# ? May 18, 2024 12:14 |
|
Careful Drums posted:I have a problem: the default bundling in System.Web.Optimization is not cutting it. I've had good luck with RequestReduce.
|
# ? Aug 19, 2014 21:42 |
|
Careful Drums posted:I have a problem: the default bundling in System.Web.Optimization is not cutting it. If you go the all-static route, Microsoft has a library/tool called the Ajax Minifier and a tool which builds on it called WebGrease which you might find useful.
|
# ? Aug 19, 2014 22:43 |
|
I'd admit defeat and look at the grunt option -- it really is the way forward and I suspect it will become more and more prevalent in ASP.NET as they move away from VS dependence. I will admit that node seems like a funky dependency and there is a whole lot of stupid poo poo on the platform but there is some pretty cool or handy poo poo as well. Or at least grunt is pretty awesome -- having a pretty good build / integration tool for static stuff is pretty worthwhile. Karma -- a javascript unit testing framework -- is pretty sweet as well.
|
# ? Aug 19, 2014 23:05 |
|
chmods please posted:If you go the all-static route, Microsoft has a library/tool called the Ajax Minifier and a tool which builds on it called WebGrease which you might find useful. I forgot to mention that I looked a bit into WebGrease as well. I figured since System.Web.Optimization depends on WebGrease I could just use that lib and make something myself, but I think that would be a bad case of re-inventing the wheel - if the pros at Redmond can't make something useable with WebGrease, what would some scrub midwest dev be able to do? wwb posted:I'd admit defeat and look at the grunt option -- it really is the way forward and I suspect it will become more and more prevalent in ASP.NET as they move away from VS dependence. Thanks for your opinion on this. I'm fighting it in my head but I think you're right that with how vNext is looking that interoping with other technologies is the way to go. Ithaqua posted:I've had good luck with RequestReduce. Hey, that that looks promising too, I'll check it out. Thanks! Careful Drums fucked around with this message at 02:56 on Aug 20, 2014 |
# ? Aug 20, 2014 02:50 |
|
Essential posted:Can MEF be used to load & unload a library from a running application? I want to be able to silently update files while a system tray app runs. The only way to unload an assembly is to kill its app domain - MEF doesn't provide any special facilities for this.
|
# ? Aug 20, 2014 04:33 |
|
Ithaqua posted:C#6 will have this in the form of primary constructors. I'm sure someone will correct me if I'm wrong, but you'll be able to do: I was really sad to see in Roslyn dev notes that VB.NET is not getting any equivalent to this feature
|
# ? Aug 20, 2014 04:34 |
|
Ithaqua posted:I've had good luck with RequestReduce. Holeeee poo poo it 'just worked' installing via NuGet. I thought it was too good to be true. Now all I have to do is convince the team!
|
# ? Aug 20, 2014 15:58 |
|
Is it possible to have a WPF application, depending on certain command line options being present, not bother with the Windows part and just run in the current console (or a new one if run from a shortcut)? I have a project that a customer wants to add some scheduled processing to.
|
# ? Aug 20, 2014 16:10 |
|
Ciaphas posted:Is it possible to have a WPF application, depending on certain command line options being present, not bother with the Windows part and just run in the current console (or a new one if run from a shortcut)? I have a project that a customer wants to add some scheduled processing to. I don't see why not, just don't set the StartupUI property and launch/hook your console in a Startup event handler.
|
# ? Aug 20, 2014 16:24 |
|
Never done EF before, found some old code left by a good contractor who split since govt doesn't pay what this guy was worth. Great code though. Anyway this is all EF and I don't even know where to begin trying to find where the connection string either in the .edmx file by hand or using the designer. It's basically WebAPI that emits JSON for some jQuery/KO sitting in a web forms page. I can open the designer and look at object models but I've tried googling and poking for the frigging connection strings and apparently called in stupid this morning. EDIT: I didn't scroll far enough right, it's in web.config. Fuck them fucked around with this message at 17:03 on Aug 20, 2014 |
# ? Aug 20, 2014 16:53 |
|
gently caress them posted:Never done EF before, found some old code left by a good contractor who split since govt doesn't pay what this guy was worth. Great code though. I was gonna say, isn't that usually where they go? glad to hear that good code exists somewhere, though.
|
# ? Aug 20, 2014 17:10 |
|
code:
|
# ? Aug 20, 2014 17:18 |
|
Hey folks, I have a C++ library that I'm supposed to use. Problem is, we do everything in C#. Is there a good way to use this library that isn't "wrapper class" because it has way to many functions,classes,stucts,enums,etc that making a wrapper class would be awful. Any tools or tricks? Please ?
|
# ? Aug 20, 2014 17:30 |
|
gently caress them posted:
Looks like you were using an earlier version of the EF when they needed a special connection string because they were stuck on using the designer and I guess a good old fasioned connection string isn't good enough. Anyhow, that isn't too complex -- just a typical connection string xml encoded. But it was a PITA and it is now gone. PS: see http://odetocode.com/blogs/scott/archive/2014/08/14/c-6-0-features-part-ii-primary-constructors.aspx for stuff on C# 6 constructor parameters. I'm not sure how much they do for me given resharper has got it down to a few wacks of alt-enter.
|
# ? Aug 20, 2014 18:32 |
|
Gul Banana posted:The only way to unload an assembly is to kill its app domain - MEF doesn't provide any special facilities for this. Thanks, that's what I was thinking.
|
# ? Aug 20, 2014 18:40 |
|
wwb posted:PS: see http://odetocode.com/blogs/scott/archive/2014/08/14/c-6-0-features-part-ii-primary-constructors.aspx for stuff on C# 6 constructor parameters. I'm not sure how much they do for me given resharper has got it down to a few wacks of alt-enter. It reduces the boilerplate for DI a fair bit, and makes it slightly less error-prone. code:
|
# ? Aug 20, 2014 18:46 |
|
You should already have the fields generated, so the code would reduce to thisC# code:
|
# ? Aug 20, 2014 19:02 |
|
Sedro posted:You should already have the fields generated, so the code would reduce to this I thought so at first, but I did some reading that indicated that the primary constructor parameters are only available during class initialization, so you have to assign them into a field or something.
|
# ? Aug 20, 2014 19:03 |
|
TheReverend posted:Hey folks, Start with the PInvoke Interop Assistant http://clrinterop.codeplex.com/releases/view/14120 The idea is that you paste C++ code into the assistant, and it spits out C# interop code. It will spit out C# interop code for structs, enums, functions, COM interfaces. Then you can invoke them directly. As for classes? I think you're stuck here. It's fine for C# to call a C-style function directly, but there's no way for C# to call a C++ class member directly. You'll have to write a wrapper.
|
# ? Aug 20, 2014 19:04 |
|
Ithaqua posted:I thought so at first, but I did some reading that indicated that the primary constructor parameters are only available during class initialization, so you have to assign them into a field or something. Edit: I guess it also removes the need for field assignments e.g. this.foo = foo. But still not in the same league as scala's case classes. Sedro fucked around with this message at 19:29 on Aug 20, 2014 |
# ? Aug 20, 2014 19:26 |
|
Sedro posted:So primary constructors will save exactly 1 line of code (excluding braces)? I hope that's not the case. There's syntax to automatically plug them into auto properties, which is really nice.
|
# ? Aug 20, 2014 20:38 |
|
None of this is beating resharper + alt-enter for me. All of it is a lot harder to read / follow. Then again I'm a luddite at times.
|
# ? Aug 20, 2014 20:58 |
|
Something I was thinking about earlier: Let's say you have an event. When you fire the event, you want to provide some event args, but the contents of the event args don't really match up with any strongly-typed models you have, and it's a bit too specific to warrant any sort of reuse, and also you're a lazy jerk. Is it wrong to do public event EventHandler<dynamic> FooEvent;? The invocation (in my mind) would be to handle a case like this: code:
|
# ? Aug 21, 2014 02:06 |
|
Ithaqua posted:Something I was thinking about earlier: I'd consider who's on my team and who's gonna be supporting it because I wouldn't mind either way but there are people that would care *really hard* about it, and you could be setting a precedent.
|
# ? Aug 21, 2014 03:50 |
|
Ithaqua posted:It feels wrong, but I can't express what's so wrong about it. I hate the ever-living poo poo out of it, but I also have an imbalanced dislike of dynamic in general. As Destroyenator said, you have a public interface with a lack of compile time type/typo checking. You could use Tuple to gain those benefits, but the code is still ugly with .Item1, .Item2. I feel like there's a happy medium that should exist in the language that's best described as "public anonymous types" or maybe "structural types" in the loosest sense of the term. Though this is all rehashing old discussions. In your case, I would probably just define a public class nested in the class that is spawning the event. If it's only used in that specific case, then there's no need to clutter your namespace with the event definition. This goes directly against being a lazy jerk, though.
|
# ? Aug 21, 2014 04:30 |
|
In my case, there are no team members and no public API, but your points are well taken. I will opt against committing this minor atrocity.
|
# ? Aug 21, 2014 04:38 |
|
Aren't you proposing essentially what MVC does with route values? e.g. Url.Action("ActionName", new { id = "ohmy", somethingElse = "hello" }). Not that this makes it right - I remember reading an interview where Anders expressed strong disapproval of this pattern.
|
# ? Aug 21, 2014 05:01 |
|
Gul Banana posted:I was really sad to see in Roslyn dev notes that VB.NET is not getting any equivalent to this feature Sorry, that was partly my doing. The reason for not doing them in VB is: * We foresee something nicer coming along, e.g. https://roslyn.codeplex.com/discussions/560339 In C# the primary constructor syntax will already be taken, so C# would have to express "plain old data" objects with some kind of other syntax e.g. "record class Point(int x, int y);" and there'll be several similar kinds of things. In VB, if we don't do primary constructors now, then we'll leave the syntax free for the something nicer in the future. * VB already lets one member initializer refer to another, e.g. code:
* VB isn't case sensitive and so can't rely on different casing conventions like C# has for constructor parameters vs members * There are a bunch of things that don't quite work right, e.g. you can't do XML doc-comments right on primary constructors. And by the time you start putting in complicated type names e.g. "Class C(x As List(Of Tuple(Of IDiagnosticProvider, ISymbol)))" then it's pretty wordy.
|
# ? Aug 21, 2014 06:02 |
|
Does anyone know of a good tutorial/example/primer set of C# GUI design? Preferably in a MVC format? I've done it before kinda...in Java, but it would be nice to see it done properly (coding wise) before attempting it.
A Tartan Tory fucked around with this message at 13:07 on Aug 21, 2014 |
# ? Aug 21, 2014 12:54 |
|
A Tartan Tory posted:Does anyone know of a good tutorial/example/primer set of C# GUI design? Preferably in a MVC format? I've done it before kinda...in Java, but it would be nice to see it done properly (coding wise) before attempting it. App store (Metro), WinForms, WPF? Or are you talking web?
|
# ? Aug 21, 2014 13:11 |
|
Ithaqua posted:App store (Metro), WinForms, WPF? Or are you talking web? WPF or Windows forms, whatever is easier, on Visual Express 2013. Sorry, should have specified.
|
# ? Aug 21, 2014 13:18 |
|
Are there no chart/graph/etc. controls built in to .NET/WPF by default? I've seen downloadable controls but I can't use those on my work machine.
|
# ? Aug 21, 2014 21:50 |
|
I'm trying to set up an asychronously updating list (a list of emails successfully sent) on the last step of a wizardstep in .Net 3.5. Modifying the response (response.write/flush/end) seems to be breaking the Wizardstep, is there a better way to do it? Most of the alternatives appear to be for 4.0 or 4.5.
|
# ? Aug 21, 2014 22:29 |
|
I think this the right place. I'm having some trouble with XAML since I'm completely new to it. Specifically I'm having trouble with the data binding.XML code:
C# code:
Windows Phone 8.1 is the target environment. It's close enough to wpf that solutions may have a good chance at working if you're familiar with that. Thanks in advance.
|
# ? Aug 22, 2014 00:03 |
|
What's the compiler error?
|
# ? Aug 22, 2014 00:13 |
|
A Tartan Tory posted:WPF or Windows forms, whatever is easier, on Visual Express 2013. Sorry, should have specified. Pretty sure windows form is being discouraged, and WPF is recommended now. Something something separation of logic. Knyteguy fucked around with this message at 00:16 on Aug 22, 2014 |
# ? Aug 22, 2014 00:14 |
|
Faldoncow posted:What's the compiler error? The name "MarginModel" does not exist in the namespace "using:CompanyWidgetMobileApp.Data". Which drives me crazy because Intellisense is showing me the class.
|
# ? Aug 22, 2014 00:15 |
|
I haven't seen the "using:..." in WPF. Usually I use "clr-namespace" instead of using, like so:code:
I've only been using WPF for a month though, so that may not be the issue.
|
# ? Aug 22, 2014 00:26 |
|
|
# ? May 18, 2024 12:14 |
|
Faldoncow posted:I haven't seen the "using:..." in WPF. Usually I use "clr-namespace" instead of using, like so: No luck unfortunately. Thanks though. I feel like Windows 8.1 Phone development is still in beta stages or something. Not a whole lot of helpful debugging information.
|
# ? Aug 22, 2014 00:36 |