|
So you think that the proxy should expose a few values like the return code so that I can use it correct?
|
|
|
|
|
I'm not sure what you mean by that. It should "expose" the return value *as* a return value. Externally, it's useage should be identical to your original proxy, but internally it should call the proxy, update tracking information, and return whatever the proxy returned.
Perhaps we are talking past one another. What I mean is you have some generated proxy like this:
class Proxy
{
public int Foo()
{
}
}
and some code that uses it,
class UserCode
{
void Bar()
{
var x = new Proxy().Foo();
}
}
You can now introduce a "metaproxy",
class MetaProxy
{
int clientID;
Proxy proxy = new Proxy();
public MetaProxy(int clientID)
{
this.clientID = clientID;
}
public int Foo()
{
var x = proxy.Foo();
Tracking.Register("Foo", clientID, x);
return x;
}
}
Lastly of course the user code must be modified to use MetaProxy instead of Proxy.
I don't know the details of what sort of tracking you really need to do. Nor do I know, or want to know , everything needed to say if this is how you should obtain the information you need (examplified by "clientID"). If you have this information everywhere you are making such calls, perhaps this is a good way of doing it. If you don't, and this is in an application processing requests (so that everything that happens in a thread happens on behalf of a particular client) perhaps it'd be nice to put the clientID in a ThreadStatic instead, and then your MetaProxy could just have a default constructor and sniff out the clientID from there.
So you still have to do your own thinking. But hopefully this will make it clear how I propose you can establish tracking. Of course just keeping track of things is not going to do anything more than that.
|
|
|
|
|
Hi,
I have a requirement to render the contents from excel to word. With a condition that the content after rendering to word should look like they way it is displayed in print preview mode of excel. Can anybody help me on this?
To give additional information, I need the properites set in excel also to be rentered while rendering to word.
For example: If the mode is set to landscape in excel I want the same mode to be set in word after rendering. Similar with boarders, margins, print area and scalings.
Thanks
Ullas Joseph
|
|
|
|
|
Hi,
I think you are supposed to use the microsoft.interop.excel and the microsoft.interop.word DLL. They are installed with the MS Office Suite and depend on the office suites' version.
You can add them in your Visual Studio project via COM.
Hope my tip helps
Marco
|
|
|
|
|
Is there any property or any option that needs to be checked in order to display the sheet name in the rendered output of an excel document. I am doing a Excel "Save As" to PDF format.
|
|
|
|
|
Are you trying to do this through code?
|
|
|
|
|
In a C# 2010 application, I am currently using the following to statements to select files for *summ.xls files.
string[] files = Directory.GetFiles(C:\temp\09_20_2012\CUSTOMER1, "*summ.xls",SearchOption.AllDirectories);
string[] files = Directory.GetFiles("C:\\temp", "*summ.xls", SearchOption.AllDirectories);
However now I need to exclude the following kind of files from the next directory search:
1. *summ.xlsx,
2. *report.xlsx,
and
3. invalid*.xlsx. In this case the files start with the word invalid and the rest of the file name can be anything. However these files are also of type *.xlsx.
Thus for like the statement,
"string[] files = Directory.GetFiles("C:\\temp", "*summ.xls", SearchOption.AllDirectories);", can you tell me how would I change the statement above to exclude the specific file names I just listed above?
Can you show me how to make this coding change and/or point me to a reference I can use to solve the problem?
modified 10-Oct-12 0:01am.
|
|
|
|
|
See her:
http://msdn.microsoft.com/en-us/library/ms143316.aspx
From description it is not possible. I would use EnumerateFiles method instead and then linq Where with maybe RegExp for file name pattern.
No more Mister Nice Guy... >: |
|
|
|
|
|
There is no direct way to do it - the GetFiles method does not provide an "except files matching this" option.
Personally, I would do a "straight" GetFiles, then post process the list to remove the exceptions: in your case it is a pretty simple loop or Linq statement - remember that the Path class will extract the file name and extension separately for you with the Path.GetFileNameWithoutExtension[^] and Path.GetExtension[^] methods
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
I am new to web development. I am trying to write a web application that a user can click on 2 boxes and program should draw a line between them. I have no clue on how to start this project. Any help is much appropriated.
How is google map written? how can they draw shapes and users can click on it? Would like my app to behave the same way.
Thanks in advanced.
|
|
|
|
|
Are you really sure you wrote this in the right forum? You wouldn't do this using C# - you would use JavaScript for this.
|
|
|
|
|
Thanks for the response Pete.
So what you are saying is this functionality is not possible with c#. I though I could do this in C# since I have done similar functions with a Win Forms.
What I thought I could create a embedded object (such as ActiveX) and go in that route. So that was a wrong thinking.
So I should try this in JavaScript or HTML5?
|
|
|
|
|
If you don't just want it to run in IE on Windows, you shouldn't use ActiveX. If you look at Google Maps (for instance), you will see that they make extensive use of JavaScript.
|
|
|
|
|
I think this correct solution for ur problem bro there will be control in wind froms called web browser i think it will help u well
and u should import class library called using.system.diagonstic()
|
|
|
|
|
A couple of points. First, when answering questions in the forums, it is best not to use text speak. This is looked on as unprofessional, and will often result in people downvoting your answer.
Secondly, it is important to consider what the user is actually asking. He has asked how to draw on a web page, and your answer has absolutely nothing to do with drawing on a web page. I commend you for wanting to help out, but it's better not to answer than to give completely the wrong answer.
|
|
|
|
|
I'm working with an Infragistics UltraTree. The types loaded into the tree are each stored on the node's Tag property. I want to activate a node based on a particular instance of a type.
So far I have:
public void SelectNodeByEntity<T>(T Entity)
{
UltraTreeNode node = GetNode(UltraTree1.Nodes, Entity);
if (node != null)
{
UltraTree1.ActiveNode = node;
}
}
private UltraTreeNode GetNode<T>(TreeNodesCollection Nodes, T Entity)
{
UltraTreeNode retVal = null;
foreach (UltraTreeNode node in Nodes)
{
var entity = (T)node.Tag;
if (entity == Entity)
{
return node;
}
else
{
if (node.Nodes.Count > 0)
{
return GetNode<T>(node.Nodes, Entity);
}
}
}
return retVal;
}
But it won't compile on the line indicated above with "Operator '==' cannot be applied to operands of type 'T' and 'T'".
How do I pull the object off the tag, convert it to type T and compare it with the type passed in to see if their the same?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
Try using .Equals instead. == isn't allowed when comparing generic types (in the same way as you can't use ++ or --).
|
|
|
|
|
That did it. Thanks Pete!
If it's not broken, fix it until it is
|
|
|
|
|
Not a problem. I'm glad I could help.
|
|
|
|
|
Just the bug left to be corrected now...
(You don't want to terminate the search if the current node is not the entity you're looking for AND it has children, but you are. Instead, if searching the subtree yields null, you want to continue with the next node.)
|
|
|
|
|
... or for a reference equality check,
if((object)entity == (object)Entity){ ... }
|
|
|
|
|
I've never looked into it and I don't have Reflector here - is there any advantage to casting to object and using the equality operator compared to object.ReferenceEquals(a, b) in your opinion?
|
|
|
|
|
I don't think there's any difference, it's a matter of which you find more readable. I like to see == because that can be seen to be an equality check at a glance, whereas a method call you actually have to read the word to find out what is happening.
|
|
|
|
|
i'm working on project related to Data Mining.This project called Medical Data
Analysis, it is a program that analyze medical data, in my case the data is
Breast Cancer Wisconsin. I am using WEKA as my data mining tools and C# as
my front end
and i can't create any thing in this matter
can anyone help me in this
|
|
|
|
|
kimo_4u wrote: can anyone help me in this It's quite possible that they can, but you need to give some more specific details about what problems you are having, it's unlikely that anyone will be able to guess.
One of these days I'm going to think of a really clever signature.
|
|
|
|