C# is a multi-paradigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.

learn more… | top users | synonyms

1
vote
2answers
54 views

Parallel process interest in C#

In web api controller: I am a newer in parallel and Async&Task programming. Need someone help me code review. ...
1
vote
1answer
59 views

Move a folder to another in C#

In C# I wrote a method to move a folder into another existing folder: ...
2
votes
1answer
27 views

Weaving through the MIST - Strategy change?

New Question- Original post here for reference I've developed (and use) a IL "weaving" solution for auto-implementing property change notification in .NET applications but I'm considering using a ...
4
votes
2answers
46 views

Fetching the website version number from the database

I was just writing some code the other day, and I found myself writing something I am not sure whether it is OK to do it like this, or not. Let me give an example of what this is: I have this ...
2
votes
1answer
26 views

Add Field To PDF with Options for Multiple Pages

This is related to here and here. These two methods are used to programatically add a text field to a PDF document. The field can be of any user determined size and have any user determined title, and ...
0
votes
2answers
31 views

PDF Stamper Method to Add Field and Script to PDF File

This is related to my (unanswered) question here, but the code has changed considerably since I asked that question. I have a method that takes the filename of a PDF file and a Script object, and ...
2
votes
4answers
145 views

Implementation of warning storage

I implemented type (UserRuleManager) that will apply list of rules to entity User. I need your code review and your advices. ...
-1
votes
1answer
42 views

Function that returns zero-based indices of two distinct elements whose sum is equal to a target sum [on hold]

I've been working on an example test question: Example Problem Write a function that, given a list and a target sum, returns zero-based indices of any two distinct elements whose sum is equal to ...
0
votes
1answer
45 views

Find common items between two collections, and set values in one collection when matched

I want to find common items between two collection, and set values from one collection to another collection. I am aware of similar posts on the web, but they are different from this post. I want to ...
2
votes
3answers
446 views
4
votes
0answers
56 views

UWP scan for music files

I am implementing a music player for Windows 10, and I am in a bit of a pickle at the library phase. I am scanning for all the files in a music library (plus optional folders the user selects) and I ...
2
votes
2answers
310 views

Classes for reading XML from a file

Basically, all I have to do is read some xml from a file. And I have a working solution, although I am not sure that it is the best way of going about doing things, as I have only recently started ...
-4
votes
1answer
55 views

Does this work for Singleton Class concept? Trying to fill older HashTable once on login [on hold]

I am trying to fill a hashtable with LicenseID and FullName when user first logs in. I don't have access to the Licenses database right now. So "Context" is a place holder. I am at loss if what I am ...
3
votes
1answer
85 views

Concurrent non-blocking update of cached list of on-line users

I have following problem: My server (ASP.MVC WebAPI) is tracking, when client application ("Agent") is on-line. It's storing this inf on following table: ...
2
votes
1answer
39 views

PDF Script Tool - adds JavaScripts to PDF files

This is a Windows Forms application that adds JavaScripts to PDF files. It supports multiple files at the same time. Right now, the only supported script is a "time-stamp on print" script, but any ...
5
votes
2answers
88 views

Simple Tokenizer + Parser

Requirements A function is needed, that is able to parse a list of symbols with the following rules: Symbols may be associated with numbers or not. Numbers are defined by a comma separed list ...
-3
votes
0answers
47 views

Facing problem in Nested Async call [on hold]

PROBLEM : When I try to call _cacheManager.GetObject in controller of API then it calls most of the related methods and when the call reaches ...
9
votes
3answers
826 views

Calculating the amount of cubes needed to form a sum

Since I've never done any performance programming (Aside from the better choices such as array vs list etc. The real basics.), I should probably read up on it. But I had to start somewhere, so, ...
5
votes
2answers
225 views

C# helper class - mailto

I'm looking for input, advice, criticism. This is my first helper class. While use of mailto URLs should most often be trivial, I have a real world need to send to multiple recipients and with a body ...
2
votes
1answer
36 views

Player projectile shooting

I am wondering if my code is needlessly redundant. I noticed, when looking over my code, that I had a unnecessary variable and if statement. Both ...
0
votes
5answers
67 views

Calculations to reposition a logo

I have this block of code which clearly looks like duplicate, but I don't know how to refactor. ...
-2
votes
1answer
32 views

Getting a Random Word Generate to Generate Words without Repetition [closed]

I am just learning C# and am trying to write a random color generator for use with threadcrafting for fun. I've got it mostly operational, but it always repeats the same color however many times my ...
6
votes
3answers
141 views

MIST - auto-implemented, attribute-driven .NET notification mechanism

I have a component that I've used myself for quite some time, the short story is that it automagically implements a property change notification mechanism (very useful for implementing ...
4
votes
1answer
50 views

Code Explorer View Models

Continuing the series of Code Explorer posts, here is the collection of view models for the tree nodes: This is the interface for nodes with a declaration. ...
1
vote
2answers
58 views

Ceasar Cipher (Rot 13)

I've created a basic cipher program that will turn your string into a Rot13 cipher. I'm pretty sure there are much easier ways to do this, so a little input on what I've done would be great: What ...
2
votes
3answers
72 views

Text menu and validation of the chosen item

I am writing a c# console app that will take a user input from a list of selected options and do things based on the selected option. I have it working right now but just looking over it there seems ...
0
votes
1answer
50 views

Count check before Linq Single() call

Should I check Count before Linq Single() call if I excpecte only one elemet? ...
1
vote
0answers
29 views

Handle decimal in mongodb

I'm trying to find a way to handle decimals in mongodb. Is there any good way and/or should I handle it with a class like this: ...
4
votes
1answer
90 views

Large Switch Statement Handling 50+ Options That Call Different Methods

I have a switch statement used to handle options that a user selected (stored in an array). The array is iterated through, and for each element (enum object) in the array, an appropriate action is ...
0
votes
1answer
25 views

Unity3d class that inherits from button and add OnHold Event

I made my own class that inherits from button and has a OnHold event. It seems to work ok but I'm wondering if I can improve it or if you can spot any glaring mistakes that I made. Here is the code : ...
1
vote
0answers
35 views

Implementation of custom config section

i recently wrote my first custom config section. I have a collection of index files, each has a path and a savetime: ...
4
votes
0answers
121 views

Socket application using TPL

This is an application I wrote that allows multiple TCP clients to share a single TCP connection to a remote server (hosted project, and a demo). Traffic generated by the server is forwarded to all ...
0
votes
1answer
14 views

Accessing SharePoint's Managed Metadata TermSets Locally and Remotely

I have written a small program which has 2 main classes : ServerSideMMS: This can access the SharePoint Managed Metadata Services, but only from the server which ...
0
votes
0answers
39 views

IoC component registration

How do you list your referenced solution assemblies for IoC registration? I was really tired of typing something strange as new [] { typeof(SomeType).Assembly, … }. ...
0
votes
2answers
97 views

Returning a byte array from a method [closed]

public abstract class Element { // Removed for verbosity ... protected abstract byte[] GetBytes(); } I'm attempting to create an engine that can create a ...
3
votes
1answer
41 views

Active Directory Query Application - Take 2

This is an update to my previous post about my Active Directory Query Application. I have made multiple modifications, and I request some feedback. Summary: This program queries an active directory ...
12
votes
5answers
740 views

Reusable implementation of IComparable<T>

I often find myself implementing IComparable{T} in different classes for sorting in a very similar fashion: Values meeting criteria X and Y should be sorted to ...
4
votes
4answers
364 views

PermMissingElem- find the missing element in a given permutation in C#

I just encountered this question in codility but apparently this question has been asked in java already (here, here). Task description A zero-indexed array A consisting of \$N\$ different integers ...
-4
votes
0answers
21 views

What is rx timeout:2500 in xamarin android? [closed]

Keep getting output of rx timeout:2500 while trying to add a path to google maps in xamarin android. what exactly is rx timeout and how do i avoid it? I can't find it on the internet :(
2
votes
1answer
110 views

Creating archive from over 3GB of files in less than 1 minute

This is a follow up to this question. I got some very good answers for my process speed, and wanted to go ahead and share what I've done with the program. The new updates of the program consist of the ...
5
votes
1answer
62 views

Merging trips to the same location with overlapping dates

I have a SQLite database that only contains the holidays for 1 user. I have a new Trip object (newTrip) that has a ...
1
vote
1answer
64 views

Moving files while preserving the folder structure

I'm writing a console application that will look through a directory and move any log files that have a date modified older than X days (configurable in the ...
4
votes
1answer
63 views

Clean Way of marshaling data

I've been working on a game that I used to play as a kid. This game was disassembled then converted to C# by someone else and they hosted it on Github. I've forked it and started working on it some. ...
5
votes
3answers
573 views

Exclude scores when flag is set

I am not sure if I am just having a brain lapse here or if there is a better way to do this: I am trying to only add one to count in the following scenarios: the ...
5
votes
1answer
73 views

Speeding up process time while archiving files

I asked this question on Stackoverflow, and was told I might have better luck here. I'm new to c# and have created a basic file archiver. It works, and it does what it's suppose to do, but I think ...
-6
votes
4answers
156 views

How can I implement switch without code redundancy?

I have the following switch: ...
2
votes
1answer
77 views

Checking for vowels rewrite

A few days ago I posted a little program that would check for vowels within a given word. I have rewritten this program, it can only find vowels in the English language still but, it will now tell you ...
3
votes
2answers
86 views

User editable properties with varying number of arguments

Recently I used this pattern to create a list of properties, each property having a varying number of arguments. The properties list can be made at compile time, it does not need to change at ...
3
votes
1answer
101 views

Retrieving collections from a database

I have two collections that I want to retrieve from the database and associate with each other. My solution works, however I know it isn't the most elegant one. Do you have any suggestions on how to ...
3
votes
2answers
218 views

Active Directory Query Application

This application is designed to query an active directory, and at the moment, performs only two tasks: Save a list of all users to a file. Save a list of all groups that all users are in to a file. ...