Example #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:FwModelBrowser"/> class.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public FwModelBrowser()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

#if USINGCPP
			m_ode = OleDbEncapClass.Create();
			m_ode.Init(SystemInformation.ComputerName + "\\SILFW", "TestLangProj", null,
				FwKernelLib.OdeLockTimeoutMode.koltReturnError,
				(int)FwKernelLib.OdeLockTimeoutValue.koltvFwDefault);
			m_mdc = FwMetaDataCacheClass.Create();
			m_mdc.Init(m_ode);
#else
			string modelDir = DirectoryFinder.FwSourceDirectory;
			modelDir = modelDir.Substring(0, modelDir.LastIndexOf('\\'));
			modelDir = Path.Combine(modelDir, @"Output\XMI");
			m_mdc = MetaDataCache.CreateMetaDataCache(Path.Combine(modelDir, "xmi2cellar3.xml"));
#endif

			uint clid = 0;
			string classname = m_mdc.GetClassName(clid);
			m_tvClasses.SuspendLayout();
			AddNode(m_tvClasses.Nodes, classname, clid);
			m_tvClasses.Nodes[0].Expand();
			m_tvClasses.ResumeLayout(false);
		}
Example #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="T:FwModelBrowser"/> class.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public FwModelBrowser()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

#if USINGCPP
            m_ode = OleDbEncapClass.Create();
            m_ode.Init(SystemInformation.ComputerName + "\\SILFW", "TestLangProj", null,
                       FwKernelLib.OdeLockTimeoutMode.koltReturnError,
                       (int)FwKernelLib.OdeLockTimeoutValue.koltvFwDefault);
            m_mdc = FwMetaDataCacheClass.Create();
            m_mdc.Init(m_ode);
#else
            string modelDir = DirectoryFinder.FwSourceDirectory;
            modelDir = modelDir.Substring(0, modelDir.LastIndexOf('\\'));
            modelDir = Path.Combine(modelDir, @"Output\XMI");
            m_mdc    = MetaDataCache.CreateMetaDataCache(Path.Combine(modelDir, "xmi2cellar3.xml"));
#endif

            uint   clid      = 0;
            string classname = m_mdc.GetClassName(clid);
            m_tvClasses.SuspendLayout();
            AddNode(m_tvClasses.Nodes, classname, clid);
            m_tvClasses.Nodes[0].Expand();
            m_tvClasses.ResumeLayout(false);
        }