|
I have an .Net 4.0 app that runs processes at specified intervals. My code uses reflection to run the process:
private static void executeProccess(ProcessEntity process)
{
_ProcessBase instance = null;
try
{
Assembly assembly = Assembly.LoadFrom(process.AssemblyName);
Type type = assembly.GetType(process.TypeName);
instance = (_ProcessBase)Activator.CreateInstance(type);
}
catch (Exception e)
{
LogMessage(e);
}
if (instance != null)
{
LogMessage(string.Format("Starting process '{0}'", process.Caption));
var task = Task.Factory.StartNew<ProcessResponseEntity>(() => instance.Execute())
.ContinueWith(x => processCompleted(x.Result));
task.ContinueWith(ExceptionHandler, TaskContinuationOptions.OnlyOnFaulted);
task.Wait(1000);
}
}
private static void ExceptionHandler(Task task)
{
var exception = task.Exception;
Console.WriteLine(exception);
}
I can't see to get the exception handing code to work right. Is this the right way to do this?
If it's not broken, fix it until it is
|
|
|
|
|
Hello
Here is a free .NET obfuscator, I've created it to use for my own projects.
What it currently can do: rename types and remove namespaces, rename methods and fields, remove properties and events declarations, rename (private) assembly files. Basically, my primary goal was to make it remove all meaningful information that can help reverse engineers to analyze the program.
It provides 2 features, that I needed and couldn't find in existing products:
1. Flexible settings system that allows fine-grained control over classes and members obfuscation parameters.
2. It can obfuscate public types and members (useful for assemblies that are not exposed outside of your program)
Looking forward to your feedback.
|
|
|
|
|
Write an article about it and you'll get the feedback you desire. This is not the right place to post this, otherwise.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Well, I wasn't sure if it's allowed.
I promise to write an article, but the project is not mature enough (yet).
|
|
|
|
|
ianderf wrote: the project is not mature enough (yet). Then it's too early for people to review it.
|
|
|
|
|
Hi guys,
I've been working on a custom component which acts as a 'view' control, such that it manually paints cells for child items. The component can contain hundreds of child items, which means that I've had to utilise the BufferedGraphics object for maintaining the graphics, and reset it only when the component is resized or when the child items are changed. Each child items also owns it's own BufferedGraphics object to maintain the rendering of each item (since these items can contain an Image in the graphics, it speeds up the painting considerably.)
A problem surfaces when I start to take into account scrolling through the use of AutoScroll and AutoScrollPosition . I've spent a good while trying to search for an answer to applying the scroll position offset to a BufferedGraphics and I've yet yielded unsuccessful results. Several problems are standing in the way of the scrolling functionality:
1. Graphics.TranslateTransform() or Graphics.Transform = new Matrix() does not translate a BufferedGraphics.Render() operation. I believe this is namely because the Render() function just paints directly onto the Graphics handle for the region it was allocated by.
For example, the below does not work:
override void OnPaint(PaintEventArgs e)
{
e.Graphics.TranslateTransform(-AutoScrollPosition.X, -AutoScrollPosition.Y);
this.bufferedGraphics.Render(e.Graphics);
}
2. Following the code in this example [^] results in many invalidations, which causes the graphics to lag to the point that it's infeasible for the component.
My question is, is there a reliable method of being able to translate the buffered graphics of a BufferedGraphics object when painting onto a Graphics handle? For instance, could I allocate my BufferedGraphics as I do in point #1, and intrinsically invalidate the component upon scrolling and simply offset the buffered graphics depending on the position the user has scrolled to?
If not, can anyone recommend a suitable replacement for rendering like this? Obviously, components such as the ListView class have the ability to render many items with scrolling, with little issues with performance (depending on which double-buffering and CreateParams changes are made.)
|
|
|
|
|
Just for anyone with a similar question in the future, I managed to resolve this quite simply.
Upon the OnScroll event method, simply invalidate the BufferedGraphics object by disposing it, and reset it back to null. Invalidate the whole component, and when constructing the new BufferedGraphics object, set the targetRectangle parameter's X and Y values to the respective AutoScrollPosition values.
Why this isn't mentioned elsewhere, I don't know.
|
|
|
|
|
I created custom property attribute to link every system test to its driving requirements which is similar to something described in the link below:
http://stackoverflow.com/questions/22187229/nunit-multiple-properties-of-the-same-name-linking-to-requirements/23533180#23533180
I used the code given in the above link
[Requirements(new string[] { "FR50082", "FR50084" })]
[TestCase("PoCTest")]
<pre>public void TestSomething(string a, string b)
{
Assert.AreNotEqual(a, b); }
which gets displayed in Test explorer (filter by traits) as :-
Requirements[System.String[]] (1)
TestSomething.....
But this is not what I was expecting. I require every requirement to get displayed individually though they are associated to the same test case in test explorer window.
I want to get it displayed as (in test explorer):-
Requirements[FR50082] (1)
TestSomething.....
Requirements[FR50084] (1)
TestSomething.....
and so on....
So, if I am associating n number of Requirements to a test case, the test explorer should display the same test case n times under different requirements. Please let me know how could this be achieved ??
|
|
|
|
|
I have used T4 Text Templating For my Vs Package.am using Customlinecommandhost for transformation.After Transformation the Output file contains Unnecessary lines.the output is as follows.
Namespace myt4
{
Using System
line :1 C:\Users\kanimozhikp\Documents\Visual Studio 2012\Projects\samp
Public override string TextTransform()
{
}...and so on.i dont need the above mentioned line in my output.Please any one give me the solution.and more over this problem arises on windows 8.1 only,it works fine at windows 7 and 8
modified 8-May-14 6:02am.
|
|
|
|
|
most of the time we point store procedure or table and then SSRS report designer show us field and we just drag drop those field on to report designer surface. after all we call those report programmatically and pass parameter and report shown on report viewer.
now my company want that customer will customize the report who will see the report. they want to display all the fields in a form and just customer will select each field and place on report designer surface and give some input like filter condition like date range or employee id etc and report will be shown. also at run time if customer want they can add text or move existing field etc on report viewer surface.
i do not have any idea how could i do this with SSRS. if this is possible with SSRS then please guide me in such a way as a result i can start the job or if possible give me few relevant url of that kind from where i can get the idea. thanks
tbhattacharjee
|
|
|
|
|
I thought SSRS had a deployable report designer. However I can't locate it so it has probably been deprecated from lack of use.
I have deployed a number of user targeted report designers, not a single one has ever been used, your users will not invest the time and resource into learning the data structure, learning how to build the report. They also may not have the experience to build the reports.
I suggest you get give them a read only connection to the database and let them choose their own tool.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
probably u guys do not understand my requirement. i am talking about report builder or designer. tools application provide custom report designer which help customer to build their report. so i was thinking that can we use the existing ssrs report designer instead of purchasing a new one like devexpress has one that kind.
as a developer i will design apps for our customer in such a way that customer can open report designer from my apps and drag provided fields on the report designer surface and design their report as they like with minimum technical knowledge.
if still my requirement is not clear then please let me know. so i can explain it in more detail. thanks
tbhattacharjee
|
|
|
|
|
|
Hah I knew it was out there somewhere, I still don't think the users will use the bloody thing but at least management can say they have supplied the tool. Have 5 for your google foo.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
probably u guys do not understand my requirement. i am talking about report builder or designer. tools application provide custom report designer which help customer to build their report. so i was thinking that can we use the existing ssrs report designer instead of purchasing a new one like devexpress has one that kind.
as a developer i will design apps for our customer in such a way that customer can open report designer from my apps and drag provided fields on the report designer surface and design their report as they like with minimum technical knowledge.
if still my requirement is not clear then please let me know. so i can explain it in more detail. thanks
tbhattacharjee
|
|
|
|
|
Did you do the research on the links from Ryan, they point to SSRS Report Builder, this is a component you can deploy doing EXACTLY what you are asking for. You, as the developer, have to prepare the data for the report builder tool, the end user can then build SSRS reports using that tool.
No one mentioned DevExpress, you said you are already using SSRS.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Tridip Bhattacharjee wrote: which help customer to build their report. That's exactly what Report Builder does. Even the name of it suggests that.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Mycroft Holmes wrote: I still don't think the users will use the bloody thing What? We have it deployed with a bunch of our customers and they use it all the time. The 2008+ version is even better in some ways.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
probably u guys do not understand my requirement. i am talking about report builder or designer. tools application provide custom report designer which help customer to build their report. so i was thinking that can we use the existing ssrs report designer instead of purchasing a new one like devexpress has one that kind.
as a developer i will design apps for our customer in such a way that customer can open report designer from my apps and drag provided fields on the report designer surface and design their report as they like with minimum technical knowledge.
if still my requirement is not clear then please let me know. so i can explain it in more detail. thanks
tbhattacharjee
|
|
|
|
|
Quote: as a developer i will design apps for our customer in such a way that customer can open report designer from my apps and drag provided fields on the report designer surface and design their report as they like with minimum technical knowledge. That is exactly what Report Builder does.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
nowadays repository design patter is very popular but if anyone need to implement it for their project then hw has write good amount of code. so is there any free tool exist which generate code for generic repository design pattern. please guide. thanks
tbhattacharjee
|
|
|
|
|
CodeProject has many resources for understanding, and using, the repository pattern. Start here: [^]. Then look at the other relevant articles listed in the column on the right side of the article.
“I speak in a poem of the ancient food of heroes: humiliation, unhappiness, discord. Those things are given to us to transform, so that we may make from the miserable circumstances of our lives things that are eternal, or aspire to be so.” Jorge Luis Borges
|
|
|
|
|
I need a sample program for Text Transformation in Visual studio Extension. i.e invoking Text Transformation with Visual studio Package.I searched everywhere but there is no clear solution for my problem.can anyone please help me to find the solution.
|
|
|
|
|
|
Thanks for Your concern.But I have already gone through this link.Am have Problem in using Iserviceprovider,The snippet in that link was not clear to me.Can some one help me with Some other Clear Sample.
|
|
|
|