Search Results

Search found 312 results on 13 pages for 'invalidate'.

Page 1/13 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Blackberry invalidate field not causing a repaint

    - by Michaela
    I'm writing a Blackberry app. I have a custom list field where I can select an item in the list which pushes the edit screen onto the stack. I edit the item and save, and when I pop that screen off so I am back on my list screen, I want to view the update I just made reflected in the list. I have done this on other screens which just had LabelFields and it worked fine. However, with the list screen, calling invalidate() seems to do nothing. I know the value has saved correctly through print lines, and I see the paint() method in the listfield is getting called. But the only way I can get the list field to update is to delete it from the screen and re-add it. That seems wrong. What am I doing wrong? public class ListTasksScreen extends MainScreen{ private TaskList tasks; private CustomListField taskListField; public ListTasksScreen (TaskList tasks){ super(); this.tasks = tasks; Vector incompleteTasks = tasks.getIncompleteTasks(); taskListField = new CustomListField(incompleteTasks, tasks); add(taskListField); } public void updateTaskList(TaskList t) { Vector incompleteTasks = t.getIncompleteTasks(); taskListField= new TaskListField(incompletetTasks, t); //I just want to call taskListField.invalidate() here. //the only thing that seems to work is deleting taskListField //and re-adding this.delete(taskListField); add(taskListField); } }

    Read the article

  • How does ImageView just redraw part of its content when invalidate(Rect) is called?

    - by imax366
    Hi, guys I am new to Android development, just reading docs and trying the APIs. I am quit confused how ImageView managed to draw just a part of its content after an invalidate(Rect) invocation. I've checked ImageView.java, found no other drawing method except onDraw(Canvas), but onDraw(Canvas) only cut the drawable only if it is beyound the view's visible boundary. I also read the implementation of View.invalidate(Rect), I think the key of this function is calling to mParent.invalidateChild(this, r); However, I think the parent view doesn't know how to draw the child in the given Rect, it finally has to call some method of it child to paint out. Has anybody investigated this part of codes? Would you please give me some guide?

    Read the article

  • Android: How to invalidate multiple parts of screen

    - by user342731
    I need to be able to selectively invalidate multiple (about 20) rectangles on the screen for performance reasons, so tried the following: Vector<Rect> myRects = new Vector<Rect>(); // ... add some Rects to myRects for (Rect r : myRects) { invalidate(r); } However this seems to invalidates a union of all the Rect's, forming one large rectangle which covers all of small ones I'm trying to invalidate. How can one invalidate multiple areas on the screen, and only those areas?

    Read the article

  • varnish invalidate url REGEX from backend

    - by ooouuiii
    Say I have some highly-visited front-page, which displays number of some items by categories. When some item is added / deleted I need to invalidate this front-page/url and some 2 others. What is the best practice how to invalidate those urls from backend in Varnish (4.x)? From what I captured, I can: implement my HTTP PURGE handler in VCL configuration file, that "bans" urls matching received regex from backend to Varnish, send 3x HTTP PURGE requests for those 3 urls. But is this approach safe for this automatic usage? Basicly I need to invalidate some views everytime some related entity is inserted/updated/deleted. Can it lead to ban list cumulation and increasing CPU consumption? Is there any other approach? Thanks.

    Read the article

  • Winforms: How to speed up Invalidate()?

    - by Pedery
    I'm developing a retained mode drawing application in GDI+. The application can draw simple shapes to a canvas and perform basic editing. The math that does this is optimized to the last byte and is not an issue. I'm drawing on a panel that is using the built-in Controlstyles.DoubleBuffer. Now, my problem arises if I run my app maximized on a big monitor (HD in my case). If I try to draw a line from one corner of the (big) canvas to the diagonally oposite other, it will start to lag and the CPU goes high up. Each graphical object in my app has a boundingbox. Thus, when I invalidate the boundingbox of a line that goes from one corner of the maximized app to the oposite diagonal one, that boundingbox is virtually as big as the canvas. When a user is drawing a line, this invalidation of the boundingbox thus happens on the mousemove event, and there is a clear lag visible. This lag also exists if the line is the only object on the canvas. I've tried to optimize this in many ways. If I draw a shorter line, the CPU and the lag goes down. If I remove the Invalidate() and keep all other code, the app is quick. If I use a Region (that only spans the figure) to invalidate instead of the boundingbox, it is just as slow. If I split the boundingbox into a range of smaller boxes that lie back to back, thus reducing the invalidation area, no visible performance gain can be seen. Thus I'm at a loss here. How can I speed up the invalidation? On a side note, both Paint.Net and Mspaint suffers from the same shortcommings. Word and PowerPoint however, seem to be able to paint a line as described above with no lag and no CPU load at all. Thus it's possible to achieve the desired results, the question is how?

    Read the article

  • How to invalidate the OutputCache in a webfarm?

    - by Pure.Krome
    Hi folks, i've got a website that uses OutputCache attribute to cache pages. Works great. Now, I'm in the middle of R&D'ing scaling up this site to be in a web farm. Along with the usual suspects for webfarm pain ... I've noticed (pretty quickly/obviously) that the OutputCache from Server_A doesn't invalidate the OutputCache from Server_B .. if a try and invalidate a single server's OutputCache. This makes total sense - how can S_A 'tell' S_B to invalidate when they are physically 2 seperate machines, etc? So - what are our options? Velocity? I understand this will move the caching to a different layer .. which means that the final result (output) will always be required to be determined .. as opposed to the OutputCache whic remembers the final output content (yes, varby gives different versions, etc.. which is totally fine). So even though the poco or business objects are all sync'd, there's still that last rendering effort required (even if it's tiny .. compared to the effort to generate/sync business objects). So yeah .. not sure of the options here and what other people do?

    Read the article

  • (Android) Why won't invalidate() update my buttons immediately?

    - by frustrated user
    I have read several forums and examples on using invalidate() in order to update views immediately but I still do not understand why what I am doing will not work. The code below uses image buttons defined by "red", "blue", "green", and "yellow". I set a 1 second delay between each time I try and change a button's appearance. Please someone tell me what i'm doing wrong. private void showPattern() { if (correct == true) { for (int k = 0; k < temp_basket.length; k++) { if (temp_basket[k] == 0) { red.setPressed(true); red.invalidate(); final Handler handler = new Handler(); Timer t = new Timer(); t.schedule(new TimerTask() { public void run() { handler.post(new Runnable() { public void run() { red.setPressed(false); red.invalidate(); } }); } }, 1000); There are 3 more or these blocks after this one that are blue, green, and yellow.

    Read the article

  • Invalidate (MFC) debug assertion failed error message

    - by kobac
    I've made a custom control, and when I want it to repaint on the screen I call Invalidate(), and afterwards UpdateWindow(), but i get message: debug assertion failed for a file afxwin2.inl in line 150 which is: AFXWIN_INLINE void CWnd::Invalidate(BOOL bErase) { ASSERT(::IsWindow(m_hWnd)); ::InvalidateRect(m_hWnd, NULL, bErase); } The thing is that when I run the same app in release mode, it doesn't report any message! So this clue makes me think it's about some environment configuration I should change. What do you think? Thanks.

    Read the article

  • Neither Invalidate() nor Refresh() invokes OnPaint()

    - by user181813
    I'm trying to get from Line #1 to Line #2 in the below code: using System; using System.Windows.Forms; namespace MyNameSpace { internal class MyTextBox : System.Windows.Forms.TextBox { protected override void OnEnabledChanged(EventArgs e) { base.OnEnabledChanged(e); Invalidate(); // Line #1 - can get here Refresh(); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); System.Diagnostics.Debugger.Break(); // Line #2 - can't get here } } } However, it seems that neiter Invalidate() nor Refresh() causes OnPaint(PaintEventArgs e) to be invoked. Two questions: Why doesn't it work? If it can't be fixed: I only want to invoke OnPaint(PaintEventArgs e) in order to access the e.Graphics object - is there any other way to do this?

    Read the article

  • Form invalidate() in WinForms Application

    - by Pramodh
    i need to animate an object in c# windows application int l_nCircleXpos = 9, l_nCircleYpos = 0; private void Form1_Paint(object sender, PaintEventArgs e) { Graphics l_objGraphics = this.CreateGraphics(); Pen l_circlePen = new Pen(Color.Blue); SolidBrush l_circleBrush = new SolidBrush(Color.Blue); l_objGraphics.DrawEllipse(l_circlePen, l_nCircleXpos, l_nCircleYpos, 30, 30); l_objGraphics.FillEllipse(l_circleBrush, l_nCircleXpos, l_nCircleYpos, 30, 30); Pen l_rectPen = new Pen(Color.Red); } private void timer1_Tick(object sender, EventArgs e) { l_nCircleXpos++; l_nCircleYpos++; } private void timer2_Tick(object sender, EventArgs e) { Invalidate(); } but in timer2 its invalidating the entire form. i need to invalidate the specific circle area only. please help to do this in a better way

    Read the article

  • Form invalidate() in c sharp windows Application

    - by Pramodh
    hi, i need to animate an object in c sharp windows application int l_nCircleXpos = 9, l_nCircleYpos = 0; private void Form1_Paint(object sender, PaintEventArgs e) { Graphics l_objGraphics = this.CreateGraphics(); Pen l_circlePen = new Pen(Color.Blue); SolidBrush l_circleBrush = new SolidBrush(Color.Blue); l_objGraphics.DrawEllipse(l_circlePen, l_nCircleXpos, l_nCircleYpos, 30, 30); l_objGraphics.FillEllipse(l_circleBrush, l_nCircleXpos, l_nCircleYpos, 30, 30); Pen l_rectPen = new Pen(Color.Red); } private void timer1_Tick(object sender, EventArgs e) { l_nCircleXpos++; l_nCircleYpos++; } private void timer2_Tick(object sender, EventArgs e) { Invalidate(); } but in timer2 its invalidating the entire form. i need to invalidate the specific circle area only. please help to do this in a better way thanks in advance

    Read the article

  • Map refresh problem mapview.invalidate() method is not working

    - by RockOn
    Hi friends! In my application I tried to search diff map location using diff lat and long. First time the application show the map but wen i change the lat long and try to invalidate the mapview using diff lat long, map is not refreshed. Below is my code please have a look and suggest accordingly: //Source code protected void onCreate(Bundle icicle) { // TODO Auto-generated method stub super.onCreate(icicle); setContentView(R.layout.main); infoTextView = (TextView) findViewById(R.id.infoTextView); // Finding Current Location locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1l, 1l, this); Location location = locationManager.getLastKnownLocation("gps"); // mock location by hard-code if DDMS has not sent a fake loc to the emulator. if (location == null) { lat = 13.6972 * 1E6; lng = 100.5150 * 1E6; } else { // get real location if can retrieve the location sent by DDMS or GPS lat = location.getLatitude() * 1E6; lng = location.getLongitude() * 1E6; } setGPSLocation(lat, lng); } //This is the function which I am calling with different lat and long public void setGPSLocation(Double lati, Double longi) { lat = lati; lng = longi; System.out.println("Latitude :"+ lat +" Longitude :"+lng); // Prepare text being shown String tmpLoc = LOC_INFO_TEMPLATE; tmpLoc = tmpLoc.replace("lg", String.valueOf(lng)); tmpLoc = tmpLoc.replace("lt", String.valueOf(lat)); infoTextView.setText(tmpLoc); // Setup Zoom/Hide Buttons linearLayout = (LinearLayout) findViewById(R.id.zoomview); mapView = (MapView) findViewById(R.id.mapview); mapView.invalidate(); mapView.setBuiltInZoomControls(true); //new by me mapView.setSatellite(true); // Set satellite view mZoom = (ZoomControls) mapView.getZoomControls(); linearLayout.addView(mZoom); // Setup Marker mapOverlays = mapView.getOverlays(); drawable = this.getResources().getDrawable(R.drawable.marker); itemizedOverlay = new MyItemizedOverlay(drawable); GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue()); OverlayItem overlayitem = new OverlayItem(point, "", ""); itemizedOverlay.addOverlay(overlayitem); mapOverlays.add(itemizedOverlay); // Centralize Current Location myMapController = mapView.getController(); myMapController.setZoom(DEFAULT_ZOOM_NUM); centerlizeCurrentLocation(point); } Any suggest is truly appreciable.

    Read the article

  • How to invalidate / refresh a domain instance association?

    - by Kimble
    There is a bug in Grails preventing me from using removeFrom* when the node I'm trying to remove is extending the collection type. Removing the node directly from the association won't update the second level cache. A hasMany B Is there any way to manually invalidate or force a reload on an association cache? Invoking refresh() on the many side didn't do the trick.

    Read the article

  • Call panel.invalidate outside form class in C#

    - by Shaza
    Hey, I need to call "panel.invalidate" outside my form (WINform) class also I need to change some other controls as well, I read similar question here, and tried what they said, but it didn't work and I wasn't convinced at all. The answer I read was about exposing a public method like this: public void EnableButton(bool enable) { this.myButton.Enabled = enable; } Also I made a static instance in the other file static Form1 myForm = new Form1(); Any useful suggestions??

    Read the article

  • Does "Debug" invalidate ASP.Net MVC OutputCache?

    - by William Edmondson
    I have images stored in a database and am serving them from an MVC controller as "FileResult". If I run the MVC application from Visual Studio 2008 in debug mode and set a break point inside the controller method the debugger intercepts the call on every page refresh regardless of my "OutputCache" settings. Does the VS debugger invalidate the OutputCache or is there something else going on here? [OutputCache(Duration = 86400, VaryByParam = "id")] public FileResult Index(string id) { byte[] image; int imageId; int.TryParse(id, out imageId); using (var ctx = new EPEntities()) { var imageObj = (from images in ctx.Images where images.ID == imageId select images).FirstOrDefault(); image = imageObj.Image; } return new FileContentResult(image, "image/gif"); }

    Read the article

  • Servlet Session behavior and Session.invalidate

    - by EugeneP
    Suppose I have a web app with a servlet defined in web.xml. Then I deploy it on Tomcat. Then I open my browser and go to the link to this servlet, it is invoked. Then I close my browser window. How Session behaves ? How is it created, destroyed in this case? if this servlet is "detached" from all the web app, and gets parameters only using post & get, so it does not need Session at all, should one use Session.invalidate at the end of doGet(), doPost() ?

    Read the article

  • Android: How to get a custom view to redraw partially?

    - by Peterdk
    I have a custom view that fills my entire screen. (A piano keyboard) When a user touches the key, it would cause a invalidate() to be called and the whole keyboard gets redrawn to show the new state with a touched key. Currently the view is very simple, but I plan to add a bit more nice graphics. Since the whole keyboard is dynamically rendered this would make redrawing the entire keyboard more expensive. So I thought, let's look into partial redrawing. Now I call invalidate(Rect dirty) with the correct dirty region. I set my onDraw(Canvas canvas) method to only draw the keys in the dirty region if I do indeed want a partial redraw. This results in those keys being drawn, but the rest of the keyboard is totally black/not drawn at all. Am I wrong in expecting that calling invalidate(Rect dirty) would "cache" the current canvas, and only "allows" drawing in the dirty region? Is there any way I can achieve what I want? (A way to "cache" the canvas and only redraw the dirty area?"

    Read the article

  • How to invalidate cache when benchmarking?

    - by Michael Buen
    I have this code, that when swapping the order of UsingAs and UsingCast, their performance also swaps. using System; using System.Diagnostics; using System.Linq; using System.IO; class Test { const int Size = 30000000; static void Main() { object[] values = new MemoryStream[Size]; UsingAs(values); UsingCast(values); Console.ReadLine(); } static void UsingCast(object[] values) { Stopwatch sw = Stopwatch.StartNew(); int sum = 0; foreach (object o in values) { if (o is MemoryStream) { var m = (MemoryStream)o; sum += (int)m.Length; } } sw.Stop(); Console.WriteLine("Cast: {0} : {1}", sum, (long)sw.ElapsedMilliseconds); } static void UsingAs(object[] values) { Stopwatch sw = Stopwatch.StartNew(); int sum = 0; foreach (object o in values) { if (o is MemoryStream) { var m = o as MemoryStream; sum += (int)m.Length; } } sw.Stop(); Console.WriteLine("As: {0} : {1}", sum, (long)sw.ElapsedMilliseconds); } } Outputs: As: 0 : 322 Cast: 0 : 281 When doing this... UsingCast(values); UsingAs(values); ...Results to this: Cast: 0 : 322 As: 0 : 281 When doing just this... UsingAs(values); ...Results to this: As: 0 : 322 When doing just this: UsingCast(values); ...Results to this: Cast: 0 : 322 Aside from running them independently, how to invalidate the cache so the second code being benchmarked won't receive the cached memory of first code? Benchmarking aside, just loved the fact that modern processors do this caching magic :-)

    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

  • [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

  • Invalidating session before iPhone application quits

    - by tartox
    Hello I would like to tell the server to invalidate an ongoing session when the user quits the iPhone application. In the app delegate, I send a request to the server in the (void)applicationWillTerminate:(UIApplication *)application method. I am not waiting for a server answer, I just want to send the request and quit. However I cant see any packet leaving the application. The same code in another place works fine. Session has a limited duration anyway and the server will invalidate it after a while, but I would prefer to do it nicely when leaving application. Is it normal that no NSURLConnection can be established from the applicationWillTerminate method ? Thank you.

    Read the article

  • How to invalidate a single data item in the .net cache in VB

    - by Craig
    I have the following .NET VB code to set and read objects in cache on a per user basis (i.e. a bit like session) '' Public Shared Sub CacheSet(ByVal Key As String, ByVal Value As Object) Dim userID As String = HttpContext.Current.User.Identity.Name HttpContext.Current.Cache(Key & "_" & userID) = Value End Sub Public Shared Function CacheGet(ByVal Key As Object) Dim returnData As Object = Nothing Dim userID As String = HttpContext.Current.User.Identity.Name returnData = HttpContext.Current.Cache(Key & "_" & userID) Return returnData End Function I use these functions to hold user data that I don't want to access the DB for all the time. However, when the data is updated, I want the cached item to be removed so it get created again. How do I make an Item I set disappear or set it to NOTHING or NULL? Craig

    Read the article

  • Implementing Custom CacheDependency to invalidate ASP.Net cache item

    - by Ajay
    Hi, I want to implement my own customCacheDependency class by deriving base CacheDependency, as provided SqlCacheDependency is not suitable for my case. (thousands of cache items, and there will so many subscriptions in SQL as well as issues with registration in ASP.Net) I want to use this in ASP.Net VirtualPathProvider's our custom implementation, so I can pass this CustomCacheDependecy to notify the asp.net that file content in the DB has changed. Can some one point me to any custom implementation of CacheDependency (preferably using MessageQueue)? Thanks & Regards, Ajay

    Read the article

  • How to invalidate layout of listbox from custom children

    - by Stephen Price
    I have a custom panel for a listbox <ItemsPanelTemplate x:Key="FloatPanelTemplate"> <Controls:FloatPanel x:Name="CardPanel" /> </ItemsPanelTemplate> The panel lays out its children using its X and Y dependency properties. This all works nicely when the FloatPanel is used by itself - I'm using FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure on the dependency properties of the child items to tell the FloatPanel to redraw its layout. When I use it in a Listbox (code above) then it draws fine the first time, but when I drag the children (which modifies the item's X and Y) it is not notifying the Listbox that it needs to redraw the FloatPanel's children. I think the issue is related to the fact that each item in the bound collection is wrapped with a ListBoxItem. Hopefully I've described what i'm doing well enough that someone can tell me how to make the panel (or its children) tell it needs to do the Layout routines again. As I said it works once (initial draw) but then dragging items doesn't work (Listbox isnt aware that its children have changed and needs to relayout.) If I drag an item and then resize the window, the listbox does a layout and the items are drawn in their new locations. How do I notify the ListBox (or more importantly the FloatPanel in the ItemsPanelTemplate) that it needs to do a Layout pass?

    Read the article

  • Why does stored procedure invalidate SQL Cache Dependency?

    - by Fabio Milheiro
    After many hours, I finally realize that I am working correctly with the Cache object in my ASP.NET application but my stored procedures stops it from working correctly. This stored procedure works correctly: CREATE PROCEDURE [dbo].[ListLanguages] @Page INT = 1, @ItemsPerPage INT = 10, @OrderBy NVARCHAR (100) = 'ID', @OrderDirection NVARCHAR(4) = 'DESC' AS BEGIN SELECT ID, [Name], Flag, IsDefault FROM dbo.Languages END But this (the one I wanted) doesn't: CREATE PROCEDURE [dbo].[ListLanguages] @Page INT = 1, @ItemsPerPage INT = 10, @OrderBy NVARCHAR (100) = 'ID', @OrderDirection NVARCHAR(4) = 'DESC', @TotalRecords INT OUTPUT AS BEGIN SET @TotalRecords = 10 EXEC('SELECT ID, Name, Flag, IsDefault FROM ( SELECT ROW_NUMBER() OVER (ORDER BY ' + @OrderBy + ' ' + @OrderDirection + ') as Row, ID, Name, Flag, IsDefault FROM dbo.Languages) results WHERE Row BETWEEN ((' + @Page + '-1)*' + @ItemsPerPage + '+1) AND (' + @Page + '*' + @ItemsPerPage + ')') END I gave the @TotalRecords parameter the value 10 so you can be sure that the problem is not from the COUNT(*) function which I know is not supported well. Also, when I run it from SQL Server Management Studio, it does exactly what it should do. In the ASP.NET application the results are retrieved correctly, only the cache is somehow unable to work! Can you please help? Maybe a hint I believe that the reason why the dependency HasChanged property is related to the fact that the column Row generated from the ROW_NUMBER is only temporary and, therefore, the SQL SERVER is not able to to say whether the results are changed or not. That's why HasChanged is always set to true. Does anyone know how to paginate results from SQL SERVER without using COUNT or ROW_NUMBER functions?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >