Use this tool to get latitude and longitude values for one or multiple address.
Click here to access the tool.
Sunday, September 19, 2010
Saturday, September 11, 2010
MP3 Downloader
Sometimes you may see many mp3 files to download from the same page. You have to click each link and then save it to your computer.
Here is a simple tool which can help you under such situations.
Download the MP3Downloader ZIP file and install the program on your computer.
Double-click the short-cut installed on your machine.
You will see a dialog box like this.
Here is a simple tool which can help you under such situations.
Download the MP3Downloader ZIP file and install the program on your computer.
Double-click the short-cut installed on your machine.
You will see a dialog box like this.
Enter the URL from which you want to download MP3 files and click Extract MP3 button.
All the MP3 Links will be listed. Click on "Download MP3" button and all the files will be downloaded to your C:\Temp\ folder.
Have fun !
Draggable Border in Silverlight
Sometimes it may be required to have draggable borders in Silverlight application.
In the XAML file create the definition for the Border.
Here is the XAML definition for Border.
==============================================
<!—Border Welcome -->
<Border x:Name="BorderWelcome" BorderBrush="Gray" BorderThickness="5" Width="180" Height="100" Background="Silver" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,100,10,0" Visibility="Collapsed" CornerRadius="10" >
<Grid x:Name="GridWelcome" Height="90" Width="170">
<StackPanel>
</StackPanel>
</Grid>
</Border>
==============================================
In the C sharp code add this new class (BorderDragDrop) to the project.
==============================================
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace SilverlightGISApp
{
public class BorderDragDrop
{
Border border;
bool IsmouseDown = false;
TranslateTransform TTObject = new TranslateTransform();
Point originalWindowPoint;
bool getOrigWindowPosition = true;
private BorderDragDrop() { }
/// <summary>
/// Allow a Border to be dragged.
/// </summary>
public static void Attach(Border inborder)
{
BorderDragDrop bdd = new BorderDragDrop { border = inborder };
FrameworkElement theFrameworkElement = inborder as FrameworkElement;
theFrameworkElement.MouseLeftButtonDown += bdd.border_MouseLeftButtonDown ;
theFrameworkElement.MouseLeftButtonUp += bdd.border_MouseLeftButtonUp ;
theFrameworkElement.MouseMove += bdd.border_MouseMove ;
}
private void border_MouseMove(object sender, MouseEventArgs e)
{
FrameworkElement b = sender as FrameworkElement;
Point currntPoint = e.GetPosition(null);
if (IsmouseDown)
{
b.RenderTransform = TTObject;
TTObject.X = currntPoint.X - originalWindowPoint.X;
TTObject.Y = currntPoint.Y - originalWindowPoint.Y;
}
}
private void border_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
FrameworkElement b = sender as FrameworkElement;
b.ReleaseMouseCapture();
IsmouseDown = false;
border.Cursor = Cursors.Arrow;
}
private void border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
object origMouseDownSource = e.OriginalSource;
if (origMouseDownSource.GetType() != typeof(Border)) return;
FrameworkElement b = sender as FrameworkElement;
IsmouseDown = true;
if (getOrigWindowPosition == true)
{
originalWindowPoint = e.GetPosition(null);
getOrigWindowPosition = false;
}
b.CaptureMouse();
border.Cursor = Cursors.Hand;
}
}
}
==============================================
During the InitializeAppSettings() function call add the following line of code.
BorderDragDrop.Attach(BorderWelcome);
Now the border becomes draggable.
In the XAML file create the definition for the Border.
Here is the XAML definition for Border.
==============================================
<!—Border Welcome -->
<Border x:Name="BorderWelcome" BorderBrush="Gray" BorderThickness="5" Width="180" Height="100" Background="Silver" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,100,10,0" Visibility="Collapsed" CornerRadius="10" >
<Grid x:Name="GridWelcome" Height="90" Width="170">
<StackPanel>
</StackPanel>
</Grid>
</Border>
==============================================
In the C sharp code add this new class (BorderDragDrop) to the project.
==============================================
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace SilverlightGISApp
{
public class BorderDragDrop
{
Border border;
bool IsmouseDown = false;
TranslateTransform TTObject = new TranslateTransform();
Point originalWindowPoint;
bool getOrigWindowPosition = true;
private BorderDragDrop() { }
/// <summary>
/// Allow a Border to be dragged.
/// </summary>
public static void Attach(Border inborder)
{
BorderDragDrop bdd = new BorderDragDrop { border = inborder };
FrameworkElement theFrameworkElement = inborder as FrameworkElement;
theFrameworkElement.MouseLeftButtonDown += bdd.border_MouseLeftButtonDown ;
theFrameworkElement.MouseLeftButtonUp += bdd.border_MouseLeftButtonUp ;
theFrameworkElement.MouseMove += bdd.border_MouseMove ;
}
private void border_MouseMove(object sender, MouseEventArgs e)
{
FrameworkElement b = sender as FrameworkElement;
Point currntPoint = e.GetPosition(null);
if (IsmouseDown)
{
b.RenderTransform = TTObject;
TTObject.X = currntPoint.X - originalWindowPoint.X;
TTObject.Y = currntPoint.Y - originalWindowPoint.Y;
}
}
private void border_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
FrameworkElement b = sender as FrameworkElement;
b.ReleaseMouseCapture();
IsmouseDown = false;
border.Cursor = Cursors.Arrow;
}
private void border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
object origMouseDownSource = e.OriginalSource;
if (origMouseDownSource.GetType() != typeof(Border)) return;
FrameworkElement b = sender as FrameworkElement;
IsmouseDown = true;
if (getOrigWindowPosition == true)
{
originalWindowPoint = e.GetPosition(null);
getOrigWindowPosition = false;
}
b.CaptureMouse();
border.Cursor = Cursors.Hand;
}
}
}
==============================================
During the InitializeAppSettings() function call add the following line of code.
BorderDragDrop.Attach(BorderWelcome);
Now the border becomes draggable.
Monday, September 6, 2010
Buffering in Google Maps
Have you ever wondered what are the landmarks within 1000 feet of your home ?
Using this Google Buffering Tool you can analyze and check.
Here is how it looks.
Using this Google Buffering Tool you can analyze and check.
Here is how it looks.
Sunday, September 5, 2010
To call a Javascript from a class which is not derived from Web Page in ESRI ArcGIS Server ADF
Problem :
To call a Javascript function from a C Sharp class in ArcGIS Server ADF Application.
Possible Solutions :
Use a callbackresult and add it to the Map Control as shown below.
public class DownloadMap : IMapServerToolAction
{
#region IMapServerToolAction Members
void IMapServerToolAction.ServerAction(ESRI.ArcGIS.ADF.Web.UI.WebControls.ToolEventArgs args)
{
Map map = (Map)args.Control;
MapCircleEventArgs theMapCircleEventArgs = (MapCircleEventArgs)args;
map.Page.Session["CircleCenterX"] = theMapCircleEventArgs.MapCenter.X.ToString();
map.Page.Session["CircleCenterY"] = theMapCircleEventArgs.MapCenter.Y.ToString();
map.Page.Session["CircleRadius"] = theMapCircleEventArgs.MapRadius.ToString();
StringBuilder sb = new StringBuilder();
sb.Append("function owin() { window.open('DownloadPage.aspx'); } owin() ;");
ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult theCallbackResult = ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult.CreateJavaScript(sb.ToString());
map.CallbackResults.Add(theCallbackResult);
}
#endregion
}
To call a Javascript function from a C Sharp class in ArcGIS Server ADF Application.
Possible Solutions :
Use a callbackresult and add it to the Map Control as shown below.
public class DownloadMap : IMapServerToolAction
{
#region IMapServerToolAction Members
void IMapServerToolAction.ServerAction(ESRI.ArcGIS.ADF.Web.UI.WebControls.ToolEventArgs args)
{
Map map = (Map)args.Control;
MapCircleEventArgs theMapCircleEventArgs = (MapCircleEventArgs)args;
map.Page.Session["CircleCenterX"] = theMapCircleEventArgs.MapCenter.X.ToString();
map.Page.Session["CircleCenterY"] = theMapCircleEventArgs.MapCenter.Y.ToString();
map.Page.Session["CircleRadius"] = theMapCircleEventArgs.MapRadius.ToString();
StringBuilder sb = new StringBuilder();
sb.Append("function owin() { window.open('DownloadPage.aspx'); } owin() ;");
ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult theCallbackResult = ESRI.ArcGIS.ADF.Web.UI.WebControls.CallbackResult.CreateJavaScript(sb.ToString());
map.CallbackResults.Add(theCallbackResult);
}
#endregion
}
Visual Studio 2008 - Namespace was not recognised
Problem :
The Namespace found in one of the C sharp file was not at all recognized.
Possible Solution :
Check the property of the file of the C sharp file. It should say Compile instead of Content.
The Namespace found in one of the C sharp file was not at all recognized.
Possible Solution :
Check the property of the file of the C sharp file. It should say Compile instead of Content.
System.Runtime.Serialization.Json Namespace Issue
Problem :
The .Json namespace was missing and giving compilation error.
Possible Solution :
The System.ServiceModel.Web should be used along with System.Runtime.Serialization. Then Json will be recognized.
The .Json namespace was missing and giving compilation error.
Possible Solution :
The System.ServiceModel.Web should be used along with System.Runtime.Serialization. Then Json will be recognized.
Subscribe to:
Posts (Atom)
All Blogs so far ...
-
►
2022
(1)
- ► March 2022 (1)
-
►
2021
(1)
- ► March 2021 (1)
-
►
2020
(1)
- ► October 2020 (1)
-
►
2019
(4)
- ► March 2019 (4)
-
►
2017
(7)
- ► November 2017 (5)
- ► February 2017 (1)
- ► January 2017 (1)
-
►
2016
(13)
- ► December 2016 (4)
- ► November 2016 (2)
- ► April 2016 (1)
- ► March 2016 (1)
- ► February 2016 (1)
- ► January 2016 (1)
-
►
2015
(12)
- ► December 2015 (1)
- ► November 2015 (1)
- ► October 2015 (1)
- ► September 2015 (1)
- ► August 2015 (1)
- ► April 2015 (1)
- ► March 2015 (1)
- ► February 2015 (1)
- ► January 2015 (1)
-
►
2014
(12)
- ► December 2014 (1)
- ► November 2014 (1)
- ► October 2014 (1)
- ► September 2014 (1)
- ► August 2014 (1)
- ► April 2014 (1)
- ► March 2014 (1)
- ► February 2014 (1)
- ► January 2014 (1)
-
►
2013
(12)
- ► December 2013 (1)
- ► November 2013 (1)
- ► October 2013 (1)
- ► September 2013 (1)
- ► August 2013 (1)
- ► April 2013 (1)
- ► March 2013 (1)
- ► February 2013 (1)
- ► January 2013 (1)
-
►
2012
(13)
- ► December 2012 (1)
- ► November 2012 (1)
- ► October 2012 (1)
- ► September 2012 (1)
- ► August 2012 (1)
- ► April 2012 (1)
- ► March 2012 (1)
- ► February 2012 (2)
- ► January 2012 (1)
-
►
2011
(16)
- ► December 2011 (1)
- ► November 2011 (3)
- ► October 2011 (1)
- ► September 2011 (1)
- ► August 2011 (1)
- ► April 2011 (2)
- ► March 2011 (1)
- ► February 2011 (2)
- ► January 2011 (1)
-
▼
2010
(11)
- ► December 2010 (1)
- ► November 2010 (2)
- ► October 2010 (1)