Search Results

Search found 985 results on 40 pages for 'instantiate'.

Page 10/40 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • using securestring for a sql connection

    - by Rick
    Hi, I want to use a SecureString to hold a connection string for a database. But as soon as I set the SqlConnection object's ConnectionString property to the value of the securestring surely it will become visible to any other application that is able to read my application's memory? I have made the following assumptions: a) I am not able to instantiate a SqlConnection object outside of managed memory b) any string within managed memory can be read by an application such as Hawkeye

    Read the article

  • Toolbar items in sub-nib

    - by roe
    This question has probably been asked before, but my google-fu must be inferior to everybody else's, cause I can't figure this out. I'm playing around with the iPhone SDK, and I'm building a concept app I've been thinking about. If we have a look at the skeleton generated with a navigation based app, the MainWindow.xib contains a navigation controller, and within that a root-view controller (and a navigation bar and toolbar if you play around with it a little). The root-view controller has the RootViewController-nib associated with it, which loads the table-view. So far so good. To add content to the tool bar and to the navigation bar, I'm supposed to add those to in the hierarchy below the Root View Controller (which works, no problem). However, what I can't figure out is, this is all still within the MainWindow.xib (or, at runtime, nib). How would I define a xib in order for it to pick up tool bar items from that? I want to do (the equivalent of, just reusing the name here) RootViewController *controller = [[RootViewController alloc] initWithNibName:nil bundle:nil]; [self.navigationController pushViewController:controller animated:YES]; [controller release]; and have the navigation controller pick-up on the tool bar items defined in that nib. The logical place to put it would be in the hierarchy under File's Owner (which is of type RootViewController), but it doesn't appear to be possible. Currently, I'm assigning these (navigationItem and toolbarItems) manually in the viewDidLoad method, or define them in the MainWindow.xib directly to be loaded when the app initializes. Any ideas? Edit I guess I'll try to explain with a picture. This is the Interface Builder of the main window, pretty much as it comes out of the wizard to create a navigation based project. I've added a toolbar item for clarity though. You can see the navigation controller, with a toolbar and a navigation bar, and the root view controller. Basically, the Root View Controller has a bar button item and a navigation item as you can see. The thing is, it's also got a nib associated with it, which, when loaded will instantiate a view, and assign it to the view outlet of the controller (which in that nib is File's Owner, of type RootViewController, as should be). How can I get the toolbar item, and the navigation item, into the other nib, the RootViewController.nib so I can remove them here. The RootViewController.nib adds everything else to the Root View Controller, why not these items? The background for this is that I want to simply instantiate RootViewController, initialize it with its own nib (i.e. initWithNibName:nil shown above), and push it onto the navigation controller, without having to add the navigation/toolbar items in coding (as I do it now).

    Read the article

  • How do I access database from WF4?

    - by Patrol02
    Hi Guys, I host a wcf workflow service within my ASP.NET MVC2 application. I need to be able to load/save data inside my workflow (WF4). How it can be done? Should I just instantiate my Entity Framework context within my activities and read/write? Cheers.

    Read the article

  • PHP DOTNET - Passing Constructor Parameters to a C# Class

    - by n3wtz
    This seems like it should be a fairly straightforward question, but I can't find an answer anywhere. I'm using php's DOTNET class to instantiate a class from a .dll created with C#. The constructor of that class requires a couple of parameters. How to I pass them? Other Info: This is currently on Windows, and I've registered the .dll with the GAC, etc.

    Read the article

  • GWT: Best practice for unit testing / mocking JSNI methods?

    - by Epaga
    I have a class which uses JSNI to retrieve JSON data stored in the host page: protected native JsArray<JsonModel> getModels() /*-{ return $wnd.jsonData; }-*/; This method is called, and the data is then translated and process in a different method. How should I unit test this class, since I'm not able to instantiate (or seemingly mock?) JsArray? What is the best way to unit test JSNI methods at all?

    Read the article

  • Error Connecting to Third Party App via COM: mscorlib Exception from HRESULT: 0x80040202

    - by Dave
    One particular user is getting an exception when connecting an application I created to a third party app using COM. The connection fails with the following error: Source: mscorlib Message: Exception from HRESULT: 0x80040202 This software works fine for other users. Any ideas what could be going on? The error occurs just before the app adds some event handlers to some of the COM objects from the third party app. It is able to successfully instantiate the objects, though.

    Read the article

  • defining asmx webservice class objects as static

    - by Usama Khalil
    Hi, is it better to declare Webservice class object instances as static as the .asmx webservice classes have only static methods. what i want is that i declare and instantiate webservice asmx class as static in aspx Page Behind Class. and on every event call on that page i could perform operation against webservice methods. is it beneficial in terms of performance? Thanks Usama

    Read the article

  • Accessing the Private Constructor

    - by harigm
    I am java developer, went for an interview. I have been asked a question about the Private constructor 1) Can I access a Private Constructor of a Class and Instantiate the class. I was thinking and gave the answer directly--- "NO" But its wrong, can any one help Why NO? and How we can achieve this

    Read the article

  • Deploying XBAP as an ActiveX

    - by Kaveh Shahbazian
    How can I deploy a XBAP to a client machine as an ActiveX (Which I can instantiate and use from JavaScript, passing parameters to it, getting parameters from it, etc)? This is part of an ASP.NET site, and will be in full trusted mode (I have solved that part, actually I have implemented a test XBAP that can edit a text file on local hard drive of a client machine). Thanks

    Read the article

  • Why instantiation of static nested class object is allowed?

    - by Parag Meshram
    I have started learning Java language for Android Application developement. As per my understanding based on static class, we cannot instantiate object of static class. But why instantiation of static nested class object is allowed in following situaltion? class EnclosingClass { //... class static StaticInnerClass { //... } } Why we can create object of inner class if it is marked as static? EnclosingClass.StaticInnerClass s = new EnclosingClass.StaticInnerClass()

    Read the article

  • Log4Net in App object?

    - by David Veeneman
    I am getting started with Logging in a WPF desktop app, using Log4Net as the logging component. Here is my question: In a simple desktop app, is there any reason not to instantiate my logger as a property ov the App class (App.xaml.cs), like this? public partial class App : Application { private static readonly ILog p_Logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public ILog Logger { get { return p_Logger; } } #endregion } } That would allow me to invoke the logger

    Read the article

  • Spring.NET and ADO.NET Entity Data Model

    - by Jason
    Having defined an ADO.NET Entity Data Model, I can then instantiate it in a Repository class to query against the database. using (ApplicationEntities ctx = new ApplicationEntities()) { // query, CRUD, etc } However, that particular line of code becomes boilerplate in most of the methods in the repository class. Is it possible to just use Spring.NET to inject the Entity Data Model, either in the class or, even better, in an abstract parent class that all the repositories inherit from?

    Read the article

  • Selenium WebDriver Element

    - by cxyz
    How do i configure selenium WebDriver.I have automated test cases using Selenium.Now i need to automate upload and download of a file.So i have to automate using WebDriver.I had added webdriver-common-0.9.7376.jar.Now how do i instantiate for Internet Explorer? Am just decalring variable and using driver private static WebDriver driver; driver.findElement(By.id(upload)).sendKeys("file to be upload"); Is this correct?

    Read the article

  • Should an NSLock instance be "global"?

    - by Alex Reynolds
    Should I make a single NSLock instance in the application delegate, to be used by all classes? Or is it advisable to have each class instantiate its own NSLock instance as needed? Would the locking work in the second case, if I, for example, had access to a managed object context that is spread across two view controllers?

    Read the article

  • How to play the same Sound multiple times with overlap, using OpenAL or Finch?

    - by mystify
    Finch uses OpenAL. However, when I have an instance of Sound, and say -play, the sound plays. When I call -play multiple times one after another in a fast paced way, every -play makes the current sound playback of that sound stop and restart it. That's not what I want. Would I have to create multiple sources or buffers to get that working? Or would I just instantiate multiple Sounds with the same file?

    Read the article

  • Sproutcore SC.arrayProxy, where is in the docs?

    - by Bakaburg
    I'm reading the getting started guide of sproutcore, about the Todo app. Around the beginning they tell to instantiate a controller from the SC.arrayProxy class. But this class is not present in the docs!!! and even in google is nowhere to be found! where does it come out from?? EDIT: I discovered that SC.arrayProxy is only in sproutcore 2! I wonder what are the differences from SC.arrayController

    Read the article

  • Dependency Injection and Unit of Work pattern

    - by sunwukung
    I have a dilemma. I've used DI (read: factory) to provide core components for a homebrew ORM. The container provides database connections, DAO's,Mappers and their resultant Domain Objects on request. Here's a basic outline of the Mappers and Domain Object classes class Mapper{ public function __constructor($DAO){ $this->DAO = $DAO; } public function load($id){ if(isset(Monitor::members[$id]){ return Monitor::members[$id]; $values = $this->DAO->selectStmt($id); //field mapping process omitted for brevity $Object = new Object($values); return $Object; } } class User(){ public function setName($string){ $this->name = $string; //mark modified by means fair or foul } } The ORM also contains a class (Monitor) based on the Unit of Work pattern i.e. class Monitor(){ private static array modified; private static array dirty; public function markClean($class); public function markModified($class); } The ORM class itself simply co-ordinates resources extracted from the DI container. So, to instantiate a new User object: $Container = new DI_Container; $ORM = new ORM($Container); $User = $ORM->load('user',1); //at this point the container instantiates a mapper class //and passes a database connection to it via the constructor //the mapper then takes the second argument and loads the user with that id $User->setName('Rumpelstiltskin');//at this point, User must mark itself as "modified" My question is this. At the point when a user sets values on a Domain Object class, I need to mark the class as "dirty" in the Monitor class. I have one of three options as I can see it 1: Pass an instance of the Monitor class to the Domain Object. I noticed this gets marked as recursive in FirePHP - i.e. $this-Monitor-markModified($this) 2: Instantiate the Monitor directly in the Domain Object - does this break DI? 3: Make the Monitor methods static, and call them from inside the Domain Object - this breaks DI too doesn't it? What would be your recommended course of action (other than use an existing ORM, I'm doing this for fun...)

    Read the article

  • vsts load testing wcf app

    - by ashish.s
    I have a simple test written like this public class Test { [ThreadStatic] private static ServiceClient client; [TestMethod] public void TestCase1() { If( client == null) { .... //instantiate client } client.CallMyServiceMethod() } [TestMethod] public void TestCase2() { using(var newClient = new ServiceClient()) { newClient.CallMyServiceMethod() } } The percentage of new users is set to 100 % for the test, and the user load is constant load of 1. But the response time for TestCase1 is about 3 times better than TestCase2. Can someone see what i am missing here ? many thanks

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >