Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
raminasi
Jan 25, 2005

a last drink with no ice

crashdome posted:

In fact, you should probably just avoid IDisposable unless you absolutely have unmanaged resources inside your class.

Or the far more common case of a class with IDisposable fields.

Adbot
ADBOT LOVES YOU

TheEffect
Aug 12, 2013
So CopyDirectory doesn't do much really, like copying permissions over and things like that. I've found ways around most of these problems thanks to you guys but is there any way to copy the source folder's icon over? Or rather, whatever attribute handles the location of which icon to use for the directory?

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

TheEffect posted:

So CopyDirectory doesn't do much really, like copying permissions over and things like that. I've found ways around most of these problems thanks to you guys but is there any way to copy the source folder's icon over? Or rather, whatever attribute handles the location of which icon to use for the directory?

I believe that's handled with desktop.ini inside the directory. I think it's hidden and possibly even system by default.

RICHUNCLEPENNYBAGS
Dec 21, 2010

Rooster Brooster posted:

For a good laugh, Tomas Petricek posted about an "unusual" way to get F#-style pattern matching into C# 6 using Throw-Driven-Development. It's clever, hilarious, and also sad because pattern matching is so useful I momentarily considered trying this out in a real project.

What makes that so much better than if statements? Just avoiding the casting?

I mean it seems like you could probably well do something similar by saying var str = obj as string; if (str != null) and so on, or by treating the object as dynamic and feeding it to an overloaded method to take advantage of dynamic dispatch.

RICHUNCLEPENNYBAGS fucked around with this message at 04:35 on Apr 2, 2015

chippy
Aug 16, 2006

OK I DON'T GET IT

Scaramouche posted:

Off the top of my head the &/&&/AndAlso and |/||/OrElse are probably the two biggest 'gotchas' about VB.net as compared to how other languages work. Actually bitwise operators too have a few quirks, maybe brain up on them:
https://msdn.microsoft.com/en-us/library/wz3k228a.aspx

The other big change is how variable declaration is done, but that's mostly syntactical and you probably won't even run into it unless you're doing a bunch of List (of or LINQ style one line statements.

I know this was a couple of pages back but it's probably also worth mentioning that 'And' does not short-circuit whereas 'AndAlso' does, likewise 'Or' and 'OrElse'.

Mr Shiny Pants
Nov 12, 2012

Scaramouche posted:

You sure are correct. Dispose() fixed it, though I didn't try .Close() Rooster Brooster.

Bad habit from the VB 6 days I guess. Actually a trenchant question, is there any point in setting an object to Nothing any more?

This is a nice way of not getting the error:

http://stackoverflow.com/questions/887831/how-does-the-using-statement-translate-from-c-sharp-to-vb

EssOEss
Oct 23, 2006
128-bit approved

Scaramouche posted:

Dispose() fixed it, though I didn't try .Close()

The two are equivalent 99% of the time (the 1% being some terribly designed libraries). The general pattern seems to be that Dispose() is always provided for anything you must explicitly clean up, with Close() being provided as an alias if it feels "natural", for streams or other such concepts. Sometimes Close() might also be named Stop() (e.g. for timers).

RICHUNCLEPENNYBAGS
Dec 21, 2010

chippy posted:

I know this was a couple of pages back but it's probably also worth mentioning that 'And' does not short-circuit whereas 'AndAlso' does, likewise 'Or' and 'OrElse'.

This also applies to And/AndAlso and Or/OrElse in the Expressions namespace if you're ever building up Linq expressions.

Space Whale
Nov 6, 2014
Is there a good rule of thumb for fixing an issue where EF, instead of saving changes, it instead concatenates the changes to the end of what is already there? What things should I be looking at?

To be more specific, I have as part of my schema junction tables between a main table and a regular old key-value table, so that for each row in the main table you can have zero, one, or many values from the third table in the junction table. I've tried researching it and setting context.Entry(thingIWantToSave).State = EntityState.Modified; doesn't change anything at all.

The way it's stored in my model is that I have a collection of foo, bar, and baz in my actual row that go into my main table, and it's a matter of setting "active" to true or false for the row in the junction table associated with the main table row. The problem is EF just shoves the new changes in as new rows. :psyduck: Is this a navigation property thing?

EssOEss
Oct 23, 2006
128-bit approved
Do you have your keys properly mapped in the model? I can't really make heads or tails of your description but if it is inserting new rows instead of using existing ones, perhaps your key definitions are broken.

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

crashdome posted:

In fact, you should probably just avoid IDisposable unless you absolutely have unmanaged resources inside your class.

IDisposable can be pretty handy for anything that has a distinct start/stop operation and shouldn't be used when not started. It doesn't just have to be for unmanaged resources.


RICHUNCLEPENNYBAGS posted:

What makes that so much better than if statements? Just avoiding the casting?

Pattern matching is a great way of reducing code without harming the ability to understand it (usually improving it). It's like a more powerful version of switch. For example, look at this FizzBuzz implementation in Rust:

Rust code:
for i in 1..101 {
    match (i % 3, i % 5) {
        (0, 0) => println!("FizzBuzz"),
        (0, _) => println!("Fizz"),
        (_, 0) => println!("Buzz"),
        (_, _) => println!("{}", i),
    }
}

Space Whale
Nov 6, 2014

EssOEss posted:

Do you have your keys properly mapped in the model? I can't really make heads or tails of your description but if it is inserting new rows instead of using existing ones, perhaps your key definitions are broken.


No it was something else. I think.

I'll detail my fix:

What I was doing is basically "I'll make a brand new entity collection and shove that in based off of my viewmodel!" This was more lines of code and also didn't work. When I was debugging I saw stuff generated from EF from the DB had munging and metadata which the data from my viewmodels did not have.

code:
var tempFooList = new List<Foo>();
foreach(var foo in viewmodel.foocollection)
{
	var tempFoo() = new Foo();
	tempFoo.Active = foo.Active;
	tempFoo.SomeKey = foo.SomeKey;
	//etc
	tempFooList.Add(tempFoo);
}
entity.foocollection = tempFooList;
Above is what did not work. This is what did:

code:
foreach(var foo in entity.FooCollection)
{
	foo.Active = viewmodel.FooCollection.FirstOrDefault(x => x.someKey == foo.someKey).Active;
}
I had a hunch this would work, and it did, but I don't know why.

Was there metadata coming out of EF? Is this some practice I don't know about? What's a good EF6 book?

TheEffect
Aug 12, 2013

chmods please posted:

I believe that's handled with desktop.ini inside the directory. I think it's hidden and possibly even system by default.

Hmm. Here's what's in my Desktop.ini-
code:
[.ShellClassInfo]
LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21769
IconResource=%SystemRoot%\system32\imageres.dll,-183
[LocalizedFileNames]
Remote Desktop Connection.lnk=@%SystemRoot%\system32\mstsc.exe,-4000
If I make a change to an icon of a folder the .ini doesn't appear to change. Looks like it might have something to do with that "IconResource" variable(?) though.

How come I can push files that retain the chosen icon but not directories? :smith:

Mr Shiny Pants
Nov 12, 2012

Bognar posted:

IDisposable can be pretty handy for anything that has a distinct start/stop operation and shouldn't be used when not started. It doesn't just have to be for unmanaged resources.


Pattern matching is a great way of reducing code without harming the ability to understand it (usually improving it). It's like a more powerful version of switch. For example, look at this FizzBuzz implementation in Rust:

Rust code:
for i in 1..101 {
    match (i % 3, i % 5) {
        (0, 0) => println!("FizzBuzz"),
        (0, _) => println!("Fizz"),
        (_, 0) => println!("Buzz"),
        (_, _) => println!("{}", i),
    }
}

Pattern matching is so awesome, patternmatching over arrays is so nice compared to looping through them.

Opulent Ceremony
Feb 22, 2012

In your first example, it looks like you were simply creating some Entity objects with new, which while they may be the same class you see in a DbSet on your DbContext, they are detached entities and your current DbContext doesn't know anything about them, which is why it tries to insert a row when you add these detached entities to the DbContext.

Your second example works because you are directly modifying properties on attached entities, because they are in your FooCollection (which I'm guessing is your DbContext in some capacity). The way to make your code work in the first example is to explicitly attach the Entities to your DbContext, which can be done a couple of ways: http://stackoverflow.com/questions/20451461/save-detached-entity-in-entity-framework-6

I noticed in your first post you actually tried one of these suggestions and it didn't work, and I would guess it has something to do with the way your keys are set up as someone else said.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



I ran windows update, rebooted and now I can't build my ASP MVC project because System.Web.Mvc looks like this:


:wtc: happened and how do I go about fixing it? Yes I restarted VS. Do I need to repair some dev kit I forgot I installed?

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Munkeymon posted:

I ran windows update, rebooted and now I can't build my ASP MVC project because System.Web.Mvc looks like this:


:wtc: happened and how do I go about fixing it? Yes I restarted VS. Do I need to repair some dev kit I forgot I installed?

Is it this guy?
http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx

Also, another 'I've already done but is there a better way' question:
I'm parsing files that get downloaded by an FTP job that I don't control, let's say invoices instead of the sexy real thing it is. So every night a WGET script grabs *.csv from an ftp server and copies it here:
d:\invoices

Then I parse them, and move them to here:
d:\invoices\processed

The way I'm avoiding double parsing is like this currently:
code:
Dim files
files = Directory.EnumerateFiles("d:\invoices", "*.csv")
For Each filename As String In files
  If Not File.Exists("d:\invoices\processed\" & Path.GetFileName(filename).ToString) Then
    'do stuff
    'move file to processed
  Else
   'File is duplicate delete
   File.Delete(filename)
  End If
Next
This works, but I'm wondering, will the .Exists method eventually introduce some overhead lag if the contents of \Processed ends up being thousands of files? There would only ever be 5-6 files in \Invoices at a time. Is this premature optimization, or is there a better way?

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug

Scaramouche posted:

Then I parse them, and move them to here:
d:\invoices\processed

The way I'm avoiding double parsing is like this currently:
code:
Dim files
files = Directory.EnumerateFiles("d:\invoices", "*.csv")
For Each filename As String In files
  If Not File.Exists("d:\invoices\processed\" & Path.GetFileName(filename).ToString) Then
    'do stuff
    'move file to processed
  Else
   'File is duplicate delete
   File.Delete(filename)
  End If
Next
This works, but I'm wondering, will the .Exists method eventually introduce some overhead lag if the contents of \Processed ends up being thousands of files? There would only ever be 5-6 files in \Invoices at a time. Is this premature optimization, or is there a better way?

I wouldn't worry about the File.Exists taking too long. It's going to just ask the file system if the file exists or not. If you want to test this just make a bunch of fake "invoices" (like 100,000) and see what happens.

I think you should save this in a database so there is some history the work was done.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.




Yep. Weird that I only got that update this month considering I've been updating this thing ~monthly.

quote:

Is this premature optimization, or is there a better way?

Probably, but if you're worried about it you can clean up /processed monthly or something.

Mr Shiny Pants
Nov 12, 2012

Scaramouche posted:

Is it this guy?
http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx

Also, another 'I've already done but is there a better way' question:
I'm parsing files that get downloaded by an FTP job that I don't control, let's say invoices instead of the sexy real thing it is. So every night a WGET script grabs *.csv from an ftp server and copies it here:
d:\invoices

Then I parse them, and move them to here:
d:\invoices\processed

The way I'm avoiding double parsing is like this currently:
code:
Dim files
files = Directory.EnumerateFiles("d:\invoices", "*.csv")
For Each filename As String In files
  If Not File.Exists("d:\invoices\processed\" & Path.GetFileName(filename).ToString) Then
    'do stuff
    'move file to processed
  Else
   'File is duplicate delete
   File.Delete(filename)
  End If
Next
This works, but I'm wondering, will the .Exists method eventually introduce some overhead lag if the contents of \Processed ends up being thousands of files? There would only ever be 5-6 files in \Invoices at a time. Is this premature optimization, or is there a better way?

If you don't enumerate all the files in the directory it should work fine, even with 100.000 files in the directory.

I think Path.GetFilename already returns a string.

A Path.Combine might be nicer.

You meant the invoices directory, speedy server? The whole C drive of my machine takes less than a minute to enumerate.

Mr Shiny Pants fucked around with this message at 19:30 on Apr 2, 2015

Essential
Aug 14, 2003
I have a Team Foundation Server question:

If I edit a file while logged into Team Foundation Server (via Code->Browse->Edit) how does versioning work with that? Does it save the changes as a new version? What happens if I have the file checked out on a different computer?

The reason I ask is because I want to make some edits but don't have my dev machine with me. Would this be a good time to look into Visual Studio online, that way I get intellisense and possibly full version control?

Edit: I should clarify, I have a visual studio online account by virtue of having TFS. Maybe I'm wrong, but I thought that there was a web based VS version and that's why they migrated TFS into visual studio online a while back. I only use my VS online account for TFS.

Essential fucked around with this message at 18:53 on Apr 3, 2015

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Essential posted:

I have a Team Foundation Server question:

If I edit a file while logged into Team Foundation Server (via Code->Browse->Edit) how does versioning work with that? Does it save the changes as a new version? What happens if I have the file checked out on a different computer?

The reason I ask is because I want to make some edits but don't have my dev machine with me. Would this be a good time to look into Visual Studio online, that way I get intellisense and possibly full version control?

Edit: I should clarify, I have a visual studio online account by virtue of having TFS. Maybe I'm wrong, but I thought that there was a web based VS version and that's why they migrated TFS into visual studio online a while back. I only use my VS online account for TFS.

I'm confused. I think you might be confusing VSO with the user profile support that's built in to Visual Studio 2013 (e.g. when you "log in" to Visual Studio)

Visual Studio Online is "cloud hosted" TFS. There's still a separate, on-prem "boxed" product that ships roughly every year (TFS2015 will be out relatively soon and will contain everything in VSO that's not currently in TFS. They're basically the same codebase.)

You have to connect Visual Studio to VSO (you can do this in the Team Explorer tab), and then it operates exactly the same as on-prem TFS. There's no magic happening. You still have to check your code in and make commits. You can use either TFVC (centralized version control, similar-to-but-better-than Subversion) or Git as your source control methodology. TFVC is easier to use than Git by several orders of magnitude, but Git is more flexible.

crashdome
Jun 28, 2011
e: ^^^ I think he's referring to the VS Online ability to view code and edit on the fly right on the website.

I know that in Visual Studio online when you edit a file, the save button is effectively a 'check in' and adds a new change set with the comment "Updated <filename>."

The web editor is nice but very, very far off from using even Visual Studio Express (which I don't think supports TFS??). You can always get a single license of VS through VS Online by adding one paid user subscription or by paying for a VS Azure VM (anyone have any experience with this?).

e: I should clarify the VS Online "Professional" ($45/m) includes a license of the latest VS and not the "Basic". Although I just also learned if you qualify, VS Community edition is free for up to 5 people even commercially if you have less than 250 PCs or $1m in revenue and is essentially.. VS Pro.

crashdome fucked around with this message at 19:16 on Apr 3, 2015

Essential
Aug 14, 2003

crashdome posted:

e: ^^^ I think he's referring to the VS Online ability to view code and edit on the fly right on the website.

I know that in Visual Studio online when you edit a file, the save button is effectively a 'check in' and adds a new change set with the comment "Updated <filename>."

Yep, that's exactly what I'm referring to. So it sounds like I can edit and "check in" the file.

I have an MSDN subscription, so it's not a matter of not having access to VS, but I'm using my in-laws computer and don't want to install VS just to make a couple of changes.

crashdome posted:

The web editor is nice but very, very far off from using even Visual Studio Express (which I don't think supports TFS??). You can always get a single license of VS through VS Online by adding one paid user subscription or by paying for a VS Azure VM (anyone have any experience with this?).

For some reason I thought that a true web based version of VS was already out (not a full featured version, but something you could get intellisense & compile code in). I must be way off on that. It would be awesome if the web editor had intellisense though.

Ithaqua posted:

VSO stuff

Yep, that's exactly how I use it now on my dev machines. In this case, my wife made me leave my laptop at home for this trip and I'm trying to get a few things done via the web based VSO editor.

Essential fucked around with this message at 19:46 on Apr 3, 2015

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

Essential posted:

In this case, my wife made me leave my laptop at home for this trip and I'm trying to get a few things done via the web based VSO editor.

I know you just came here for technical advice and probably don't want to hear opinions from some rear end in a top hat who knows both jack and poo poo about you, but: have you considered that your wife made you leave your laptop so you wouldn't try to work on your trip?

crashdome
Jun 28, 2011

Essential posted:

For some reason I thought that a true web based version of VS was already out (not a full featured version, but something you could get intellisense & compile code in). I must be way off on that. It would be awesome if the web editor had intellisense though.

You're probably thinking of "Monaco" which is AFAIK only available for Azure websites and not a full product yet.


Bognar posted:

have you considered that your wife made you leave your laptop so you wouldn't try to work on your trip?

He's probably in the shitter with a smartphone like Robin Williams in RV.

Essential
Aug 14, 2003

Bognar posted:

I know you just came here for technical advice and probably don't want to hear opinions from some rear end in a top hat who knows both jack and poo poo about you, but: have you considered that your wife made you leave your laptop so you wouldn't try to work on your trip?

I feel bad for my mean response, so I'll just say "Yes Bognar, I'm aware of that".

crashdome posted:

You're probably thinking of "Monaco" which is AFAIK only available for Azure websites and not a full product yet.

Hm, maybe that's it. I'll check it out.

Essential fucked around with this message at 23:07 on Apr 3, 2015

Inverness
Feb 4, 2009

Fully configurable personal assistant.
I'm working on a small project in WPF. Basically, a type of property editor that takes a JSON schema and uses it to generate a form for editing. The point is to allow it to be extensible so you can specify a custom value editor control or other behavior based on extensions in the schema.

Logically the JSON document is a tree, but visually its a list of property item rows indented based on their depth in the logical tree. Basically a two-column, n-row grid.

The point: I'm not quite sure how to go about generating the property editing items. Sure I know different ways to do it, but not really a good clean way. I know about the whole hierarchal data template thing, but that isn't how the controls are actually organized. That's my real question I guess. What is a good way to go about transforming a logical tree of data into a visual list?

Edit: Well I managed to get it working with view models. Had to make a multi-value converter to handle the parent references.

Inverness fucked around with this message at 18:21 on Apr 4, 2015

Mongolian Queef
May 6, 2004

ljw1004 posted:

The way we have it set up within the VB/C# team at Microsoft is that, for each binary DLL, we upload its symbols to our company's internal symbol server. Also the symbols contain a TFS command to fetch the source. That way VS can automatically pull up the correct symbols, and can automatically pull up the correct source code. (I have no idea how this magic is accomplished...)

By the way, I've not seen it done with NuGet, but my first thought reading your post was "Use NuGet!". It seems like the best way to represent a dependency on a specific version of a DLL.

...

The way we do it is that each "independently maintained release" has its own branch in source control. Thus, Visual Studio 2013 RTM / Update1 / Update2 / Update3 go in branch called "D12Rel", and Visual Studio 2015 RTM will eventually go in a branch "D14Rel", and VS2015 CTP1 through CTP6 were all versions along the way in a single branch called "DP14". (If there's a bug in VS2013 then we can tell customers to upgrade to the latest VS2013 update, which is why VS2013 and all its updates go in just one branch: Update1 doesn't need its own branch, for instance. But we can't tell them all to upgrade to VS2015 which is why VS2013 has to be kept in its own branch).

We actually have large enough teams that each shared library (or set of libraries) has its own similar branch structure. Thus, the Roslyn team (VB/C# compilers) have one branch for the version of Roslyn that will go into VS2015RTM, and another branch for the latest ongoing development. That way, the main product branch DP14 / D12Rel / D14Rel doesn't need its own copies of the Roslyn source code. It merely gets "FCIBs", "Foreign Checked In Binaries", where we copy the output DLLs from the Roslyn branch into a folder called "ExternalAPIs" in the main product.


Yeah, I guess. But it's a fact of life. If you need to independently service old versions of your product (rather than just telling customers to buy the newest version), then you have to make it harder on yourself. So: if we really needed to fix a bug in an old release of our product, we'd sync up to the latest version in the branch for that release. And if it was a bug in the VB/C# compilers, then we'd also need to sync up to the appropriate version of the Roslyn source code.

We don't have one "canonical" .sln file. A developer working on one bug might have a SLN which includes a hodge-podge of related projects.

Thanks for your help. I have to spend time on other things now, but I have some ideas now. Thanks.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



I'm making a control in Silverlight that's made of several sub-controls and is also part of a larger application with a bunch of other user controls. I want to be able to use common resources in my new control without making them global. Is this C+Ping this into every XAML file the best way to do that?
XML code:
<UserControl.Resources>
	<ResourceDictionary>
		<ResourceDictionary.MergedDictionaries>
			<ResourceDictionary Source="MyResources.xaml"></ResourceDictionary>
		</ResourceDictionary.MergedDictionaries>
	</ResourceDictionary>
</UserControl.Resources>
It's the best advice I've found from Googling, but it seems like there ought to be a better way.

epswing
Nov 4, 2003

Soiled Meat
From my experience with WPF, that's how to do it.

Pretty crazy, that the idea is "reference MyResources.xaml" and the code is almost 300 characters full of angle brackets :(

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Yeah, it's nuts coming from HTML-land just how verbose some of this is. I was hoping there was a way to jam it into the parent namespace, which I think would work because each control has its own, but I'm not seeing one.

And there's still no way to define a data context on the control if the view model doesn't have a default constructor. Fantastic.

Munkeymon fucked around with this message at 22:55 on Apr 7, 2015

GoodCleanFun
Jan 28, 2004

Munkeymon posted:

Yeah, it's nuts coming from HTML-land just how verbose some of this is. I was hoping there was a way to jam it into the parent namespace, which I think would work because each control has its own, but I'm not seeing one.

And there's still no way to define a data context on the control if the view model doesn't have a default constructor. Fantastic.

If you add it to App.xaml it can be used throughout that project. I think that's what you mean by you don't want to define it globally.

Define your sub controls as part of a common wpf project and use it like a library. A bit hacky, but it should work.

RICHUNCLEPENNYBAGS
Dec 21, 2010

Munkeymon posted:

Yeah, it's nuts coming from HTML-land just how verbose some of this is. I was hoping there was a way to jam it into the parent namespace, which I think would work because each control has its own, but I'm not seeing one.

And there's still no way to define a data context on the control if the view model doesn't have a default constructor. Fantastic.

Is there any option for C# desktop apps that isn't totally painful? I'm half-tempted to go with self-hosted WebAPI + browser for my next project

Sedro
Dec 31, 2008

RICHUNCLEPENNYBAGS posted:

Is there any option for C# desktop apps that isn't totally painful?
no

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION
Visual Studio's pathetic attempt at auto-indenting for Razor templates is loving terrible. Discuss.

Inverness
Feb 4, 2009

Fully configurable personal assistant.
WPF isn't bad once you get used to it. Authoring a control (not a UserControl) and having it click on how control templates are used was a magical moment.

No you can't create components at design time unless they have a default constructor. I just solve that problem by making the default constructor throw if its not design time. Unity or MEF uses the constructor with more arity.

Having separate design and runtime constructors is also useful if you want to give your view model design data to see how it looks.

Inverness fucked around with this message at 04:08 on Apr 8, 2015

epswing
Nov 4, 2003

Soiled Meat

The Wizard of Poz posted:

Visual Studio's pathetic attempt at auto-indenting for Razor templates is loving terrible. Discuss.

The fact that they haven't offered an uncheckable checkbox for this is criminal. I'm literally afraid to Ctrl-V in *.cshtml files because it's SO loving BAD.

Edit: gently caress

epswing fucked around with this message at 04:24 on Apr 8, 2015

RICHUNCLEPENNYBAGS
Dec 21, 2010

Inverness posted:

WPF isn't bad once you get used to it. Authoring a control (not a UserControl) and having it click on how control templates are used was a magical moment.

No you can't create components at design time unless they have a default constructor. I just solve that problem by making the default constructor throw if its not design time. Unity or MEF uses the constructor with more arity.

Having separate design and runtime constructors is also useful if you want to give your view model design data to see how it looks.

I guess my problem is I don't really want to spend that much time on UI and I want, you know, the kind of "Bootstrap" of Windows UI development where there are sensible defaults and I don't usually have to mess with it.

If I really knew WPF I guess I could probably use reflection and XML writing to sketch out forms... I've used a similar trick with Angular HTML templates.

Adbot
ADBOT LOVES YOU

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

epalm posted:

The fact that they haven't offered an uncheckable checkbox for this is criminal. I'm literally afraid to Ctrl-V in *.cshtml files because it's SO loving BAD.

Edit: gently caress

Yep, likewise. *press enter* *razor template screams in agony as it gets twisted and mangled by VS*

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply