Ejemplo n.º 1
0
 public ComVariableInfoTreeNode(ComVariableInfo comVariableInfo)
     : base()
 {
     _comVariableInfo = comVariableInfo;
     Text             = _comVariableInfo.Name;
     FullText         = String.Format("{0}.{1}", _comVariableInfo.ComTypeInfo.FullName, _comVariableInfo.Name);
 }
Ejemplo n.º 2
0
        public void DescribeComVariableInfo(ComVariableInfo comVariableInfo)
        {
            try
            {
                Clear();

                if (comVariableInfo == null)
                {
                    return;
                }

                AppendText("Constant ");
                AppendText(comVariableInfo.Name, ForeColor, FontStyle.Bold);
                AppendText(String.Format(" = {0}", comVariableInfo.ConstantValue));
                AppendText(Environment.NewLine);
                AppendText("   Member of ");
                InsertLink(comVariableInfo.ComTypeInfo.FullName);
                AppendText(Environment.NewLine);

                WriteSummary(comVariableInfo.Description);
            }
            catch
            {
            }
        }
Ejemplo n.º 3
0
        public static string ResolveCommandId(SolidEdgeFramework.Application application, int theCommandID)
        {
            ComVariableInfo variableInfo = null;

            if (_environmentConstantsMap.Count == 0)
            {
                Initialize();
            }

            try
            {
                ComEnumInfo enumInfo = null;
                SolidEdgeFramework.Environment environment = application.GetActiveEnvironment();
                Guid environmentGuid = environment.GetGuid();

                if (_environmentConstantsMap.TryGetValue(environmentGuid, out enumInfo))
                {
                    variableInfo = enumInfo.Variables.Where(x => x.ConstantValue != null).Where(x => x.ConstantValue.Equals(theCommandID)).FirstOrDefault();

                    if (variableInfo != null)
                    {
                        return(String.Format("{0} [{1}.{2}]", theCommandID, variableInfo.ComTypeInfo.Name, variableInfo.Name));
                    }
                }
            }
            catch
            {
                GlobalExceptionHandler.HandleException();
            }

            return(String.Format("{0} [Undefined]", theCommandID));
        }