Search Results

Search found 6420 results on 257 pages for 'mathieu parent'.

Page 7/257 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Obtain reference to Parent object during instantiation

    - by GoldBishop
    I have a situation where a custom class is a property of another class. What i need to be able to do, if it is possible at all, is obtain a reverse to the "parent" class (ie the the class that holds the current class as a property). For Instance: Public Class Class1 ... public readonly property Prop11 as Class2 public property Prop12 as String ... End Class Public Class Class2 ... private _par as Class1 private _var21 as string ... Public Sub New(...) me._par = ???? ... End Sub public readonly property Prop21 as string Get return me._par.Prop12 & me._var21 End Get End Property ... End Class Ultimately, i am trying to access other properties within Class1 from Class2 as they do have substance for information from within Class2. There are several other classes within Class1 that provide descriptive information to other classes contained within it as properties but the information is not extensible to all of the classes through Inheritance, as Class1 is being used as a resource bin for the property classes and the application itself. Diagram, lazy design ;): Application <- Class1.Prop12 Application <- Class1.Prop11.Prop21 Question: Is it possible to get a recursion through this design setup?

    Read the article

  • Multithreading: Communication from Parent thread to child thread

    - by Dennis Nowland
    I have a List of threads normally 3 threads each of the threads reference a webbrowser control that communicates with the parent control to populate a datagridview. What I need to do is when the user clicks the button in a datagridviewButtonCell corresponding data will be sent back to the webbrowser control within the child thread that originally communicated with the main thread. but when I try to do this I receive the following error message 'COM object that has been separated from its underlying RCW cannot be used.' my problem is that I can not figure out how to reference the relevant webbrowser control. I would appreciate any help that anyone can give me. The language used is c# winforms .Net 4.0 targeted Code sample: The following code is executed when user click on the Start button in the main thread private void StartSubmit(object idx) { /* method used by the new thread to initialise a 'myBrowser' inherited from the webbrowser control each submitters object is an a custom Control called 'myBrowser' which holds detail about the function of the object eg: */ //index: is an integer value which represents the threads id int index = (int)idx; //submitters[index] is an instance of the 'myBrowser' control submitters[index] = new myBrowser(); //threads integer id submitters[index]._ThreadNum = index; // naming convention used 'browser' +the thread index submitters[index].Name = "browser" + index; //set list in 'myBrowser' class to hold a copy of the list found in the main thread submitters[index]._dirs = dirLists[index]; // suppress and javascript errors the may occur in the 'myBrowser' control submitters[index].ScriptErrorsSuppressed = true; //execute eventHandler submitters[index].DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(DocumentCompleted); //advance to the next un-opened address in datagridview the navigate the that address //in the 'myBrowser' control. SetNextDir(submitters[index]); } private void btnStart_Click(object sender, EventArgs e) { // used to fill list<string> for use in each thread. fillDirs(); //connections is the list<Thread> holding the thread that have been opened //1 to 10 maximum for (int n = 0; n < (connections.Length); n++) { //initialise new thread to the StartSubmit method passing parameters connections[n] = new Thread(new ParameterizedThreadStart(StartSubmit)); // naming convention used conn + the threadIndex ie: 'conn1' to 'conn10' connections[n].Name = "conn" + n.ToString(); // due to the webbrowser control needing to be ran in the single //apartment state connections[n].SetApartmentState(ApartmentState.STA); //start thread passing the threadIndex connections[n].Start(n); } } Once the 'myBrowser' control is fully loaded I am inserting form data into webforms found in webpages loaded via data enter into rows found in the datagridview. Once a user has entered the relevant details into the different areas in the row the can then clicking a DataGridViewButtonCell that has tha collects the data entered and then has to be send back to the corresponding 'myBrowser' object that is found on a child thread. Thank you

    Read the article

  • How to listen for AffectsParentArrange events when you're not the parent

    - by Jeff B
    There is an attribute "AffectsParentArrange" that implicitly invalidates the parent's layout - but I want to attach an event handler to the "event" triggered by that attribute. When a child property with the attribute changes, the parent's arrangement is invalidated. I have a custom control (which is not the immediate parent) that needs to receive an event. Does anyone know of an event that can be used here? Do I need to provide a custom parent that overrides a method and fires an event?

    Read the article

  • to set value parent page's frame from popup.

    - by cem
    I want to set label's value from popup.But label is in frame and I dont know how to achieve it from popup. From parent page,i get this label by following javascript function. But when I use this function in popup page, I cant find topframe.Do u have any solution about how to success it? if (window.parent.document.getElementById('lbl')) { window.parent.document.getElementById('lbl').innerText = sender.getSelectedItem().get_text(); } else { window.parent.frames['topFrame'].document.getElementById('lbl').innerText = sender.getSelectedItem().get_text(); }

    Read the article

  • pass data from popup to parent

    - by user522962
    I have a parent w/ a popup child. When parent loads, I have to call a function within the popup without showing the popup (thus, I load "pupLove" but don't include it in layout)....I then pass this data to the parent. When the user manually clicks another button to open the popup, the same function is called & data passed to the parent. However, I am not able to pass dg.length to the parent. I believe the root problem is that I am loading "pupLove" & thus the parents are getting confused.....I'm guessing if I get rid of "pupLove" I can pass the data correctly but will need to call the child's function at creationComplete of the parent....how do I do that? Here's my parent: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" backgroundColor="green" width="50%" height="100%" xmlns:local="*" > <fx:Script> <![CDATA[ import pup; import mx.managers.PopUpManager; public function showPup(evt:MouseEvent):void { var ttlWndw:pup = PopUpManager.createPopUp(this, pup, true) as pup; PopUpManager.centerPopUp(ttlWndw); } ]]> </fx:Script> <mx:VBox> <local:pup id="pupLove" visible="false" includeInLayout="false" /> <s:Button click="showPup(event);" label="launch Pup" /> <mx:Text id="Ptest" color="black" text="from Parent:{pupLove.dg.length}" /> </mx:VBox> </s:Application> And a popup child called 'pup.mxml': <?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"> <fx:Script> <![CDATA[ public function init():void{ // send php call } import mx.events.CloseEvent; import mx.managers.PopUpManager; private function removePup(evt:Event):void { PopUpManager.removePopUp(this); } ]]> </fx:Script> <fx:Declarations> <s:ArrayCollection id="dg"> </s:ArrayCollection> </fx:Declarations> <s:TitleWindow width="100%" height="100%" close="removePup(event)"> <mx:VBox> <mx:Text id="test" color="red" text="from Child:{dg.length}" /> <s:Button label="add Items" click="dg.addItem({id:'cat'})" /> </mx:VBox> </s:TitleWindow> </s:Group> UPDATE: I guess my question can be more easily stated as: "is there a way to call a child's function from the parent without actually loading the child?"

    Read the article

  • Partial overriding in Java (or dynamic overriding while overloading)

    - by Lie Ryan
    If I have a parent-child that defines some method .foo() like this: class Parent { public void foo(Parent arg) { System.out.println("foo in Function"); } } class Child extends Parent { public void foo(Child arg) { System.out.println("foo in ChildFunction"); } } When I called them like this: Child f = new Child(); Parent g = f; f.foo(new Parent()); f.foo(new Child()); g.foo(new Parent()); g.foo(new Child()); the output is: foo in Parent foo in Child foo in Parent foo in Parent But, I want this output: foo in Parent foo in Child foo in Parent foo in Child I have a Child class that extends Parent class. In the Child class, I want to "partially override" the Parent's foo(), that is, if the argument arg's type is Child then Child's foo() is called instead of Parent's foo(). That works Ok when I called f.foo(...) as a Child; but if I refer to it from its Parent alias like in g.foo(...) then the Parent's foo(..) get called irrespective of the type of arg. As I understand it, what I'm expecting doesn't happen because method overloading in Java is early binding (i.e. resolved statically at compile time) while method overriding is late binding (i.e. resolved dynamically at compile time) and since I defined a function with a technically different argument type, I'm technically overloading the Parent's class definition with a distinct definition, not overriding it. But what I want to do is conceptually "partially overriding" when .foo()'s argument is a subclass of the parent's foo()'s argument. I know I can define a bucket override foo(Parent arg) in Child that checks whether arg's actual type is Parent or Child and pass it properly, but if I have twenty Child, that would be lots of duplication of type-unsafe code. In my actual code, Parent is an abstract class named "Function" that simply throws NotImplementedException(). The children includes "Polynomial", "Logarithmic", etc and .foo() includes things like Child.add(Child), Child.intersectionsWith(Child), etc. Not all combination of Child.foo(OtherChild) are solvable and in fact not even all Child.foo(Child) is solvable. So I'm best left with defining everything undefined (i.e. throwing NotImplementedException) then defines only those that can be defined. So the question is: Is there any way to override only part the parent's foo()? Or is there a better way to do what I want to do?

    Read the article

  • WPF FrameworkElement Parent and Moving a UIElement

    - by Adam Driscoll
    I'm trying to move a control from one parent to another (if this will work I'm not quite sure). I can get a hold of the control that I want to move. Here is my code: public void MoveElement(UIElement uiElement) { var element = ((FrameworkElement)uiElement).Parent; //TODO:Remove from parent myControl.Children.Add(uiElement); } When I hit the last statment an ArgumentException is thrown stating "Specified Visual is already a child of another Visual or the root of a CompositionTarget." The strange thing is that Parent is returning null. How do locate the parent? Will this even work?

    Read the article

  • Squid parent cache for text/html only

    - by Salvador
    How do I configure the squid to only request text/html to the parent cache; right now I am using : cache_peer 127.0.0.1 parent 8080 0 no-query no-digest on the second hand I get a lot of direct request that do not use the parent proxy: some queries go like FIRST_UP_PARENT and some like DIRECT, how do I tell the squid to always use parent for text/html BTW .. is a transparent proxy I have tried : cache_peer 127.0.0.1 parent 8080 0 no-query no-digest acl elhtml req_mime_type -i ^text/html$ acl elhtml req_mime_type -i text/html cache_peer_access 127.0.0.1 allow elhtml cache_peer_access 127.0.0.1 deny all and it does not works Thanks in advance for the help.

    Read the article

  • Inherit a parent class docstring as __doc__ attribute

    - by Reinout van Rees
    There is a question about Inherit docstrings in Python class inheritance, but the answers there deal with method docstrings. My question is how to inherit a docstring of a parent class as the __doc__ attribute. The usecase is that Django rest framework generates nice documentation in the html version of your API based on your view classes' docstrings. But when inheriting a base class (with a docstring) in a class without a docstring, the API doesn't show the docstring. It might very well be that sphinx and other tools do the right thing and handle the docstring inheritance for me, but django rest framework looks at the (empty) .__doc__ attribute. class ParentWithDocstring(object): """Parent docstring""" pass class SubClassWithoutDoctring(ParentWithDocstring): pass parent = ParentWithDocstring() print parent.__doc__ # Prints "Parent docstring". subclass = SubClassWithoutDoctring() print subclass.__doc__ # Prints "None" I've tried something like super(SubClassWithoutDocstring, self).__doc__, but that also only got me a None.

    Read the article

  • Autoscroll on parent panel, when there is overflow on child panels.Extjs

    - by Ashwin
    I'm having a single Parent Panel, which has 2 child panels. One has content dynamically created, while the other is fixed height and width. The Parent panel is using border layout, with center and east regions defined. I'm trying to get autoscroll to trigger on the parent panel when there is an overflow on on the center region panel. I've set the autoscroll option to true to the parent panel, but everytime there is an overflow on the center panel, it just gets cuts off. When I'm adding an overflow to center region panel, i get a scrollbar for that panel alone. I don't need that, but rather I want it on the entire Parent Panel. Let me know if anyone has any suggestions..

    Read the article

  • jquery jstree or dynatree parent node don't get selected

    - by mazhar
    I have used jquery jstree or dynatree using check boxes and found the same logic The thing is that the if for example there is a parent and 4 child. a) i select all the 4 child (parent get auto selected) the 4 child and the parent node id get posted to the controller. b) But if i select less then 4 children (parent get auto selected) only child node ids get posted to the controller. Is there any way even if i select less then 4 children all my selected nodes included the parent get posted to the controller?

    Read the article

  • Placement of a call to the parent method

    - by Alejandro
    I have a class that has a method. That class has a child class that overrides that method. The child's method has to call the parent's method. In all OO that I've seen or written calls to the parent's version of the same method were on the first line of the method. On a project that I am working on circumstances call for placing that method call at the end of a method. Should I be worried? Is that a code smell? Is this code inherently bad? class Parent { function work() { // stuff } } class Child { function work() { // do thing 1 // do thing 2 parent::work(); // is this a bad practice? // should I call the parent's work() method before // I do anything in this method? } }

    Read the article

  • NHibernate parent-childs save redundant sql update executed

    - by Broken Pipe
    I'm trying to save (insert) parent object with a collection of child objects, all objects are new. I prefer to manually specify what to save\update and when so I do not use any cascade saves in mappings and flush sessions by myself. So basically I save this object graph like: session.Save(Parent) foreach (var child in Parent.Childs) { session.Save(child); } session.Flush() I expect this code to insert Parent row, then each child row, however NHibernate executes this SQL: INSERT INTO PARENT.... INSERT INTO CHILD .... UPDATE CHILD SET ParentId=@1 WHERE Id=@2 This update statement is absolutely unnecessary, ParentId was already set correctly in INSERT. How do I get rid of it? Performance is very important for me.

    Read the article

  • jQuery click event on parent, but finding the child (clicked) element

    - by Mahdi
    let say I have a parent element which has so many nested child elements inside of itself: <div id="p"> <div id="c1"> <div id="c2"></div> <div id="c3"></div> </div id="c4"> <div id="c5"></div> </div> </div> I've already bind a click event on the parent: $('#p').bind('click', function() { alert($(this).attr('id')); }); Because the event is assigned to the parent element, I always see the parent id, however, I'm wondering if there is any possible way to find out which of this child elements has been clicked? I also can't assign any event to the child elements or remove the event listener from parent div.

    Read the article

  • Should the spacing between parent and child containers belong to parent or child?

    - by johntrepreneur
    I'm struggling to determine where in my CSS the padding/margins should go to keep seperation between parent and child containers. For example, if you have have a parent div with two nested children and you need to have even 10px spacing between the children and also have the children be spaced 10 px from the parent; then would you add padding to parent div {padding:10px} and then just add 10px of margin between the children? Or would you leave the parent at 0 padding and have the children define what seperation they need from each other and also their parents?

    Read the article

  • Attaching a function to the parent window from an iframe and getting proper scope

    - by Ronald
    I working on adding file uploading to my web application. I'm using an iframe to post my upload. When my php script processes the upload it writes some JavaScript to the iframe. This JavaScript is attempting to attach a function to the parent, this works, but when this function actually gets called it doesn't have the correct scope. Here is the code I'm attaching to the parent window: parent.window.showPreview = function(coords) { if (parseInt(coords.w) > 0) { var rx = 200 / coords.w; var ry = 250 / coords.h; $('#preview').css({ width: Math.round(rx * 400) + 'px', height: Math.round(ry * 533) + 'px', marginLeft: '-' + Math.round(rx * coords.x) + 'px', marginTop: '-' + Math.round(ry * coords.y) + 'px' }); } } When this function gets executed I get an error that says $ is not defined. I've tried adding changing the JQuery call to parent.$('#preview').css..., but then it says that parent is undefined. Any ideas?

    Read the article

  • Propagate properties to parent control C#

    - by Martin Ch
    Is there any way how to propagate properties from child control into parent - so I can access property like - Parent.Property1 instead of Parent.Child.Property1 ? I cant use inheritance - my parent cant be extended child type - its inherited from different class. Also I dont wanna add code for each property from child to parent like: public object Property1 { get{ return Child.Property1; } set{ ChildProperty1 = value; } } Maybe using reflection - something like this? public PropertyInfo[] Properties { get{ return Child.GetType().GetProperties(); } set{ Child.GetType().GetProperties().SetValue() = value.GetValue()} } Thanks

    Read the article

  • wget recursively with -np option still ascends to parent directory

    - by vectra
    tl;dr: will `wget --no-parrent -r ' download from a directory above the given url's directory? when using wget to download, say images, recursively from example.com/a/b with the -r and -np options, will a picture that is under example.com/a/c/ be downloaded when example.com/a/b/ delivers a html-file containing a link to the picture? if so, how do i get all pictures, that are in a folder and it's subfolders and only those? the description of the option --no-parent says "Do not ever ascend to the parent directory when retrieving recursively". anyway directory browsing delivers a link to the parent directory, which wget will follow, despite mentioned option. now what did i miss? edit: using GNU Wget 1.12

    Read the article

  • Maven - 'all' or 'parent' project for aggregation?

    - by disown
    For educational purposes I have set up a project layout like so (flat in order to suite eclipse better): -product | |-parent |-core |-opt |-all Parent contains an aggregate project with core, opt and all. Core implements the mandatory part of the application. Opt is an optional part. All is supposed to combine core with opt, and has these two modules listed as dependencies. I am now trying to make the following artifacts: product-core.jar product-core-src.jar product-core-with-dependencies.jar product-opt.jar product-opt-src.jar product-opt-with-dependencies.jar product-all.jar product-all-src.jar product-all-with-dependencies.jar Most of them are fairly straightforward to produce. I do have some problem with the aggregating artifacts though. I have managed to make the product-all-src.jar with a custom assembly descriptor in the 'all' module which downloads the sources for all non-transitive deps, and this works fine. This technique also allows me to make the product-all-with-dependencies.jar. I however recently found out that you can use the source:aggregate goal in the source plugin to aggregate sources of the entire aggregate project. This is also true for the javadoc plugin, which also aggregates through the usage of the parent project. So I am torn between my 'all' module approach and ditching the 'all' module and just use the 'parent' module for all aggregation. It feels unclean to have some aggregate artifacts produced in 'parent', and others produced in 'all'. Is there a way of making an 'product-all' jar in the parent project, or to aggregate javadoc in the 'all' project? Or should I just keep both? Thanks

    Read the article

  • std::bad_cast from parent to child?

    - by polyglot
    For simplicity, class Parent {} class Child1 : Parent {} class Child2 : Parent {} Elsewhere, I created instances of Child1 and Child2 and store it in same vector under Parent: // . . . in .h file, for example vector<Parent> vector_of_parent; // . . . in one particular method Child1 c1(); Child2 c2(); vector_of_parent.push_back(c1); vector_of_parent.push_back(c2); // . . . Then in another method which has access to vector_of_parent, I tried void doSomething(Parent& some_child) { // wrapped in a try block somehow... Child1& c = dynamic_cast<Child1&> some_child; // do something if the cast is successful } void otherMethod() { doSomething(vector_of_parent.at(0)); // vector_of_parent.at(0) is a Child1 } Why is there a std:bad_cast when I call otherMethod()?

    Read the article

  • Find ListBox from its child?

    - by Shimmy
    How do I extract the parent container of a ListBoxItem? In the following example I can go till the ListBoxItem, higher than that I get Nothing: <ListBox Name="lbAddress"> <ListBox.ItemTemplate> <DataTemplate> <Button Click="Button_Click"/> </DataTemplate> </ListBox.ItemTemplate> </ListBox> Private Sub Button_Click(sender As Button, e As RoutedEventArgs) Dim lbAddress = GetAncestor(Of ListBox) 'Result: Nothing End Sub Public Shared Function GetAncestor(Of T)(reference As DependencyObject) As T Dim parent = GetParent(reference) While parent IsNot Nothing AndAlso Not parent.GetType.Equals(GetType(T)) parent = GetVisualAncestor(Of T)(parent) End While If parent IsNot Nothing Then _ Return If(parent.GetType Is GetType(T), parent, Nothing) Return Nothing End Sub Public Function GetParent(reference As DependencyObject) As DependencyObject Dim parent As DependencyObject = Nothing If TypeOf reference Is FrameworkElement Then parent = DirectCast(reference, FrameworkElement).Parent ElseIf TypeOf reference Is FrameworkContentElement Then parent = DirectCast(reference, FrameworkContentElement).Parent End If Return If(parent, VisualTreeHelper.GetParent(reference)) End Function

    Read the article

  • How can I serialize the values of checked checkboxes in an iFrame into a hidden form field on clicki

    - by Frank Bailey
    I have an iFrame like so: <iframe width="100%" frameborder="0" height="470" allowtransparency="true" name="productframe" id="productframe" style="border-bottom:1px solid #eee"></iframe> The iframe contains several line items drawn from a sql server db, and I can check any of the checkboxes I want to perform a task with - in this case delete them. I have a button in the parent document that says "Delete selected", and I'd like to be able to click this button and populate a hidden field in my parent page with the values of the selected checkboxes in the child iframe. My checkboxes look like this: <input id="Checkbox1" type="checkbox" value="47" title="Select this row" name="selectItem"/> I have an instance of jquery on my parent page so I can make use of jquery selectors, I just have no clue as to the syntax needed to do this. Thanks in advance to anyone who can help me on this.

    Read the article

  • Qt - Calling widget parent's slots

    - by bullettime
    I wrote a small program to test accessing a widget parent's slot. Basically, it has two classes: Widget: namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: Widget(QWidget *parent = 0); ~Widget(); QLabel *newlabel; QString foo; public slots: void changeLabel(); private: Ui::Widget *ui; }; Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); customWidget *cwidget = new customWidget(); newlabel = new QLabel("text"); foo = "hello world"; this->ui->formLayout->addWidget(newlabel); this->ui->formLayout->addWidget(cwidget); connect(this->ui->pushButton,SIGNAL(clicked()),cwidget,SLOT(callParentSlot())); connect(this->ui->pb,SIGNAL(clicked()),this,SLOT(changeLabel())); } void Widget::changeLabel(){ newlabel->setText(this->foo); } and customWidget: class customWidget : public QWidget { Q_OBJECT public: customWidget(); QPushButton *customPB; public slots: void callParentSlot(); }; customWidget::customWidget() { customPB = new QPushButton("customPB"); QHBoxLayout *hboxl = new QHBoxLayout(); hboxl->addWidget(customPB); this->setLayout(hboxl); connect(this->customPB,SIGNAL(clicked()),this,SLOT(callParentSlot())); } void customWidget::callParentSlot(){ ((Widget*)this->parentWidget())->changeLabel(); } in the main function, I simply created an instance of Widget, and called show() on it. This Widget instance has a label, a QString, an instance of customWidget class, and two buttons (inside the ui class, pushButton and pb). One of the buttons calls a slot in its own class called changeLabel(), that, as the name suggests, changes the label to whatever is set in the QString contained in it. I made that just to check that changeLabel() worked. This button is working fine. The other button calls a slot in the customWidget instance, named callParentSlot(), that in turn tries to call the changeLabel() slot in its parent. Since in this case I know that its parent is in fact an instance of Widget, I cast the return value of parentWidget() to Widget*. This button crashes the program. I made a button within customWidget to try to call customWidget's parent slot as well, but it also crashes the program. I followed what was on this question. What am I missing?

    Read the article

  • Jamie Oliver&rsquo;s Food Revolution from a parent&rsquo;s perspective

    This is the first generation of kids expected to live a shorter life than you. Or...you guys can start kicking some ass. Jamie Oliver. Theres been a show running on ABC recentlyabout 6 episodes. Its called Jamie Olivers Food Revolution. It appears to have been taped during the fall of 2009 in Huntington, West Virginia (which evidently was selected because of high child obesity data). The show absolutely has a bit of Hollywood, a ton of editing, but I dont think anyone can doubt Jamies (and the...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >