|
This is a static class, so it seems that you must have a static method in there that returns an initialized version of the class. When you type in your class, type in PDFToImage pdf2i = PDFToImage. Intellisense should return the method you need.
|
|
|
|
|
Thanks for replying to my post. The IntelliSense dropdown contains not a single line of pdfbox-related object at all. I wish it did. The dropdown doesn't even list pdfbox itself.
I don't know if it's because these DLLs were IKVMed from Java bytecode or what.
But--oddly in the same IDE--the mouseover can inform the user, by mouseover caption, that PDFToImage is part of the org.pdfbox namespace. That much shows up.
(I'm using SharpDevelop.)
|
|
|
|
|
I think you should familiarize yourself with the environment and tools before proceeding; i.e. Pick up a basic .NET book and read a little.
only two letters away from being an asset
|
|
|
|
|
I am developing an application in Visual Studio C# 2008 Express Edition.
I need to have a password protected access to a dialog box containing a check box. the value of the check can be only modified if password is provided. The value of the check box should be always available to the application to check the status.
Please tell me how can I accomplish having a password protection to such data.
Thanks,
Karmendra
|
|
|
|
|
Add login to the application and check the credentials when displaying the dialog. It isn't that difficult and there are plenty of examples here and elsewhere. What have you tried so far?
only two letters away from being an asset
|
|
|
|
|
Hi there , i'm trying to create a class in C# to use my Sql operations but i'm facing some problems.
Although i'm using the code to import SQL objects(using system.data.sqlclient;) i can't declare variables such as Sqlcommand or sqlclient for ex.That way the class get's kind meaningless.How can i use them?
Thanks for your help and pacience as you will figure it out i'm learning C# i was a Vb6 coder.
|
|
|
|
|
You mean the compiler doesn't find the SqlCommand and other types? You need to add a reference to the System.Data.dll. In Visual Studio right click on the project and select "Add Reference".
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
|
|
I'm facing some problems with ObservableCollection constructor..
Any idea why this code is not working?
entity.Currencies = new ObservableCollection<CurrencyEntity>(CurreniesList.Where( c => c.IsSelected));
Note:
1. entity.Currencies is ObservableCollection<CurrencyEntity>().
2. CurrenciesList is ObservableCollection<CurrencyEntity>().
3. CurrencyEntity class has a proprety called "IsSelected".
Thanks in advance.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
|
|
|
|
|
ObservableCollection < T > 's constructor takes a List < T >, and not IEnumerable < T >, presumably because only then can it "observe" addition and removal of elements. Simply wrapping the result of CurrenciesList.Where in a list should solve the problem.
new ObservableCollection <CurrencyEntity>(
new List<CurrencyEntity>(currenciesList.Where(c => c.IsSelected)));
|
|
|
|
|
Hi Senthil,
Thanks but I'm still getting the error. There are 3 constructors[^] in ObservableCollection.
IEnumerable[^] is one of them.
Or, Am I missing something??
|
|
|
|
|
|
The error message is like it doesn't a constructor that takes 1 argument.
I'm using 3.5.... Am i referencing the wrong dll or need to import some namespaces? it's very strange
|
|
|
|
|
What does hitting F12 (Go to Definition) on the ObservableCollection show?
|
|
|
|
|
This sounds a bit strange, because this is working for me:
public class CurrencyEntity
{
public bool IsSelected
{
get { return true; }
}
}
This is just a stub, and here's the code:
List<CurrencyEntity> c1 = new List<CurrencyEntity>() { new CurrencyEntity() };
ObservableCollection<CurrencyEntity> ob = new ObservableCollection<CurrencyEntity>(c1.Where(c => c.IsSelected));
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I will try again and let you know. it's very strange..
|
|
|
|
|
Thanks. I think it doesn't work because of Silverlight. I'm using Prism v2 (with multi-targeting feature). so, i need to create the class in SL project and link that class from wpf. that's why the code doesn't work.
Thanks for your help.
|
|
|
|
|
Hi everyone,
I'm experiencing a strange exception in the List<T>.AddRange[^] method.
Sometimes (maybe in 1 out of 100 runs with the same data) I get a System.ArgumentException inside AddRange that the destination array is not large enough for the collection. Here's what I'm doing:
if (itemsToAdd > 0)
{
existingItems.AddRange(itemsToAdd);
itemsToAdd.Clear();
}
Now MSDN clearly states:
If the new Count (the current Count plus the size of the collection) will be greater than Capacity, the capacity of the List<(Of <(T>)>) is increased by automatically reallocating the internal array to accommodate the new elements, and the existing elements are copied to the new array before the new elements are added.
Did anyone else experience this weird behaviour?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Sounds like it is a problem of the allocation of new memory to expand the collection is slower than expected by the framework. Have you tried to set the expected number of elements when you create the List? You may not have an exact number, but an large estimate should prevent this from occurring. The TrimExcess method can free up any extra resources after you've filled the List
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: Have you tried to set the expected number of elements when you create the List?
That's what I will actually try next. But since the error is quite hard to reproduce I'm not sure if this will help. I do have an estimated number how many items the list will contain, so I could set it. It's a very small number of items, so I don't think it's some sort of memory problem (but in this case I think OutOfMemoryException would be the proper one).
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I didn't say it was a memory problem per se. If the framework were trying to place a element into the collection before the memory allocation and redistribution had completed, then it would be an ArguementExcepetion, not an OutOfMemoryException.
only two letters away from being an asset
|
|
|
|
|
This sounds like a valid point. I just wonder if there's something I can do against it apart from setting the capacity myself - but it shouldn't be a real problem, so I think this is fine.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I can imagine two possible causes:
- existingItems or itemsToAdd is accessed from multiple threads and the item count changes during the insertion.
- itemsToAdd implements the ICollection<T> interface incorrectly. What type is itemsToAdd?
Given that you're getting the exception only in 1 of 100 cases, I'm pretty sure that it's the first case: either existingItems or itemsToAdd is accessed from multiple threads.
|
|
|
|