Пример #1
0
 /// <summary>
 /// Attaches a Property Grid class object to the property grid tool window, or modal dialog box.
 /// </summary>
 /// <param name="o">A custom property class (such as Attributes.cs) is attached to the property grid.</param>
 public void SetPropertyGrid(object o, bool bIsModal)
 {
     m_strPropertyType = o.GetType().Name.ToString();
     if (m_strPropertyType == "AttributeProperties")
     {
         attrProp = (AttributeProperties)o;
         attrProp.SetAttributeProperties(pgProperties);
     }
     if (m_strPropertyType == "NetworkProperties")
     {
         networkProp = (NetworkProperties)o;
         networkProp.SetNetworkProperties(pgProperties, bIsModal);
     }
     if (m_strPropertyType == "AssetProperties")
     {
         assetProp = (AssetProperties)o;
         assetProp.SetAssetProperties(pgProperties, bIsModal);
     }
     if (m_strPropertyType == "CalculatedFieldsProperties")
     {
         calcProp = (CalculatedFieldsProperties)o;
         calcProp.CreateCalculatedFieldPropertyGrid(pgProperties);
     }
 }
Пример #2
0
        /// <summary>
        /// Attaches a Property Grid class object to the property grid tool window.
        /// </summary>
        /// <param name="o">A Custom property grid class, o is attached to the .SelectedObject property of the property grid class.</param>
        public void SetPropertyGrid(object o, bool bIsModal)
        {
            m_strPropertyType = o.GetType().Name.ToString();
            switch (m_strPropertyType)
            {
            case "AttributeProperties":
                attrProp = (AttributeProperties)o;
                attrProp.SetAttributeProperties(pgProperties);
                attrProp.UpdatePropertyGrid(pgProperties);
                break;

            case "NetworkProperties":
                networkProp = (NetworkProperties)o;
                networkProp.SetNetworkProperties(pgProperties, bIsModal);
                networkProp.UpdatePropertyGrid(pgProperties);
                break;

            case "AssetProperties":
                // We should set up a seperate class for assets as well.  We probably could do it through
                // the custom class interface, but the code is neater and easier to track/maintain if we create a new AssetProperties class.
                // CustomClass cc = (CustomClass)o;
                assetProp = (AssetProperties)o;
                assetProp.SetAssetProperties(pgProperties, bIsModal);
                break;

            case "CalculatedFieldProperties":
                calcProp = (CalculatedFieldsProperties)o;
                calcProp.CreateCalculatedFieldPropertyGrid(pgProperties);
                break;

            default:
                Global.WriteOutput("Could not access properties for the selected item. ");
                break;
            }
            return;
        }