Search Results

Search found 5463 results on 219 pages for 'runtime'.

Page 20/219 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Winform User Settings - Allow multiple choice values at Runtime

    - by Refracted Paladin
    I created a simple User Settings Dialog by binding the Property.Settings to a PropertyGrid. This works like a charm but now I would like to allow only certain choices for some values. I have noticed that some Types will give a dropdown of possible choices. This is what I am shooting for but for, say, Strings. Example, one of the Settings is UserTheme which is a String. Black, Blue, Silver. The program reads that string from the Settings File and sets the Theme on Startup. I can type in a correct theme and it works but if I type in Pink it will not as there is not a pink option. This is my VERY simple UserSettingsForm code. #region FIELDS internal Settings userSettings; #endregion #region EVENTS private void frmEditUserControl_Load(object sender, EventArgs e) { userSettings = Settings.Default; this.propertyGrid1.SelectedObject = userSettings; this.propertyGrid1.PropertySort = PropertySort.Alphabetical; } private void btnSave_Click(object sender, EventArgs e) { userSettings.Save(); //this.DialogResult = DialogResult.OK; this.Close(); } private void btnCancel_Click(object sender, EventArgs e) { userSettings.Reload(); this.Close(); } #endregion

    Read the article

  • StackPanel location changes at runtime

    - by Vinjamuri
    I have a ToolBar WPF control which has a Stackpanel docked to right. I use this toolbar control in 3 other WPF controls by adding in the XAML. When I verify in the XAML the Stackpanel location is same for all 3 controls. But when I run my application, for one of the 3 controls, the StackPanel in the ToolBar control shifts to left. <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" Name="stackButtons" > Any idea? Appreciate your help..

    Read the article

  • iPhone App runtime error- "Error: Embedded profile header length is greater than data length.\n"

    - by Rob Lourens
    This error Thu Apr 8 20:24:15 iPod-touch appname[947] <Error>: Error: Embedded profile header length is greater than data length.\n Thu Apr 8 20:24:16 iPod-touch appname[947] <Error>: Error: Embedded profile header length is greater than data length.\n is logged when a UIImageView is loaded. The view isn't huge but it has a few other UIImageViews as subviews and it might be related to memory, but I can't find anything on this message. Any ideas?

    Read the article

  • Java Runtime Exception

    - by ikurtz
    when i run my application i get the following error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.text.FlowView$FlowStrategy.layoutRow(FlowView.java:546) at javax.swing.text.FlowView$FlowStrategy.layout(FlowView.java:460) at javax.swing.text.FlowView.layout(FlowView.java:184) at javax.swing.text.BoxView.setSize(BoxView.java:380) at javax.swing.text.BoxView.updateChildSizes(BoxView.java:349) at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:331) at javax.swing.text.BoxView.layout(BoxView.java:691) at javax.swing.text.BoxView.setSize(BoxView.java:380) at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1702) at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:1034) at javax.swing.text.DefaultCaret.repaintNewCaret(DefaultCaret.java:1291) at javax.swing.text.DefaultCaret$1.run(DefaultCaret.java:1270) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) as the error does not mention any of my classes, how would i go about in finding what is causing this? if i try: public void notifyChatMessage(String message){...} the error goes away. but if i try: public void notifyChatMessage(Object message){...} the error is reported. please advise.

    Read the article

  • Onpaint events (invalidated) changing execution order after a period normal operation (runtime)

    - by Luke Mcneice
    I have 3 data graphs that are painted via the their paint events. When I have data that I need to insert into the graph I call the controls invalidate() command. The first control's paint event actually creates a bitmap buffer for the other 2 graphs to avoid repeating a long loop. So the invalidate commands are in a specific order (1,2,3). This works well, however when the graphed data reaches the end of the graph window (PictureBox) where the data would normally start scrolling, the paint events begin firing in the wrong order (2,3,1). has anyone came across this before? why might this be happening?

    Read the article

  • Opening an SQL CE file at runtime with Entity Framework 4

    - by David Veeneman
    I am getting started with Entity Framework 4, and I an creating a demo app as a learning exercise. The app is a simple documentation builder, and it uses a SQL CE store. Each documentation project has its own SQL CE data file, and the user opens one of these files to work on a project. The EDM is very simple. A documentation project is comprised of a list of subjects, each of which has a title, a description, and zero or more notes. So, my entities are Subject, which contains Title and Text properties, and Note, which has Title and Text properties. There is a one-to-many association from Subject to Note. I am trying to figure out how to open an SQL CE data file. A data file must match the schema of the SQL CE database created by EF4's Create Database Wizard, and I will implement a New File use case elsewhere in the app to implement that requirement. Right now, I am just trying to get an existing data file open in the app. I have reproduced my existing 'Open File' code below. I have set it up as a static service class called File Services. The code isn't working quite yet, but there is enough to show what I am trying to do. I am trying to hold the ObjectContext open for entity object updates, disposing it when the file is closed. So, here is my question: Am I on the right track? What do I need to change to make this code work with EF4? Is there an example of how to do this properly? Thanks for your help. My existing code: public static class FileServices { #region Private Fields // Member variables private static EntityConnection m_EntityConnection; private static ObjectContext m_ObjectContext; #endregion #region Service Methods /// <summary> /// Opens an SQL CE database file. /// </summary> /// <param name="filePath">The path to the SQL CE file to open.</param> /// <param name="viewModel">The main window view model.</param> public static void OpenSqlCeFile(string filePath, MainWindowViewModel viewModel) { // Configure an SQL CE connection string var sqlCeConnectionString = string.Format("Data Source={0}", filePath); // Configure an EDM connection string var builder = new EntityConnectionStringBuilder(); builder.Metadata = "res://*/EF4Model.csdl|res://*/EF4Model.ssdl|res://*/EF4Model.msl"; builder.Provider = "System.Data.SqlServerCe"; builder.ProviderConnectionString = sqlCeConnectionString; var entityConnectionString = builder.ToString(); // Connect to the model m_EntityConnection = new EntityConnection(entityConnectionString); m_EntityConnection.Open(); // Create an object context m_ObjectContext = new Model1Container(); // Get all Subject data IQueryable<Subject> subjects = from s in Subjects orderby s.Title select s; // Set view model data property viewModel.Subjects = new ObservableCollection<Subject>(subjects); } /// <summary> /// Closes an SQL CE database file. /// </summary> public static void CloseSqlCeFile() { m_EntityConnection.Close(); m_ObjectContext.Dispose(); } #endregion }

    Read the article

  • jaxb unmarshaling with schema validation in runtime

    - by ekeren
    I am using jaxb for my application configurations I feel like I am doing something really crooked and I am looking for a way to not need an actual file or this transaction. As you can see in code I: 1.create a schema into a file from my JaxbContext (from my class annotation actually) 2.set this schema file in order to allow true validation when I unmarshal Schema mySchema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(schemaFile); jaxbContext.generateSchema(new MySchemaOutputResolver()); // ultimately creates schemaFile Unmarshaller u = m_context.createUnmarshaller(); u.setSchema(mySchema); u.unmarshal(...); do any of you know how I can validate jaxb without needing to create a schema file that sits in my computer? Do I need to create a schema for validation, it looks redundant when I get it by JaxbContect.generateSchema ? How do you do this?

    Read the article

  • Opencv application crashes at runtime with error code 0x0000142

    - by Tuan Anh
    I have openCV and minGW installed with codeblock IDE following the instructions found here http://kevinhughes.ca/tutorials/opencv-install-on-windows-with-codeblocks-and-mingw/ i tried the simple image loading program in the article and the build process went fine. but when i tried running the output program, it crashes with the error message "the application was unable to start correctly (0xc0000142). Click OK to close the application." I used Dependency Walker to see if the program failed to load dll module and here's the output screen of Dependency Walker https://www.dropbox.com/s/f9iaftdt8atjwpl/Screenshot%202013-11-05%2022.21.45.png i am not used to DW but as i can see in its output screen, some openCV dll failed to load and the loaded Windows DLL were 64 bit instead of 32 bit (as minGW is 32 bit). I can't figure out why as i already configure the Path environment variable for the bin directory of openCV and the app still can not load the dll modules. And i think that Windows will automatically load the proper 32 bit DLLs when a 32 bit app is run but this situation the app still failed to load. Anyone has ideas?

    Read the article

  • how openjpa2.0 enhances entities at runtime?

    - by Digambar Daund
    Below is my test code: package jee.jpa2; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import javax.persistence.Query; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @Test public class Tester { EntityManager em; EntityTransaction tx; EntityManagerFactory emf; @BeforeClass public void setup() { emf = Persistence.createEntityManagerFactory("basicPU", System.getProperties()); } @Test public void insert() { Item item = new Item(); for (int i = 0; i < 1000; ++i) { em = emf.createEntityManager(); tx = em.getTransaction(); tx.begin(); item.setId(null); em.persist(item); tx.commit(); em.clear(); em.close(); tx=null; em=null; } } @Test public void read() { em = emf.createEntityManager(); tx = em.getTransaction(); tx.begin(); Query findAll = em.createNamedQuery("findAll"); List<Item> all = findAll.getResultList(); for (Item item : all) { System.out.println(item); } tx.commit(); } } And here is the entity: package jee.jpa2; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.NamedQuery; @Entity @NamedQuery(name="findAll", query="SELECT i FROM Item i") public class Item { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "ID", nullable = false, updatable= false) protected Long id; protected String name; public Item() { name = "Digambar"; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return String.format("Item [id=%s, name=%s]", id, name); } } After executing test I get Error: Item [id=1, name=Digambar] Item [id=2, name=Digambar] PASSED: read FAILED: insert <openjpa-2.0.0-r422266:935683 nonfatal store error> org.apache.openjpa.persistence.EntityExistsException: Attempt to persist detached object "jee.jpa2.Item-2". If this is a new instance, make sure any version and/or auto-generated primary key fields are null/default when persisting. FailedObject: jee.jpa2.Item-2 at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2563) at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2423) at org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1069) at org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:705) at jee.jpa2.Tester.insert(Tester.java:33) Please Explain whats happening here?

    Read the article

  • "Debug Assertion" Runtime Error on VS2008?

    - by Linda Cohen
    I' writing a C++ MFC program on VS2008 and I'm getting this "Debug Assertion Error" when I first run the program sometimes. When I try to debug it, it takes me to this winhand.cpp file which is not part of the program I wrote so I'm not sure how to debug this. It takes the error to this place in winhand.cpp CObject* pTemp = LookupTemporary(h); if (pTemp != NULL) { // temporary objects must have correct handle values HANDLE* ph = (HANDLE*)((BYTE*)pTemp + m_nOffset); // after CObject ASSERT(ph[0] == h || ph[0] == NULL); if (m_nHandles == 2) ASSERT(ph[1] == h); } So why does this error happen? Why does it only happen sometimes (50% of the time)? How would I debug this? I'll provide some code if is needed. THANKS!

    Read the article

  • Reloading a JTree during runtime

    - by Patrick Kiernan
    I create a JTree and model for it out in a class separate to the GUI class. The data for the JTree is extracted from a file. Now in the GUI class the user can add files from the file system to an AWT list. After the user clicks on a file in the list I want the JTree to update. The variable name for the JTree is schemaTree. I have the following code for the when an item in the list is selected: private void schemaListItemStateChanged(java.awt.event.ItemEvent evt) { int selection = schemaList.getSelectedIndex(); File selectedFile = schemas.get(selection); long fileSize = selectedFile.length(); fileInfoLabel.setText("Size: " + fileSize + " bytes"); schemaParser = new XSDParser(selectedFile.getAbsolutePath()); TreeModel model = schemaParser.generateTreeModel(); schemaTree.setModel(model); } I've updated the code to correspond to the accepted answer. The JTree now updates correctly based on which file I select in the list.

    Read the article

  • Proper usage (best practices) of Browsable attribute in .NET for runtime grid component behavior

    - by Dan
    I understand how Browsable attribute is supposed to work. It's supposed to hide a property from showing up in a PropertyGrid in design time. It also has another effect in that it will stop a Property from showing up in components such as Grids, or specifically Infragistics WinGrid. I am not sure if it has this behaviour on regular Windows Forms grids. This works, but it doesn't sound like Browsable is being use as intended when being used for 'Run time' displaying of a property on a grid component. Any literature from Microsoft on proper use. Even though it works, I don't want to use this attribute to hide columns on a grid bound to a business object if it's not indeed the correct usage of the attribute, but rather something some grid vendors decided to use to determine property visibility on their grids.

    Read the article

  • Flash ActionScript 3 runtime SecurityError

    - by dd
    I have swf that loads swf, which loads another swf(video player). Is there a trick in publish settings? everything works fine on my local machine, when I upload it on the sever error happen and video doesnt load SecurityError: Error #2148: SWF file http:// (URL where Site is hosted)/video.swf cannot access local resource file:///Macintosh%20HD/Users/..flash.flv. Only local-with-filesystem and trusted local SWF files may access local resources. at flash.net::NetStream/play() at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::_play() at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::_setUpStream() at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::_load() at fl.video::VideoPlayer/load() at fl.video::FLVPlayback/doContentPathConnect()

    Read the article

  • Silverlight - Image Not Loading from URI at Runtime!?

    - by Sootah
    I've added an image element to my Silverlight app, and while the image pulls right up when in design mode, it doesn't load at all when running the app. Code is: <Image Height="95" HorizontalAlignment="Left" Margin="12,541,0,0" Name="imgBannerAd" Stretch="Fill" VerticalAlignment="Top" Width="828" Source="http://myurl.com/images/theimage.png" /> What's the deal? I'd tried running the file via the local hard drive and localhost, neither has any effect.

    Read the article

  • Developing my own package manager: how do I resolve dependencies?

    - by shantanu
    According to debian control file ant package's dependency list is: Depends: default-jre-headless | java2-runtime-headless | java5-runtime-headless | java6-runtime-headless, libxerces2-java That means it depends on default-jre-headless or java2-runtime-headless or java5-runtime-headless or java6-runtime-headless. But how could i determine that which package need to select as dependency? Note: I am trying to develop a package manager. I can not use provided package because they read sources.list file from a specific directory.

    Read the article

  • Getting Line Numbers for Errors Thrown in SQL Server CLR Runtime

    - by fetucine53
    Hi all, I've created a CLR stored procedure that I'm running on SQL 2k5 and I'm wondering if there's any way to get line numbers for exceptions thrown by the .NET code. When an Exception is thrown, I get something along the lines of Msg 6522, Level 16, State 1, Procedure myProcedure, Line 0 A .NET Framework error occurred during execution of user-defined routine or aggregate "myProcedure": System.Exception: testing exception System.Exception: at DummyDLL.myProcedure (String dummyInput) . Is there some way I can load the assembly to give me specific line numbers rather than just the function in which the error was thrown? The assembly itself was compiled with a .pdb, but SQL 2k5 doesn't appear to be reading it in when I load the assembly initially. Thanks!

    Read the article

  • How to change current Theme at runtime in Android

    - by Guido
    I've created a PreferenceActivity that allows the user to choose the theme he wants to apply to the entire application. When the users selects a theme, this code is executed: if (...) { getApplication().setTheme(R.style.BlackTheme); } else { getApplication().setTheme(R.style.LightTheme); } But, despite I've checked with the debugger that the code is being executed, I can't see any change in the user interface. Themes are defined in res/values/styles.xml, and Eclipse does not show any error. <resources> <style name="LightTheme" parent="@android:style/Theme.Light"> </style> <style name="BlackTheme" parent="@android:style/Theme.Black"> </style> </resources> Any idea about what could be happening and how to fix it? Thank you.

    Read the article

  • How to access a method on a generic datacontext which is only created at runtime

    - by Jeremy Holt
    I'm creating my generic DataContext using only the connectionString in the ctor. I have no issues in retrieving the table using DataContext.GetTable(). However, I need to also be able to retrieve entities of inline table functions. The dbml designer generates public IQueryable<testFunctionResult> testFunction() { return this.CreateMethodCallQuery<testFunctionResult>(this, ((MethodInfo)(MethodInfo.GetCurrentMethod()))); } The question is how do I get the MethodInfo.GetCurrentMethod() when the DataContext has no method called "testFunction", i.e.typeof(DataContext).GetMethod("testFunction") returns null? What I'm trying to achieve is something like: public class UnitofWork<T> { public UnitofWork(string connectionString) { this.DataContext = new DataContext(connectionString); } public UnitofWork(IQueryable<T> tableEntity) { _tableEntity = tableEntity; } public IQueryable<T> TableEntity { get { if (DataContext == null) return _tableEntity; var metaType = DataContext.Mapping.GetMetaType(typeof (T)); if (metaType.IsEntity) _tableEntity = DataContext.GetTable<T>(); else { var s = typeof(T).Name; string methodName = s.Substring(0, s.IndexOf("Result")) + "()"; // the designer automatically affixes "Result" to the type name // Make a method from methodName // _tableEntity = DataContext.CreateMethodCallQuery(DataContext, method, new object[]{}); } return _tableEntity; } set { _tableEntity = value; } } ) Thanks in advance for any insight Jeremy

    Read the article

  • Setting WCF Endpoint address at runtime?

    - by james.ingham
    Hey, If I have the following: WSHttpBinding binding = new WSHttpBinding(); EndpointAddress endpoint = new EndpointAddress(new Uri("http://xxx:pppp/MyService")); MyServiceClient client = new MyServiceClient(binding, endpoint); How can I set the endpoint bindingConfiguration? If it helps my app.config is set to: <endpoint address="http://xxx:pppp/Design_Time_Addresses/WcfServiceLibrary/ManagementService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IManagementService" contract="ServiceReference.IManagementService"> <identity> <dns value="localhost" /> </identity> </endpoint> However I'm looking to let the user configure this before running the client. Thanks

    Read the article

  • [C#] Onpaint events (invalidated) changing execution order after a period normal operation (runtime)

    - by Luke Mcneice
    Hi all, I have 3 data graphs that are painted via the their paint events. When I have data that I need to insert into the graph I call the controls invalidate() command. The first control's paint event actually creates a bitmap buffer for the other 2 graphs to avoid repeating a long loop. So the invalidate commands are in a specific order (1,2,3). This works well, however when the graphed data reaches the end of the graph window (PictureBox) where the data would normally start scrolling, the paint events begin firing in the wrong order (2,3,1). has anyone came across this before? why might this be happening?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >