55 lines
1.6 KiB
C#
55 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using ArcGIS.Desktop.Internal.Framework.Controls;
|
|
using ArcGIS.Desktop.Framework.Dialogs;
|
|
using System.Windows;
|
|
|
|
namespace OliviaAddInPro.Helper
|
|
{
|
|
public static class HelperGlobal
|
|
{
|
|
|
|
public static bool ponMsg(String mensaje, System.Windows.MessageBoxImage icon = MessageBoxImage.Information,
|
|
String titulo = "OLIVIA",
|
|
MessageBoxButton button= MessageBoxButton.OK)
|
|
{
|
|
//MessageBoxResult Show(string messageText, string caption, MessageBoxButton button, MessageBoxImage icon);
|
|
MessageBoxResult res = ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(mensaje, titulo, button, icon);
|
|
if (res == MessageBoxResult.Yes || res == MessageBoxResult.OK)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
public static string RevisaText(string text)
|
|
{
|
|
StringBuilder sb = new StringBuilder();
|
|
foreach (char c in text)
|
|
{
|
|
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_')
|
|
{
|
|
sb.Append(c);
|
|
}
|
|
}
|
|
return sb.ToString();
|
|
}
|
|
public static bool Str2Int(string entr, out int sal)
|
|
{
|
|
sal = 0;
|
|
try
|
|
{
|
|
sal=int.Parse(entr);
|
|
return true;
|
|
}
|
|
catch(Exception)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|