You are on page 1of 2

public override void OnClick()

{
//IDocument pDocument = m_application.Document;
//IMxDocument pMXDocument = (IMxDocument)pDocument;
// IMap pMap = pMXDocument.FocusMap;
// ILayer pLayer=pMap.get_Layer(0);
// MessageBox.Show("First Arc Map Prac"+pLayer.Name);
//IDocument pDocument = m_application.Document;
//IMxDocument pMXDocument = (IMxDocument)pDocument;
//IMap pMap = pMXDocument.FocusMap;
// IMap pmap = pMap.get_Map(0);
//MessageBox.Show("Name is " +pMap.Name);
//IDocument pDocument = m_application.Document;
//IMxDocument pMXDocument = (IMxDocument)pDocument;
//IMap pMap = pMXDocument.FocusMap;
//ISpatialReference spa = pMap.SpatialReference;
// MessageBox.Show("Name is " + spa.Name);
// TODO: Add Command2.OnClick implementation

//IDocument pDocument = m_application.Document;


//IMxDocument pMXDocument = (IMxDocument)pDocument;
//IMap pMap = pMXDocument.FocusMap;
//ILayer pLayer = pMap.get_Layer(0);
//int a = pMap.SelectionCount;
//pMap.MoveLayer(pLayer, 4);
// bool flag = true;
// if(flag==true)
//{
// pLayer.Visible=false;
// }
// else
// {
//pLayer.Visible = true;
//}
IDocument pDocument = m_application.Document;
IMxDocument pMxDocument = (IMxDocument)pDocument;
IMap pMap = pMxDocument.FocusMap;
ILayer pLayer = pMap.get_Layer(0);
double max, min;
max = pLayer.MaximumScale;
if (max == 0)
{
MessageBox.Show("The Maximum Scale is currently 0!");
pLayer.MaximumScale = 10000;
max = pLayer.MaximumScale;
MessageBox.Show("The new Maximum Scale which is set : " + max);
}
else
MessageBox.Show("The new Maximum Scale which is ALREADY been set
is: " + max);
min = pLayer.MinimumScale;
if (min == 0)
{
MessageBox.Show("The Minimum Scale is currently 0!");
pLayer.MinimumScale = 1;
min = pLayer.MinimumScale;
MessageBox.Show("The new Minimum Scale which been set is : " + m
in);
}
else
MessageBox.Show("The new Minimum Scale which is ALREADY been set
is: " + min);
// TODO: Add Command1.OnClick implementation
}
#endregion
}
}

You might also like