|
Sorry, maybe I was not clear on help wanted..
I want to pass values to Process function, but only object in the range from 1000 to 6000
for example.
object[] result = values; // values holds 7000 objects
Process( values );
// Process( values[1000][values.Length - 1000] ); // something like this
Sk8tZ
|
|
|
|
|
yeah sorry i realised that and modified my original post (I hoped to do it before you read it :P
object[] records2 = new object[records.Length - 2];
Array.Copy(records, 1, records2, 0, records.Length - 2);
where 1 is the start index in the original array and records.Length - 2 is the length to copy. So in this case your chopping off the first and last record.
|
|
|
|
|
|
np took me a while the other day to figure out how to do that
I'm so used to working with generic collections I've lost touch with arrays.
|
|
|
|
|
I need to know that when i use "Webclient" class to download file via http protocol such this
Webclient WC=new Webclient();
WC.Download(url,file1);
WC.Download(url,file2);
WC.Download(url,file3);
WC.Download(url,file4);
...
...
...
when the connection is closed? Is it disconnect every time when finished each downloading file? or It will disconnect only when i use "WC.Dispose();"?
Thank for your answers
=)
|
|
|
|
|
Is there any way to remove all the event handlers associated with buttons click event without using -= operator
|
|
|
|
|
With an event you can use only += or -= operator. Actually keyword "event" is modifying a delegate for this behaviour.
|
|
|
|
|
Hello,
A suggestion I gave some time ago and got no feedback, and never tried it myselfe!
But maybe it helps you.
The control class has a member called Events, which is a list of EventHandler (System.ComponentModel.EventHandlerList).
This class provides a method called "RemoveHandler".
Please let me know if it works for you!
All the best,
Martin
|
|
|
|
|
Hi Martin,
Thanks for the reply.
Control class has a "protected" property called Events which I can't use in my code(which is a Outlook addin)becoz I am using CommandBarButton.
|
|
|
|
|
Hello,
Don't care!
I now tested it with an inherited Control, and found out, that it would not fit your needs.
All the best,
Martin
|
|
|
|
|
No there isn't. You can't set an event to be null or something for example, which is strange because it is initialized to be null . Here's my way of going around it:
public event EventHandler ExampleEvent;
public void UnHook()
{
Collection<EventHandler> ExampleHandlers = new Collection<EventHandler>();
foreach (Delegate d in this.ExampleEvent.GetInvocationList())
ExampleHandlers.Add(d as EventHandler);
foreach (EventHandler e in ExampleHandlers)
this.ExampleEvent-= e;
}
I don't know if there's a better way for this, but this works for me...
Standards are great! Everybody should have one!
|
|
|
|
|
Hi
Is there any support in c# to create and save animated gifs yet?
If so can it be done in c# express and a code snippet would be helpfull.
ty
|
|
|
|
|
I suggest using GIMP.
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Can anyone explain why EditorAttribute is sealed, whilst DisplayNameAttribute isn't ?
I've no desire to base anything on the latter, but I would like to add some stuff to the former, as things stand I have two attributes, EditorAttribute and MyEditorAttribute, when one would suffice if I could inherit from EditorAttribute.
|
|
|
|
|
hi
any body can help how to develop or to create search engine for a job portal on .net with sqlserver which supports caching
|
|
|
|
|
This is way too big a question. Do you have some sort of design? What problems are you facing?
Don't take this the wrong way, but this is not the place to give your requirements and get a complete app in return.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Hi vikram thanks for ur reply,
Actually i want the design and introduction to start the search engine development becoz we can use this component any where in the project tats we r planning to develop an serch engine.
thanks
|
|
|
|
|
I'm sure plenty of people will be willing to provide that if you pay them.
|
|
|
|
|
Is the data already in sql server? If not figure out how to get it in there :P
Then give each bit of content keywords and properties to assist in finding relevant info.
Use Full Text Indexing to allow search of body's of text.
Understanding SQL Server Full-Text Indexing
[^]
If you want caching then cache the results for a set period of time.
For spell checking and stuff like that you can use soundex and double metaphone, to find similar words using phonetics and letter similarity.
Beyond this you need to research, experiment and just try stuff to see what works. If you have any specific (i.e. not stuff like "what should my database look like?" but stuff like "why isn't this stored procedure working?") problems come back and we'll be happy to help
|
|
|
|
|
I don't see why you want to write a search engine all the way from scratch.
One of the opensource stuff that I know of is lucene [^]
If you need a dot net version check this link http://incubator.apache.org/lucene.net/
rAm
i Think, i Wait, i Fast -- Siddartha
|
|
|
|
|
Nope.
Chuck Norris counted to infinity - twice.
|
|
|
|
|
Hi all,
Can you please tell me the way to write a log entry into a text file???
once i use the LogEntry object and the Logger object, i need the use the FlatFile TraceListener to write into a .txt file.
where and how do i specify the tect file name??
Thanks,
Ramesh
|
|
|
|
|
I am not sure you are using the application block ui. In the UI its pretty straight forward.
Go to:
Application Configuration-> Logging Application Block -> Trace Listeners
In there add a new Flat File TraceListener.
It give a file name option.
The XML will look something like below:
<listeners> <add filename="trace.log" header="----------------------------------------"
="" footer="----------------------------------------" formatter="" listenerdatatype="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" traceoutputoptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="FlatFile TraceListener">
<add source="Enterprise Library Logging" formatter="Text Formatter"
="" log="Application" machinename="" listenerdatatype="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" traceoutputoptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Formatted EventLog TraceListener">
rAm
i Think, i Wait, i Fast -- Siddartha
|
|
|
|
|
Dear all
Hi, I m new in c#, so can any one send me the code, about how i can upload/display images from my form of desktop application using SQL Server 2000.
mr_shoaib@hotmail.com
thnx
Best Regards
Shoaib A Shaikh
|
|
|
|
|
Hi guys.
I'm currently working on a datagridview which is bound up to a bindinglist containing a custom display class. The grid already contains ImageColumns for displaying the Icon properties which works properly, only that sorting on them isn't quite what we expected.
The previous programmer implemented a sortalgorithm where sorting on an DataGridViewImageColumn, for Icon type properties, would result in actually using another TextboxColumn containing numeric values for the sort part. But this isn't generic enough as all ImageColumns are sorted for the same numeric value...
So I thought I'd replace the Icon properties for the value objects with IconWrappers containing an icon and a sortable value, and make custom IconWrapperCell and IconWrapperColumn types inhereting from DataGridViewImageColumn and DataGridViewImageCell, and insert these into the DataGridView for the columns that the bindinglist create for the IconWrapper properties.
This seems to be close but no sigar. The bindinglist fails to insert the value into the new columns even though the columnname is identical. OnPaint method for the IconWrapperCell keeps trying to paint with value = null, and if I force the value to be an icon, that icon isn't drawn either.
Has anybody tried anything like this?
I'd really appreciate some feedback if anyone knows anything about replacing/forcing columnstypes for bindinlist created columns.
-- modified at 4:51 Thursday 5th July, 2007
Found a workaround to my problem.
Didn't solve the jigsaw for replacing bindinglist created columns,
but replaced the Icon properties for the value objects with Image type and
used the Image.Tag property for storing sortable values.
-Larantz-
|
|
|
|