Search Results

Search found 11 results on 1 pages for 'aaginor'.

Page 1/1 | 1 

  • Mass deleting files in windows

    - by aaginor
    I have a directory, that contains ~ 3 million files in certain subdirectories on a Windows 2008 server. Manually deleting the files via SHIFT+DEL on the root dir takes ages. Is there any other way to do the deletion in a faster manner?

    Read the article

  • DataGridView Autosize but restrict max column size

    - by aaginor
    Hi folks, in my C# 4.0 Application, I have a DataGridView to display some data. I want the Columns size accordingly to the content, so I set the AutoSizeColumnsMode to AllCellsExceptHeader. But I want to restrict the columns to grow beyond a certain value. There is a MinimumWidth Property ... but unfortunately no MaximumWidth Property. Any ideas how to solve this? Thanks in advance, Frank

    Read the article

  • TemplateBinding and additional string in Silverlight

    - by aaginor
    Hi folks, In my Silverlight 3 application, I created a custom Tooltip, that is shown when the mouse is over a part of a Pie-Chart. The displayed values are set via TemplateBinding: <ToolTipService.ToolTip> <StackPanel> <ContentControl Content="{TemplateBinding IndependentValue}" FontWeight="Bold" /> <ContentControl Content="{TemplateBinding FormattedDependentValue}"/> <ContentControl Content="{TemplateBinding FormattedRatio}"/> </StackPanel> </ToolTipService.ToolTip> The tooltip shows the title of the pie-slice, the value that the size of the slice is based on and the percentage regarding the whole pie: MyTitel 9 12% Now, I want to add a constant string to the value, to show the following: MyTitel 9 items 12% the string 'items' shall be added to the displayed number. Is there a way to add the constant string to the Content-Property of the ContentControl? (I have no influence on the binded value FormattedDependentValue) Thanks in advance, Frank

    Read the article

  • High Runtime for Dictionary.Add for a large amount of items

    - by aaginor
    Hi folks, I have a C#-Application that stores data from a TextFile in a Dictionary-Object. The amount of data to be stored can be rather large, so it takes a lot of time inserting the entries. With many items in the Dictionary it gets even worse, because of the resizing of internal array, that stores the data for the Dictionary. So I initialized the Dictionary with the amount of items that will be added, but this has no impact on speed. Here is my function: private Dictionary<IdPair, Edge> AddEdgesToExistingNodes(HashSet<NodeConnection> connections) { Dictionary<IdPair, Edge> resultSet = new Dictionary<IdPair, Edge>(connections.Count); foreach (NodeConnection con in connections) { ... resultSet.Add(nodeIdPair, newEdge); } return resultSet; } In my tests, I insert ~300k items. I checked the running time with ANTS Performance Profiler and found, that the Average time for resultSet.Add(...) doesn't change when I initialize the Dictionary with the needed size. It is the same as when I initialize the Dictionary with new Dictionary(); (about 0.256 ms on average for each Add). This is definitely caused by the amount of data in the Dictionary (ALTHOUGH I initialized it with the desired size). For the first 20k items, the average time for Add is 0.03 ms for each item. Any idea, how to make the add-operation faster? Thanks in advance, Frank

    Read the article

  • Silverlight 4: StackPanel doesn't resize, when content gets more narrow

    - by Aaginor
    I am using Silverlight 4 with Blend 4. I have a (horizontal) stackpanel that includes some TextBoxes and a Button. The stackpanel is set to stretch to the size that the content uses. The TextBoxes are on autosize too. When I add text to the Textboxes, the textbox size grows and the stackpanel grows too. So far so good. When I remove text from the textboxes, the textbox size shrinks (as excepted), but the stackpanel size doesn't. Is there any trick to make the stackpanel change size, when the content (textboxes) getting smaller? Thanks in advance, Frank Here is the XAML for the UserControl: <Grid x:Name="LayoutRoot"> <StackPanel x:Name="StackPanelBorder" Orientation="Horizontal"> <TextBox x:Name="TextBoxCharacteristicName" TextWrapping="Wrap" Text="Tex"> </TextBox> <TextBox x:Name="TextBoxSep" TextWrapping="Wrap" Text="=" IsReadOnly="True"> </TextBox> <Button x:Name="ButtonRemove" Content="-" Click="ButtonAddOrRemove_Click"> </Button> </StackPanel> </Grid>

    Read the article

  • Custom iterator for dictionary?

    - by aaginor
    Hi folks, in my C#-Application, I have a Dictionary object. When iterating over the object using foreach, I naturally get each element of the dictionary. But I want only certain elements to be iterated, depending on the value of a property of MyValue. class MyValue { public bool AmIIncludedInTheIteration { get; set; } ... } Whenever AmIIncludedInTheIteration is false, the item shall not be returned by foreach. I understand that I need to implement my own iterator and override the Dictionary-Iterator somewhere. Can anyone here give me a short HowTo? Thanks in advance, Frank

    Read the article

  • SQL Server 2008 Stored Proc suddenly returns -1

    - by aaginor
    I use the following stored procedure from my SQL Server 2008 database to return a value to my C#-Program ALTER PROCEDURE [dbo].[getArticleBelongsToCatsCount] @id int AS BEGIN SET NOCOUNT ON; DECLARE @result int; set @result = (SELECT COUNT(*) FROM art_in_cat WHERE child_id = @id); return @result; END I use a SQLCommand-Object to call this Stored Procedure public int ExecuteNonQuery() { try { return _command.ExecuteNonQuery(); } catch (Exception e) { Logger.instance.ErrorRoutine(e, "Text: " + _command.CommandText); return -1; } } Till recently, everything works fine. All of a sudden, the stored procedure returned -1. At first, I suspected, that the ExecuteNonQuery-Command would have caused and Exception, but when stepping through the function, it shows that no Exception is thrown and the return value comes directly from return _command.ExecuteNonQuery(); I checked following parameters and they were as expected: - Connection object was set to the correct database with correct access values - the parameter for the SP was there and contained the right type, direction and value Then I checked the SP via SQLManager, I used the same value for the parameter like the one for which my C# brings -1 as result (btw. I checked some more parameter values in my C' program and they ALL returned -1) but in the manager, the SP returns the correct value. It looks like the call from my C# prog is somehow bugged, but as I don't get any error (it's just the -1 from the SP), I have no idea, where to look for a solution.

    Read the article

  • Count number of given object in a list with LINQ

    - by Aaginor
    I have a list which can contain multiple occurrences of the same object. Now I need to count, how often the given object is contained in this list. int count = 0; foreach (IMyObject item in myList) if (item == object2Count) count++; I am sure that this can be done nicer with LINQ, but LINQ is still a mystery to me. My first question is: How would I count the objects via LINQ and the second question: Will this LINQ version be slower or faster? I am using a ObservableCollection and the number of items in the list is usally rather small ... usally not more then 20. Thanks in advance, Frank

    Read the article

  • Forbid public Add and Delete for a List<T>

    - by aaginor
    Hi folks, in my C#-project, I have a class which contains a List public class MyClass { public MyClass parent; public List<MyClass> children; ... } I want to prevent the user of the class from Adding (and Deleting) an Element to the children-List, but he shall still be able to parse its elements. I want to handle the Adding and Deleting within MyClass, providing an AddChild(MyClass item) and DeleteChild(MyClass item) to ensure that, when an item is added to the child list, the parent of that item will be set properly. Any idea how to do this besides implementing my own IList? Thanks in advance, Frank

    Read the article

  • Dictionary as parameter, where the Value-Type is irrelevant

    - by aaginor
    Hi folks, I have a function, that returns the next higher value of a Dictionary-Keys-List compared to a given value. If we have a Key-List of {1, 4, 10, 24} and a given value of 8, the function would return 10. Obviously the type of the Value-Part of the Dictionary doesn't matter for the function, the function-code for a Dictionary<int, int> and Dictionary<int, myClass> would be the same. How has the method-head have to look like, when I want to call the function with any Dictionary, that has int as key-Type and the value-Type is irrelevant? I tried: private int GetClosedKey(Dictionary<int, object> list, int theValue); but it says that there are illegal arguments, when I call it with a Dictionary. I don't want to copy'n'paste the function for each different value-type that my function may be called. Any idea, how to accomplish that? Thanks in advance, Frank

    Read the article

1