Esempio n. 1
0
        /// <summary>Constructor</summary>
        internal Tag(Bentley.MicroStation.AddIn addIn, TaggingMode oTagmode)
        {
            m_addIn   = addIn;
            m_tagmode = oTagmode;

            InitializeComponent();

            //WS: the schema file must reside the same location with this Addin .dll
            string strAssemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string strSchemaPath     = Path.Combine(strAssemblyFolder, "JansenGeoTags.01.00.ecschema.xml");

            oECAdaptor = new ECAdaptor();

            //WS: check if Geotag schema is in the dgn; if not, load it.
            if (!oECAdaptor.SchemaLoadedInModel("JansenGeoTags.01.00"))
            {
                if (!LoadECSchema(strSchemaPath))
                {
                    MessageBox.Show("Failed importing GeoTag Schema.");
                    return;
                }
            }

            string severName        = "azrhbjvsqlprd01.hbjv.local";
            string TagDBName        = "BHPB_STRTagDB";
            string connectionString = "Data Source=" + severName + ";Initial Catalog=" + TagDBName + ";Integrated Security=SSPI;";

            sqlConnection = new SqlConnection(connectionString);

            //WS: check functioin code list,
            if (AddInMain.oListFunctionCode != null)
            {
                LoadCmbboxFromList(cmbFunCode, AddInMain.oListFunctionCode);
            }
            else
            {
                AddInMain.oListFunctionCode = new List <string>();

                if (!LoadcmbFuncodeFromDB(cmbFunCode, sqlConnection, ref AddInMain.oListFunctionCode))
                {
                    MessageBox.Show("Failed to load Function Code from DB.");
                    return;
                }
            }

            //WS: load FBS from ProjectWise. "210536" is the "FBS" folder id, which is at "Standards - Site/Attribute Lookup List/FBS"
            if (!LoadcmbFBS(cmbUnit, 210536, AddInMain.ComApp.ActiveDesignFile.FullName))
            {
                MessageBox.Show("Failed to load FBS.");
                return;
            }
        }
Esempio n. 2
0
        private bool LoadECSchema(string strSchemaPath)
        {
            bool retVal = false;

            try
            {
                oECAdaptor = new ECAdaptor(strSchemaPath);

                retVal = oECAdaptor.LoadSchema();
            }
            catch
            { }

            return(retVal);
        }
Esempio n. 3
0
 public GeoTagList()
 {
     InitializeComponent();
     oECAdaptor = new ECAdaptor();
 }