Search Results

Search found 15081 results on 604 pages for 'passing by reference'.

Page 56/604 | < Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >

  • WPF Prism MVVM, Internationalized Wizard Passing model data between the wizard steps

    - by Nick V
    I've found the following example of a wizard located here: http://www.codeproject.com/Articles/31837/Creating-an-Internationalized-Wizard-in-WPF Now I've spent quite some time looking at the example and i understand pretty much everything. But i can't figure out how he passes an object between the different modelViews. And as you can imagine that step is quite crucial.. In the example he uses an CupOfCoffee Object in the main wizardviewmodel and somehow manages to adjust it throughout the wizard. But i cant see anywhere how he does that. I've already tried to recreate a project like he has but no success. Could anyone tell me how he passes the objects between the different viewModels?

    Read the article

  • Passing data to Winforms UI using BeginInvoke

    - by Bi
    I am a C# newbie and have a class that needs to pass row information to a grid in the windows form. What is the best way to do it? I have put in some example code for better understanding. public class GUIController { private My_Main myWindow; public GUIController( My_Main window ) { myWindow = window; } public void UpdateProducts( List<myProduct> newList ) { object[] row = new object[3]; foreach (myProduct product in newList) { row[0] = product.Name; row[1] = product.Status; row[2] = product.Day; //HOW DO I USE BeginInvoke HERE? } } } And the form class below: public class My_Main : Form { //HOW DO I GO ABOUT USING THIS DELEGATE? public delegate void ProductDelegate( string[] row ); public static My_Main theWindow = null; static void Main( ) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); theWindow = new My_Main(); Application.Run(theWindow); } private void My_Main_Load( object sender, EventArgs e ) { /// Create GUIController and pass the window object gui = new GUIController( this ); } public void PopulateGrid( string[] row ) { ProductsGrid.Rows.Add(row); ProductsGrid.Update(); } }

    Read the article

  • Nested Forms not passing belongs_to :id

    - by Bill Christian
    I have the following model class Project < ActiveRecord::Base has_many :assignments, :conditions => {:deleted_at => nil} has_many :members, :conditions => {:deleted_at => nil} accepts_nested_attributes_for :members, :allow_destroy => true end class Member < ActiveRecord::Base belongs_to :project belongs_to :person belongs_to :role has_many :assignments, :dependent => :destroy, :conditions => {:deleted_at => nil} accepts_nested_attributes_for :assignments, :allow_destroy => true validates_presence_of :role_id validates_presence_of :project_id end and I assume the controller will populate the member.project_id upon project.save for each nested member record. However, I get a validation error stating the project_id is blank. My controller method: def create # @project is created in before_filter if @project.save flash[:notice] = "Successfully created project." redirect_to @project else render :action => 'new' end end Do I need to manually set the project_id in each nested member record? Or what is necessary for the controller to populate when it creates the member records?

    Read the article

  • Passing parameters on the stack

    - by oxinabox.ucc.asn.au
    When you pass parameters to a function on the cpu stack, You put the parameters on then JSR puts the return address on the stack. So that means in your function you must take the top item of the stack (the return address) before you can take the others off) eg is the following the correct way to go about it: ... |Let’s do some addition with a function, MOVE.L #4, -(SP) MOVE.L #5, -(SP) JSR add |the result of the addition (4+5) is in D0 (9) ... add: MOVE.L (SP)+, A1 |store the return address |in a register MOVE.L (SP)+, D0 |get 1st parameter, put in D0 MOVE.L (SP)+, D2 |get 2nd parameter, put in D2 ADD.L D2, D0 |add them, |storing the result in D0 MOVE.L A1, -(SP) |put the address back on the |Stack RTS |return

    Read the article

  • Compiler optimization of reference variables

    - by Phineas
    I often use references to simplify the appearance of code: vec3f& vertex = _vertices[index]; // Calculate the vertex position vertex[0] = startx + col * colWidth; vertex[1] = starty + row * rowWidth; vertex[2] = 0.0f; Will compilers recognize and optimize this so it is essentially the following? _vertices[index][0] = startx + col * colWidth; _vertices[index][1] = starty + row * rowWidth; _vertices[index][2] = 0.0f;

    Read the article

  • Passing existing cookie to Web service

    - by danny.lesnik
    HI have the following scenario: 1) i'm authenticated against some aSP.NET web site and my session time out expires in 24 hours. 2) after several time I would like to run query against asp.net Web Service located on the site using existing authentication. What should I add to cookie Container? I how do sent existing cookie to Web service? Thank you in Advance. Danny.

    Read the article

  • Passing object(s) to a Controller Action

    - by Nicholas H
    I'm attempting to use jQuery to do a $.post() to an MVC controller action. Here's the jQuery calls: var _authTicket = { username: 'testingu', password: 'testingp' }; function DoPost() { var inputObj = { authTicket: _authTicket, dateRange: 'ThisWeek' }; $.post('/MyController/MyAction', inputObj, PostResult); } function PostResult(data) { alert(JSON.stringify(data)); } Here's the controller action: <HttpPost()> _ Function MyAction(ByVal authTicket As AuthTicket, ByVal dateRange As String) As ActionResult Dim u = ValidateUser(authTicket) If u Is Nothing Then Throw New Exception("User not valid") ' etc.. End Function The problem is, MyAction's "authTicket" parameter is all empty. The second "dateRange" parameter gets populated just fine. I'm pretty sure that the issue stems from jQuery turning the data into key/value pairs to POST to the action. MVC must not understand the format, at least when it's an object with it's own properties. The name/value pair format that jQuery is converting to is like: authTicket[username] = "testingu" authTicket[password] = "testingp" Which in turn gets made into x-www-form-urlencoded'd data: authTicket%5Busername%5D=testingu &authTicket%5Bpassword%5D=testingp I guess I could always have "username" and "password" properties in my actions, but that seems wrong to me. Any help would be appreciated.

    Read the article

  • Inconsistency in passing objects from VBA to .NET via COM

    - by Akash
    I have the following interface defined to expose a .NET class to COM: [InterfaceType(ComInterfaceType.InterfaceIsDual)] [Guid("6A983BCC-5C83-4b30-8400-690763939659")] [ComVisible(true)] public interface IComClass { object Value { get; set; } object GetValue(); void SetValue(object value); } The implementation of this interface is trivial: [ClassInterface(ClassInterfaceType.None)] [Guid("66D0490F-718A-4722-8425-606A6C999B82")] [ComVisible(true)] public class ComClass : IComClass { private object _value = 123.456; public object Value { get { return this._value; } set { this._value = value; } } public object GetValue() { return this._value; } public void SetValue(object value) { this._value = value; } } I have then registered this using RegAsm, and tried to call it from Excel via the following code: Public Sub ComInterop() Dim cc As ComClass Set cc = New ComClass cc.SetValue (555.555) valueByGetter = cc.GetValue valueByProperty = cc.Value cc.Value = 555.555 End Sub When I step throught this code, valueByGetter = 555.5555 and valueByProperty = 555.555 as expected. However, I get an "Object required" runtime error on the final line. Why does setting the value via the setter method work but setting via the property fail? What do I have to change to get the property to work as expected?

    Read the article

  • Passing Control's Value to Modal Popup

    - by Sherwin Valdez
    Hello, Just would like know how to pass textbox value to a modal popup after clicking a button using ModalPopUpExtender in ASP.NET, I've tried these codes but seems that I have no luck :( <script runat="server"> protected void Page_Load(object sender, EventArgs e) { Button1.Attributes.Add("onclick", "showModalPopup(); return false;"); } </script> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Button" OnClick='showModalPopup(); return false;' /> <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1" PopupControlID="Panel1" CancelControlID="btnCancel" OkControlID="btnOkay" BackgroundCssClass="ModalPopupBG"> </cc1:ModalPopupExtender> <asp:Panel ID="Panel1" Style="display: none" runat="server"> <div class="HellowWorldPopup"> <div class="PopupHeader" id="PopupHeader"> Header</div> <div class="PopupBody"> <asp:Label ID="Label1" runat="server"></asp:Label> </div> <div class="Controls"> <input id="btnOkay" type="button" value="Done" /> <input id="btnCancel" type="button" value="Cancel" /> </div> </div> </asp:Panel> javascript function showModalPopup() { //show the ModalPopupExtender var value; value = document.getElementById("TextBox1").value; $get("<%=Label1.ClientID %>").value = value; $find("<%=ModalPopupExtender1.ClientID %>").show(); } I wonder what I miss out :(, Thanks and I hope someone could help me :)

    Read the article

  • Passing local variables to Erlydtl block

    - by Justin
    Hi, I've got a block of erlydtl code which I use repeatedly and would like to abstract to some kind of block / partial template. The issue is that I need to pass the block a local variable. This is possible with Rails partial templates; it looks like it's possible with Django's blocks [albeit with some kind of Python hackery]; I'm wondering if it's possible with Erlydtl [Erlang implementation of Django templates] Ideas ? Thanks you.

    Read the article

  • When is a subroutine reference in @INC called?

    - by gvkv
    As the title says, I'm not clear on when such a subroutine will be called. From the require page at perldoc one can write: push @INC, \&my_sub; sub my_sub { my ($coderef, $filename) = @_; # $coderef is \&my_sub ... } but where does this go exactly? The required package or the requiring script (or package)? I've tried both with some sentinel print statements but neither worked so clearly there is something I'm not getting.

    Read the article

  • o3d javascript uncaught reference error

    - by David Menard
    hey, im new to javascript and am intersted in creating a small o3d script: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Test Game Website</title> </head> <body> <script type="text/javascript" src="o3djs/base.js"></script> <script type = "text/javascript" id="myscript"> o3djs.require('o3djs.camera'); window.onload = init; function init(){ document.write("jkjewfjnwle"); } </script> <div align="background"> <div id="game_container" style="margin: 0px auto; clear: both; background-image: url('./tmp.png'); width: 800px; height:600px; padding: 0px; background-repeat: no-repeat; padding-top: 1px;"></div> </div> </body> </html> the browser cant seem to find o3djs/base.js in this line <script type="text/javascript" src="o3djs/base.js"></script> and gives me an uncaught referenceerror at this line o3djs.require('o3djs.camera'); Obviously, because it can't find the o3djs/base.js... I have installed the o3d pluggin from google and they say that should be IT ive tried on firefox, ie and chrome thanks

    Read the article

  • Passing parameters to a flash movie inserted in a VB program

    - by Michael
    Hi! I need to insert a Flash movie in a Visual Basic 2008 express form and send parameters to the movie, but am a newbie to VB. The flash movie will plot points sent by VB in a graph. I tried to insert the Shockwave Flash control in the form but cannot find it anywhere. So I inserted the webbrowser control, which I understand can be used to a similar purpose. But how would I send the values of X and Y (coordinates to plot in Flash) to the flash swf? Thanks for any help!

    Read the article

  • Passing multiple codeblocks as arguments

    - by doctororange
    I have a method which takes a code block. def opportunity @opportunities += 1 if yield @performances +=1 end end and I call it like this: opportunity { @some_array.empty? } But how do I pass it more than one code block so that I could use yield twice, something like this: def opportunity if yield_1 @opportunities += 1 end if yield_2 @performances +=1 end end and: opportunity {@some_other_array.empty?} { @some_array.empty? } I am aware that this example could be done without yield, but it's just to illustrate. Thanks.

    Read the article

  • Core Data passing context between methods on secondary threads

    - by JK
    My app spawns a secondary thread for some core data store maintenance. In the secondary thread, I set up a context which I then pass to other methods e.g. [self editEntriesInContext:context]. However, this causes objects fetched from the context to become invalidated in editEntries... Why does this occur? I thought the only requirements were for the secondary thread to have its own context and managed objects, which I adhere to. (Note: The context is properly retained)

    Read the article

  • .NET 4.0 project reference 2.0 assembly

    - by jamone
    I have a project in which I'd like to use some of the .NET 4.0 features but a core requirement is that I can use the System.Data.SQLite framework which is compiled against 2.X. I see mention of this being possible such as the accepted answer here but I don't see how to actually achieve this. When I just try and run my 4.0 project while referencing the 2.X assembly I get: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. What "additional configuration" is necessary?

    Read the article

  • how to reference drageventArgs in xaml as command parameter with silverlight

    - by Shaggy
    Hi, on my silverlight 4 app I am trying to link up the drop event on a list box to my viewmodel. I am using expression blend 4's event trigger and invokecommandaction to hook up the drop event. Setting break points on my viewmodel, I can see the relevant function is fired when I drag a file onto the list box, however I cant seem to get access to the drageventArgs. I tried sending the entire listbox as a command parameter, and that doesn't work. Any ideas? Thanks

    Read the article

  • Passing sql results to views hard-codes views to database column names

    - by Galen
    I just realized that i may not be following best practices in regards to the MVC pattern. My issue is that my views "know" information about my database Here's my situation in psuedo code... My controller invokes a method from my model and passes it directly to the view view.records = tableGateway.getRecords() view.display() in my view each records as record print record.name print record.address ... In my view i have record.name and record.address, info that's hard-coded to my database. Is this bad? What other ways around it are there other than iterating over everything in the controller and basically rewriting the records collection. And that just seems silly. Thanks

    Read the article

  • Handy F# snippets

    - by Benjol
    There are already two questions about F#/functional snippets. However what I'm looking for here are useful snippets, little 'helper' functions that are reusable. Or obscure but nifty patterns that you can never quite remember. Something like: open System.IO let rec visitor dir filter= seq { yield! Directory.GetFiles(dir, filter) for subdir in Directory.GetDirectories(dir) do yield! visitor subdir filter} I'd like to make this a kind of handy reference page. As such there will be no right answer, but hopefully lots of good ones.

    Read the article

  • Passing a string from C# to cpp with COM

    - by Yaron Naveh
    I have a C# COM server which is consumed by a cpp client. One of the C# methods returns a string. In cpp the returned string is represented in Unicode (UTF-16), at least according to the memory view. Is this always the case with COM strings? Is there a way to use UTF-8 instead? I saw some code where strings were passed between cpp and c# as byte arrays. Is there any benefit in this?

    Read the article

  • Parameter passing become pointer for integer

    - by Kangkan
    I am working on a c/Linux app for a device. I consume a web service (in WCF/c#) and use gSOAP for the same. The issue is that the parameters in the service methods become pointers for simple data types like int, short etc also. I initially used the same service exposed as ASMX web service and the client proxy generated using gSOAP created methods with parameters passed as values. But once the service has been upgraded to WCF, all the parameters became pointers. Can somebody help?

    Read the article

  • passing user from UITableView to UIWebView based on selection

    - by ct2k7
    Hello, I'm trying to pass the user on to the interface based on their cell selection in the UITableView, ie, if the user selects cell 1, they are taken to view model 2, containing UIWebView. UIWebView then displays local file, cell1.html. Currently, I've manage to get placeholder using: selectedCellText.text = selectedCell; to display the name of the cell selected. How do I get it to directly pass to the UIWebView, stick UIWebView in the interface and link it using: UIWebView *myWebView = [[UIWebView alloc] initWithFrame:frame]; NSBundle *mainBundle = [NSBundle mainBundle]; NSString *stringUrl = [mainBundle pathForResource:@"selectedCell" ofType:@"html"]; NSURL *baseUrl = [NSURL fileURLWithPath:stringUrl]; NSURLRequest *urlRequest = [NSURLRequest requestWithURL:baseUrl]; [myWebView loadRequest:urlRequest]; My other issue is that some of the cell names have spaces in them, and for simplicity, I'd like to ensure that there are no spaces (actually, will it even work with spaces in the name, I assume with %20 ? Thanks

    Read the article

  • Passing Custom event arguments to timer_TICK event

    - by Nimesh
    I have class //Create GroupFieldArgs as an EventArgs public class GroupFieldArgs : EventArgs { private string groupName = string.Empty; private int aggregateValue = 0; //Get the fieldName public string GroupName { set { groupName = value; } get { return groupName; } } //Get the aggregate value public int AggregateValue { set { aggregateValue = value; } get { return aggregateValue; } } } I have another class that creates a event handler public class Groupby { public event EventHandler eh; } Finally I have Timer on my form that has Timer_TICK event. I want to pass GroupFieldArgs in Timer_TICK event. What is the best way to do it?

    Read the article

< Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >