示例#1
0
 /// <summary>
 /// Constructor for class. Requires a featureClass and a string pointing to an out directory. By default the generalized logistic method is specified
 /// </summary>
 /// <param name="inFtr">Input featureClass</param>
 /// <param name="procedure">The procedure to run</param>
 public sasIntegration(IFeatureClass inFtr, SasProcedure procedure)
 {
     infeatureclass = inFtr;
     p = procedure;
     o = ((IDataset)inFtr).Workspace.PathName + "\\SASOUTPUT\\" + p.ToString();
     if (System.IO.Directory.Exists(o))
     {
         System.Windows.Forms.DialogResult rslt = System.Windows.Forms.MessageBox.Show(p.ToString() + " folder already exists. Do you want to rename the existing " + p.ToString() + " outputs (If you select no existing outputs will be lost)?", "Existing Directory", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
         if (rslt == System.Windows.Forms.DialogResult.Yes)
         {
             string newOutName             = getNewName(o);
             System.IO.DirectoryInfo dInfo = new System.IO.DirectoryInfo(o);
             dInfo.MoveTo(newOutName);
             updateOldSasFile(newOutName);
         }
     }
     geoUtil.check_dir(o);
     if (!System.IO.File.Exists(sasexe))
     {
         System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
         ofd.DefaultExt  = ".exe";
         ofd.Filter      = "SAS Executable|*.exe";
         ofd.Title       = "Can't find SAS exe!";
         ofd.Multiselect = false;
         System.Windows.Forms.DialogResult rslt = ofd.ShowDialog();
         if (rslt == System.Windows.Forms.DialogResult.OK)
         {
             sasexe = ofd.FileName;
             esriUtil.Properties.Settings.Default.SASEXE = sasexe;
             esriUtil.Properties.Settings.Default.Save();
         }
         else
         {
             sasexe = null;
         }
     }
     prStInfo = pr.StartInfo;
     prStInfo.CreateNoWindow  = true;
     prStInfo.UseShellExecute = false;
     prStInfo.FileName        = sasexe;
     prStInfo.Arguments       = "-sysin \"" + OutSasPath + "\" -log \"" + OutDirectory + "\" -print \"" + OutDirectory + "\"";
 }
 /// <summary>
 /// Constructor for class. Requires a featureClass and a string pointing to an out directory. By default the generalized logistic method is specified
 /// </summary>
 /// <param name="inFtr">Input featureClass</param>
 /// <param name="procedure">The procedure to run</param>
 public sasIntegration(IFeatureClass inFtr,SasProcedure procedure)
 {
     infeatureclass = inFtr;
     p = procedure;
     o = ((IDataset)inFtr).Workspace.PathName + "\\SASOUTPUT\\" + p.ToString();
     if (System.IO.Directory.Exists(o))
     {
         System.Windows.Forms.DialogResult rslt = System.Windows.Forms.MessageBox.Show(p.ToString() + " folder already exists. Do you want to rename the existing " + p.ToString()+" outputs (If you select no existing outputs will be lost)?", "Existing Directory", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question);
         if (rslt == System.Windows.Forms.DialogResult.Yes)
         {
             string newOutName = getNewName(o);
             System.IO.DirectoryInfo dInfo = new System.IO.DirectoryInfo(o);
             dInfo.MoveTo(newOutName);
             updateOldSasFile(newOutName);
         }
     }
     geoUtil.check_dir(o);
     if (!System.IO.File.Exists(sasexe))
     {
         System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
         ofd.DefaultExt = ".exe";
         ofd.Filter = "SAS Executable|*.exe";
         ofd.Title = "Can't find SAS exe!";
         ofd.Multiselect = false;
         System.Windows.Forms.DialogResult rslt = ofd.ShowDialog();
         if (rslt == System.Windows.Forms.DialogResult.OK)
         {
             sasexe = ofd.FileName;
             esriUtil.Properties.Settings.Default.SASEXE = sasexe;
             esriUtil.Properties.Settings.Default.Save();
         }
         else
         {
             sasexe = null;
         }
     }
     prStInfo = pr.StartInfo;
     prStInfo.CreateNoWindow = true;
     prStInfo.UseShellExecute = false;
     prStInfo.FileName = sasexe;
     prStInfo.Arguments = "-sysin \"" + OutSasPath + "\" -log \"" + OutDirectory + "\" -print \"" + OutDirectory + "\"";
 }