当前位置: 首页>>代码示例>>C#>>正文


C# Utilities.GetDesktopVersionFromRegistry方法代码示例

本文整理汇总了C#中Utilities.GetDesktopVersionFromRegistry方法的典型用法代码示例。如果您正苦于以下问题:C# Utilities.GetDesktopVersionFromRegistry方法的具体用法?C# Utilities.GetDesktopVersionFromRegistry怎么用?C# Utilities.GetDesktopVersionFromRegistry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utilities的用法示例。


在下文中一共展示了Utilities.GetDesktopVersionFromRegistry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InverseDirectionDLG

        public InverseDirectionDLG(IEditProperties2 EditorProperties)
        {
            InitializeComponent();
              m_ToolTip1 = new System.Windows.Forms.ToolTip();
              m_EditorProperties = EditorProperties;
              Utilities Utils = new Utilities();

              string sDesktopVers = Utils.GetDesktopVersionFromRegistry();
              if (sDesktopVers.Trim() == "")
            sDesktopVers = "Desktop10.1";
              else
            sDesktopVers = "Desktop" + sDesktopVers;
              string sValues =
              Utils.ReadFromRegistry(RegistryHive.CurrentUser, "Software\\ESRI\\" + sDesktopVers + "\\ArcMap\\Cadastral",
            "AddIn.FabricQualityControl_InverseDirection");

              IAngularConverter pAngConv = new AngularConverterClass();
              if (m_EditorProperties != null)
              {
            esriDirectionUnits pUnits = m_EditorProperties.DirectionUnits;
            string sAngleUnits = pUnits.ToString();
            sAngleUnits = sAngleUnits.Replace("esriDU", "");
            sAngleUnits = sAngleUnits.Replace("Minutes", " Minutes ");
            sAngleUnits = sAngleUnits.Replace("Decimal", "Decimal ");
            this.lblAngleUnits.Text = sAngleUnits;
              }

              if (sValues.Trim() == "")
            sValues = "False,0.000000,True,True,180,True,0.3,True";
              string[] Values = sValues.Split(',');
              try
              {
            string sTxt1 = Values[1];
            if (m_EditorProperties != null)
            {
              int iPrec = m_EditorProperties.AngularUnitPrecision;
              pAngConv.SetString(Values[1], esriDirectionType.esriDTNorthAzimuth, esriDirectionUnits.esriDUDecimalDegrees); //registry always stores in DD
              sTxt1 = pAngConv.GetString(esriDirectionType.esriDTNorthAzimuth, m_EditorProperties.DirectionUnits, m_EditorProperties.AngularUnitPrecision);
            }

            this.optManualEnteredDirnOffset.Checked = (Values[0].Trim() == "True");
            this.txtDirectionOffset.Text = sTxt1;
            this.optComputeDirnOffset.Checked = (Values[2].Trim() == "True");
            this.chkDirectionDifference.Checked = (Values[3].Trim() == "True");
            this.txtDirectionDifference.Text = Values[4];
            this.chkSubtendedDistance.Checked = (Values[5].Trim() == "True");
            this.txtSubtendedDist.Text = Values[6];
            this.chkReportResults.Checked = (Values[7].Trim() == "True");
              }
              catch
              { }
        }
开发者ID:Esri,项目名称:parcel-fabric-desktop-addins,代码行数:52,代码来源:InverseDirectionDLG.cs

示例2: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            //write the key
              Utilities Utils = new Utilities();
              string sDesktopVers = Utils.GetDesktopVersionFromRegistry();
              if (sDesktopVers.Trim() == "")
            sDesktopVers = "Desktop10.1";
              else
            sDesktopVers = "Desktop" + sDesktopVers;

              string sBool0 = this.optManualEnteredDirnOffset.Checked.ToString();
              string sTxt1 = this.txtDirectionOffset.Text;

              IAngularConverter pAngConv = new AngularConverterClass();
              if (!pAngConv.SetString(sTxt1, esriDirectionType.esriDTNorthAzimuth, m_EditorProperties.DirectionUnits))
            sTxt1 = "0";
              else
            sTxt1 = pAngConv.GetString(esriDirectionType.esriDTNorthAzimuth, esriDirectionUnits.esriDUDecimalDegrees, 6);//always write as decimal deg
              string sBool2 = this.optComputeDirnOffset.Checked.ToString();
              string sBool3 = this.chkDirectionDifference.Checked.ToString();
              string sTxt4 = this.txtDirectionDifference.Text;
              string sBool5 = this.chkSubtendedDistance.Checked.ToString();
              string sTxt6 = this.txtSubtendedDist.Text;
              string sBool7 = this.chkReportResults.Checked.ToString();

              Utils.WriteToRegistry(RegistryHive.CurrentUser, "Software\\ESRI\\" +
            sDesktopVers + "\\ArcMap\\Cadastral", "AddIn.FabricQualityControl_InverseDirection",
            sBool0 + "," + sTxt1 + "," + sBool2 + "," + sBool3 + "," + sTxt4 + "," + sBool5 + "," + sTxt6 + "," + sBool7);
        }
开发者ID:Esri,项目名称:parcel-fabric-desktop-addins,代码行数:29,代码来源:InverseDirectionDLG.cs


注:本文中的Utilities.GetDesktopVersionFromRegistry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。