Esempio n. 1
0
        public void Register(IServiceProvider serviceProvider)
        {
            ITripleStoreProvider tripleStoreProvider = (ITripleStoreProvider)serviceProvider.GetService(typeof(ITripleStoreProvider));
            ITripleStoreFactory  tripleStoreFactory  = ((IFactoryProvider)serviceProvider.GetService(typeof(IFactoryProvider))).Factory;
            IVisibilityManager   visibilityManager   = ((IVisibilityManager)serviceProvider.GetService(typeof(IVisibilityManager)));

            KE = new KEStore(tripleStoreProvider, tripleStoreFactory, visibilityManager);
            SelectionProvider = (ISelectionProvider)serviceProvider.GetService(typeof(ISelectionProvider));

            callServicesItem        = new ToolStripMenuItem("Find SADI services...");
            callServicesItem.Click += new EventHandler(callServicesItem_Click);

            IContextMenuProvider contextMenuProvider = (IContextMenuProvider)serviceProvider.GetService(typeof(IContextMenuProvider));

            contextMenuProvider.ContextMenu.Opening += new System.ComponentModel.CancelEventHandler(ContextMenu_Opening);
            contextMenuProvider.ContextMenu.Items.Add(new ToolStripSeparator());
            contextMenuProvider.ContextMenu.Items.Add(callServicesItem);

            try
            {
                string logFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
                //Trace.Listeners.Add(new TextWriterTraceListener(System.IO.File.AppendText(logFolder + "\\SADI.KE.log")));
                Debug.WriteLine("new logging session at " + DateTime.Now);
                Debug.Flush();
            }
            catch (Exception e)
            {
                MessageBox.Show(
                    "Unable to configure logging;\n" + e.Message,
                    "SADI error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Warning);
            }
        }
Esempio n. 2
0
 public KEStore(ITripleStoreProvider storeProvider, ITripleStoreFactory factory, IVisibilityManager visibilityManager)
 {
     StoreProvider     = storeProvider;
     Factory           = factory;
     VisibilityManager = visibilityManager;
     MappedStore       = new MemoryStore();
     Mapper            = new KEMapper(this);
     Vocab             = new KEVocab(factory);
 }