General question to other C# developers and developers in general.

This is just a general question to any developers out there that are having the similar issue i am having: How often do you forget syntax or how to do something? Sometimes i forget the most basic of things, i then need to Google them and as soon as i see some example of how the syntax or problem is being used it clicks again. Almost like amnesia for 5 seconds until i Google it and then boom! It's back into my memory. How often does this occur in a development setting? Should i be expecting to be Googling a lot when i get a job and become more in depth with advanced features of C#? It seems i find myself forgetting syntax rather than forgetting algorithms or getting stuck on the logic part of the code. I have been using C# for awhile now as well (6 months) however C# is my first language although i did dabble in Java and Python a few times. So, does anyone have any suggestions? Is Googling a common thing to do within professional development? Thank you for your time :)

by sloansta via /r/csharp

How do I get the Braces {} to automatically vertically align when saving, or ideally after finishing that block and moving on?

I have Resharper and VS2015 + a few extensions such as visafora, and another that gives me vertical lines between braces. But sometimes the braces won't align vertically when saved, and historically I have seen them move into alignment automatically.

Its a pain in the neck to have to do it manually.

Where in the designers, (RS or VS) is the setting to make it happen automatically upon inserting the closing brace?

Cheers

by no1name via /r/csharp

Is this normal?

I'm a sysadmin that uses C# pretty extensively to manage communication between our shop floor and our ERP database. The ERP has a very extensive API which has made my life a lot easier.

I'm a programmer for function only, I have a LOT to learn and I know it. I have a general question about our API though, there are a lot of methods with huge lists of parameters, and they look funny to me. Is this a normal practice?

Example

by fievelm via /r/csharp

Can you help fix this code for my game please?

I am using Unity 5 and when I finish with the code the error says: "Assets/Scripts/Player/PlayerMovement.cs(55,22): error CS1547: Keyword 'void' cannot be used in this context" And my code is this: using UnityEngine;

public class PlayerMovement : MonoBehaviour { public float speed = 6f;

Vector3 movement; Animator anim; Rigidbody playerRigidBody; int FloorMask; float camRayLength = 100f; void Awake() { floorMask = LayerMask.GetMask ("Floor"); anim = GetComponent<Animator> (); playerRigidbody = GetComponent<Rigidbody> (); } void FixedUpdate() { float h = Input.GetAxisRaw ("Horizontal"); float v = Input.GetAxisRaw ("Vertical"); Move (h, v); Turning (); Animating (h, v); } void Move (float h, float v) { movement.Set (h, 0f, v); movement = movement.normalized * speed * Time.deltaTime; playerRigidbody.MovePosition (transform.position + movement); } void Turning() { Ray camRay = Camera.main.ScreenPointToRay (Input.mousePosition); RaycastHit floorHit; if (Physics.Raycast (camRay, out floorHit, camRayLength, floormask)) { { Vector3 playerToMouse = floorHit.point - transform.position; playerToMouse.y = 0f; Quaternion newRotation = Quaternion.LookRotation (playerToMouse); playerRigidbody.MoveRotation (newRotation); } } void Animating(float h, float v) { bool walking = h != 0f || v != 0f; anim.SetBool ("IsWalking", walking); } 

}

by Cobster2000 via /r/csharp

Branching / Merging of Ad Hoc Queries

We have a basic setup where we branch by release that has worked out well. The problem is, we occasionally have the need to have scripts that either pull inconsistent requests, from higher ups, of data or data changes that are still on the backlog.

However, over time, these folders fill up with these useless one-off scripts across the released branches.

I'm curious about what you folks are doing for these sorts of things. I've thought about making a separate set of folders outside of the branches that get sub folders per release. I've thought about just doing the merging/branching and leaving those behind.

Anyway, curious what you guys think or have done that worked well for your shop.

by abyzmic via /r/csharp

WPF MVVM – Retaining Datagrid Selection during a CollectionViewSource.View.Refresh()?

I'm a little new to MVVM, so please let me know if I'm just dead wrong here.

So without MVVM you are handling the Datagrid with code behind – so it's not a problem to just store the selection prior to the refresh, then force the reselection as soon as you refresh.

But with MVVM, it doesn't quite work like that. I can get the current selection from the GUI, of course, but I can't force the selection back afterwards. (ie. I'd need to check that the datagrid is focused before the refresh, then store the current selection, then refresh, then re-focus the datagrid and make sure the right object is selected if it still exists).

Any tips on this?

Edit: The reason I am using a CollectionViewSource.View.Refresh() is because I'd like the data to be resorted if it changes (contacting an API for data).

by RobCubed via /r/csharp

360 Total Security trojan…

Hey guys I have a problem with C# and Visual Studio 2015. If I make any .exe from an WF-Application or Console-Application, 360 Total Security will block it and say it's a trojan. I can whitelist it but if this .exe gets send to someone else it will also get blocked. Is there anyway to "sign" it to give it some sort of "trust" ? I'm coming from java so I never had to do any of this things. But I know that you need to "sign" apk's in android, so maybe it's the same case in c#? If so could someone send me a link with informations about it?

Thanks in advance

by Akarastio via /r/csharp

Help With WinForm

I'm creating a pretty basic WinForm application, but I can't seem to figure out a few things. I have a form that launches and has four button options. Each I want to take to another form with more options for that category.

The issues I'm having is that when I go from the first to second form, how can I kill the first one from continuing to run? Am I able to do that or is there another way to go about this?

Second, when I close the second form, I would like a way to relaunch the first to reselect a category. How can I do that?

I've tried to find these online, but I can't seem to find an exact answer on how to do this. Hopefully you guys are able to help! Thanks.

by Dr_Dornon via /r/csharp