Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUp() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void SetUp()
        {
            _life = new LifeSupport();
            PageCache       pageCache       = Storage.pageCache();
            DatabaseLayout  databaseLayout  = Storage.directory().databaseLayout();
            Config          config          = Config.defaults(GraphDatabaseSettings.default_schema_provider, EMPTY.ProviderDescriptor.name());
            NullLogProvider nullLogProvider = NullLogProvider.Instance;
            StoreFactory    storeFactory    = new StoreFactory(databaseLayout, config, new DefaultIdGeneratorFactory(Storage.fileSystem()), pageCache, Storage.fileSystem(), nullLogProvider, EmptyVersionContextSupplier.EMPTY);

            _neoStores = storeFactory.OpenAllNeoStores(true);
            _neoStores.Counts.start();
            CountsComputer.recomputeCounts(_neoStores, pageCache, databaseLayout);
            _nodeStore         = _neoStores.NodeStore;
            _relationshipStore = _neoStores.RelationshipStore;
            PropertyStore propertyStore = _neoStores.PropertyStore;
            JobScheduler  scheduler     = JobSchedulerFactory.createScheduler();
            Dependencies  dependencies  = new Dependencies();

            dependencies.SatisfyDependency(EMPTY);
            DefaultIndexProviderMap providerMap = new DefaultIndexProviderMap(dependencies, config);

            _life.add(providerMap);
            _indexingService = IndexingServiceFactory.createIndexingService(config, scheduler, providerMap, new NeoStoreIndexStoreView(LockService.NO_LOCK_SERVICE, _neoStores), SchemaUtil.idTokenNameLookup, empty(), nullLogProvider, nullLogProvider, IndexingService.NO_MONITOR, new DatabaseSchemaState(nullLogProvider), false);
            _propertyPhysicalToLogicalConverter = new PropertyPhysicalToLogicalConverter(_neoStores.PropertyStore);
            _life.add(_indexingService);
            _life.add(scheduler);
            _life.init();
            _life.start();
            _propertyCreator = new PropertyCreator(_neoStores.PropertyStore, new PropertyTraverser());
            _recordAccess    = new DirectRecordAccess <PropertyRecord, PrimitiveRecord>(_neoStores.PropertyStore, Loaders.propertyLoader(propertyStore));
        }
Esempio n. 2
0
        //private void RecordCollisionConflict(SaveChangeContext context, MegaStoreConstraintException e)
        //{
        //    var existingItem = e.Node == null ? null :
        //        _metadataStore.FindItemMetadataByNodeId(e.Node.Node.Id);
        //    if (existingItem != null)
        //    {
        //        // ConstraintConflictReason.Collision does not fire the collision resolver!!!11
        //        context.RecordConstraintConflictForItem(existingItem.GlobalId, ConstraintConflictReason.Other);
        //    }
        //    else
        //    {
        //        context.RecordRecoverableErrorForItem(new RecoverableErrorData(e));
        //    }
        //}
        //private void RecordConcurrencyConflict(SaveChangeContext context, MegaStoreConcurrencyException e)
        //{
        //    var existingItem = e.Node == null ? null :
        //        _metadataStore.FindItemMetadataByNodeId(e.Node.Node.Id);
        //    // try to handle in a regular way
        //    if (existingItem != null)
        //    {
        //        context.RecordConstraintConflictForItem(existingItem.GlobalId, ConstraintConflictReason.Other);
        //    }
        //    // we are doomed!
        //    else
        //    {
        //        context.RecordRecoverableErrorForItem(new RecoverableErrorData(e));
        //    }

        //}
        #endregion

        #region default implementation of interfaces
        public ChangeApplier(MetadataStore metadataStore, SyncIdFormatGroup idFormats, NodeStore nodeStore)
        {
            _metadataStore  = metadataStore;
            _idFormats      = idFormats;
            _nodeStore      = nodeStore;
            AssumeSameFiles = true;
        }
        void InitializeComponent()
        {
            nodeView           = new NodeView();
            Store              = new NodeStore(typeof(BatchDownloadNode));
            nodeView.NodeStore = Store;
            // working around bug #51688 (https://bugzilla.xamarin.com/show_bug.cgi?id=51688)
            typeof(NodeView).GetField("store", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(nodeView, Store);

            var renderer = new CellRendererToggle();

            renderer.Activatable = true;
            renderer.Toggled    += RendererOnToggled;
            nodeView.AppendColumn("Checked", renderer, "active", 0);
            nodeView.AppendColumn("URL", new CellRendererText(), "text", 1);
            VBox.PackStart(nodeView, true, true, 0);
            cbStartNow       = new CheckButton();
            cbStartNow.Label = "Start Now?";
            VBox.PackStart(cbStartNow, false, false, 0);
            AddButton("Ok", ResponseType.Ok);
            AddButton("Cancel", ResponseType.Cancel);
            DefaultResponse = ResponseType.Cancel;
            Response       += (o, args) =>
            {
                if (args.ResponseId == ResponseType.Ok)
                {
                    BtnOk_Click(o, args);
                }
                else
                {
                    BtnCancel_Click(o, args);
                }
            };
            ShowAll();
        }
Esempio n. 4
0
    private async Task RigthOpenFolder(string Path)
    {
        SetStatus("Openning Directory...", YELLOW);
        var BaseDir = await Server.ParsePathB(Path);

        var Folders = await Server.EnumFoldersB(BaseDir?.ID, false);

        SetStatus("Connected", GREEN);

        RigthStore = new NodeStore(typeof(NameTreeNode));
        if (Path.Trim(' ', '/', '\\', '\r', '\n') != string.Empty)
        {
            RigthStore.AddNode(new NameTreeNode("...", async() =>
            {
                int IndexOfLast = RigthPathBox.Text.TrimEnd('\\', '/').LastIndexOfAny(new char[] { '\\', '/' });
                if (IndexOfLast < 0)
                {
                    return;
                }
                RigthPathBox.Text = RigthPathBox.Text.Substring(0, IndexOfLast + 1);
                await RigthOpenFolder(RigthPathBox.Text);
            }));
        }
        foreach (var Folder in Folders)
        {
            RigthStore.AddNode(new NameTreeNode(Folder?.Name, async() =>
            {
                RigthPathBox.Text = Path + Folder?.Name + "/";
                await RigthOpenFolder(RigthPathBox.Text);
            }));
        }
        RightNodeList.NodeStore = RigthStore;
    }
Esempio n. 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void before()
        public virtual void Before()
        {
            StoreFactory storeFactory = new StoreFactory(_testDirectory.databaseLayout(), Config.defaults(), new DefaultIdGeneratorFactory(_fs.get()), PageCacheRule.getPageCache(_fs.get()), _fs.get(), NullLogProvider.Instance, EmptyVersionContextSupplier.EMPTY);

            _neoStores = storeFactory.OpenAllNeoStores(true);
            _nodeStore = _neoStores.NodeStore;
        }
Esempio n. 6
0
        /// <summary>
        /// Setups the nodeview.
        /// </summary>
        private void SetupNodeView()
        {
            nvSequenceOptionsStore = new NodeStore(typeof(SequenceOperationTreeNode));

            nvSequenceOptions.NodeStore = nvSequenceOptionsStore;
            nvSequenceOptions.AppendColumn(new TreeViewColumn("Time", new CellRendererText(), "text", 0));
            nvSequenceOptions.AppendColumn(new TreeViewColumn("Duration", new CellRendererText(), "text", 1));
            nvSequenceOptions.AppendColumn(new TreeViewColumn("State", new CellRendererText(), "text", 2));

            nvSequenceOptions.ButtonPressEvent += new ButtonPressEventHandler(OnSequenceOptionsButtonPress);
            nvSequenceOptions.KeyPressEvent    += new KeyPressEventHandler(OnSequenceOptionsKeyPress);
            nvSequenceOptions.RowActivated     += (o, args) => {
                var node = ((o as NodeView).NodeSelection.SelectedNode as SequenceOperationTreeNode);
                ActiveNode       = node;
                sbDays.Value     = node.SeqOp.Duration.Days;
                sbHours.Value    = node.SeqOp.Duration.Hours;
                sbMinutes.Value  = node.SeqOp.Duration.Minutes;
                sbSeconds.Value  = node.SeqOp.Duration.Seconds;
                sbMilliSec.Value = node.SeqOp.Duration.Milliseconds;
                cbState.Active   = (node.SeqOp.State == DPinState.HIGH) ? 0 : 1;

                btnRemoveOperation.Sensitive = true;

                SwitchToApplyBtn();
            };

            nvSequenceOptions.Show();
        }
Esempio n. 7
0
        /// <summary>
        /// Node ComboBox Refresh
        /// </summary>
        protected void OnNodeRefresh(object sender, StoreRefreshDataEventArgs e)
        {
            try {
                var data = new List <object>();
                if (!String.IsNullOrEmpty(LscsComboBox.SelectedItem.Value) &&
                    !String.IsNullOrEmpty(DevComboBox.SelectedItem.Value))
                {
                    var ids = WebUtility.ItemSplit(LscsComboBox.SelectedItem.Value);
                    if (ids.Length == 2)
                    {
                        var lscId          = Int32.Parse(ids[0]);
                        var groupId        = Int32.Parse(ids[1]);
                        var devId          = Int32.Parse(DevComboBox.SelectedItem.Value);
                        var comboboxEntity = new BComboBox();
                        var dict           = comboboxEntity.GetNodes(lscId, devId, true, false, true, false);
                        if (dict != null && dict.Count > 0)
                        {
                            foreach (var key in dict)
                            {
                                data.Add(new {
                                    Id   = key.Key,
                                    Name = key.Value
                                });
                            }
                        }
                    }
                }

                NodeStore.DataSource = data;
                NodeStore.DataBind();
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            }
        }
Esempio n. 8
0
        public AddFromResourceFileGUI(ExportSettingsController settings, FilesSelectedCallback callback)
        {
            this.callback = callback;
            this.settings = settings;

            Build();

            nodestore = new NodeStore(typeof(VectorFilePath));

            CellRendererToggle selectToggle = new CellRendererToggle();

            selectToggle.Activatable = true;
            selectToggle.Toggled    += (object o, ToggledArgs args) =>
            {
                VectorFilePath selected = (VectorFilePath)nodestore.GetNode(new TreePath(args.Path));
                //Invert value
                selected.Selected = !selected.Selected;
            };

            EntryList.AppendColumn("Add", selectToggle, "active", 0);
            EntryList.AppendColumn("Name", new Gtk.CellRendererText(), "text", 1);
            EntryList.AppendColumn("Path", new Gtk.CellRendererText(), "text", 2);


            EntryList.NodeStore = nodestore;
        }
Esempio n. 9
0
 internal RelationshipCounts(StoreAccess storeAccess, MutableObjectLongMap <CountsKey> counts, System.Predicate <RelationshipRecord> countUpdateCondition, OwningRecordCheck <RelationshipRecord, ConsistencyReport_RelationshipConsistencyReport> inner)
 {
     this.NodeStore            = storeAccess.RawNeoStores.NodeStore;
     this.Counts               = counts;
     this.CountUpdateCondition = countUpdateCondition;
     this.Inner = inner;
 }
        public CellRendererTextEditable(NodeStore store, string column)
        {
            m_Column = column;
            m_Store  = store;

            this.Editable = true;
        }
Esempio n. 11
0
 internal CountsBuilderDecorator(StoreAccess storeAccess)
 {
     this._storeAccess                     = storeAccess;
     this._nodeStore                       = storeAccess.RawNeoStores.NodeStore;
     this._nodeCountBuildCondition         = new MultiPassAvoidanceCondition <NodeRecord>(0);
     this._relationshipCountBuildCondition = new MultiPassAvoidanceCondition <RelationshipRecord>(1);
 }
Esempio n. 12
0
    protected void openFileClicked(object sender, EventArgs e)
    {
        if (manager.cleanUp())
        {
            var filechooser = new FileChooserDialog("Choose the Wad file to open", this,
                                                    FileChooserAction.Open,
                                                    "Cancel", ResponseType.Cancel,
                                                    "Open", ResponseType.Accept);

            if (filechooser.Run() == (int)ResponseType.Accept)
            {
                if (manager.openWadFile(filechooser.Filename))
                {
                    var store = new NodeStore(typeof(TableNode));

                    foreach (var entry in manager.mapEntries)
                    {
                        store.AddNode(new TableNode(entry.Key, entry.Value.Type.ToString(), "" + entry.Value.UncompressedSize, "", entry.Value));
                    }
                    nodeview.NodeStore = store;
                }
            }

            filechooser.Destroy();
        }
    }
Esempio n. 13
0
 void RemoveFolder(NodeView View, NodeStore Store)
 {
     foreach (var node in View.NodeSelection.SelectedNodes)
     {
         Store.RemoveNode(node);
     }
 }
Esempio n. 14
0
 public DeleteDuplicateNodesStep(StageControl control, Configuration config, LongIterator nodeIds, NodeStore nodeStore, PropertyStore propertyStore, DataImporter.Monitor storeMonitor) : base(control, "DEDUP", config)
 {
     this._nodeStore     = nodeStore;
     this._propertyStore = propertyStore;
     this._nodeIds       = nodeIds;
     this._storeMonitor  = storeMonitor;
 }
Esempio n. 15
0
        private CreateReportDialog(Builder builder) : base(builder.GetObject("CreateReportDialog").Handle)
        {
            builder.Autoconnect(this);
            DefaultResponse = ResponseType.Cancel;

            Response += Dialog_Response;

            buttonAddParticipant.Clicked += ButtonAddParticipant_Clicked;
            buttonAddDecision.Clicked    += ButtonAddDecision_Clicked;

            nodeStoreParticiapnts = new NodeStore(typeof(ParticipantModel));
            nodeStoreParticiapnts.AddNode(new ParticipantModel()
            {
                Fake = true
            });

            nodeStoreDecisions = new NodeStore(typeof(DecisionModel));
            nodeStoreDecisions.AddNode(new DecisionModel()
            {
                Fake = true
            });

            nodeViewParticiapnts = new NodeView(nodeStoreParticiapnts);
            nodeViewParticiapnts.AppendColumn("Name", new CellRendererText(), "text", 0);
            alignmentParticiapnts.Add(nodeViewParticiapnts);
            nodeViewParticiapnts.ShowAll();

            nodeViewDecisions = new NodeView(nodeStoreDecisions);
            nodeViewDecisions.AppendColumn("Problem", new CellRendererText(), "text", 0);
            nodeViewDecisions.AppendColumn("Solution", new CellRendererText(), "text", 1);
            nodeViewDecisions.AppendColumn("Responsible", new CellRendererText(), "text", 2);
            nodeViewDecisions.AppendColumn("ControlDate", new CellRendererText(), "text", 3);
            alignmentDecisions.Add(nodeViewDecisions);
            nodeViewDecisions.ShowAll();
        }
Esempio n. 16
0
 public OnlineIndexUpdates(NodeStore nodeStore, RelationshipStore relationshipStore, IndexingUpdateService updateService, PropertyPhysicalToLogicalConverter converter)
 {
     this._nodeStore         = nodeStore;
     this._relationshipStore = relationshipStore;
     this._updateService     = updateService;
     this._converter         = converter;
 }
Esempio n. 17
0
        private ICollection <DynamicRecord> AllocateAndApply(NodeStore nodeStore, long nodeId, long[] longs)
        {
            ICollection <DynamicRecord> records = DynamicNodeLabels.allocateRecordsForDynamicLabels(nodeId, longs, nodeStore.DynamicLabelStore);

            nodeStore.UpdateDynamicLabelRecords(records);
            return(records);
        }
Esempio n. 18
0
    /// <summary>
    /// Initializes the mod grid.
    /// Sets the nodestore up to store Mod View Models,
    /// Then adds the appropriate columns to the ModGrid.
    /// </summary>
    private void InitializeModGrid()
    {
        ModGrid.NodeSelection.Changed += onModSelection;
        NodeStore modStore = new NodeStore(typeof(ModViewModel));

        ModGrid.NodeStore = modStore;
        //this line currently works around a bug in mono 5. Should be able to remove it once mono 6 is publicly used.
        typeof(NodeView).GetField("store", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ModGrid, modStore);

        CellRendererToggle modcheckbox = new CellRendererToggle();

        modcheckbox.Activatable = true;
        modcheckbox.Toggled    += delegate(object o, Gtk.ToggledArgs args) {
            var node = modStore.GetNode(new Gtk.TreePath(args.Path)) as ModViewModel;
            node.Enabled = !node.Enabled;
        };
        //modcheckbox.
        TreeViewColumn modEnabled = new TreeViewColumn("Enabled", modcheckbox, "active", 0);

        //modEnabled.AddAttribute(modcheckbox, "active", 0);
        ModGrid.AppendColumn(modEnabled);
        //modEnabled.SetCellDataFunc(modcheckbox, "activatable", true,);
        ModGrid.AppendColumn("title", new Gtk.CellRendererText(), "text", 1);
        ModGrid.AppendColumn("description", new Gtk.CellRendererText(), "text", 2);
        ModGrid.AppendColumn("version", new Gtk.CellRendererText(), "text", 3);
        ModGrid.AppendColumn("author", new Gtk.CellRendererText(), "text", 4);
        ModGrid.AppendColumn("date", new Gtk.CellRendererText(), "text", 5);
        ModGrid.AppendColumn("url", new Gtk.CellRendererText(), "text", 6);
        ModGrid.AppendColumn("updateurl", new Gtk.CellRendererText(), "text", 7);
        // ModGrid.AppendColumn("test", new Gtk.CellRendererToggle();
        ModGrid.ShowAll();
    }
        public InvoiceDetailDialog(Invoice invoice)
        {
            this.Build();

            var nodeStore = new NodeStore(typeof(InvoiceItemNode));

            nodeview.NodeStore = nodeStore;
            //workaround for bug (not setting NodeStore)
            typeof(NodeView).GetField("store", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(nodeview, nodeStore);

            foreach (var item in invoice.InvoicedItems)
            {
                nodeview.NodeStore.AddNode(new InvoiceItemNode(item));
            }

            nodeview.AppendColumn("Invoice item text", new CellRendererText(), "text", 0);
            nodeview.AppendColumn("Invoice item cost", new CellRendererText(), "text", 1);

            labelType.Text           = invoice.Type.ToString();
            labelNumber.Text         = invoice.InvoiceNumber;
            labelDebtorName.Text     = invoice.Debtor.FullName;
            labelDebtorAdress.Text   = invoice.Debtor.Adress;
            labelDebtorZIP.Text      = invoice.Debtor.ZIPCode;
            labelCreditorName.Text   = invoice.Creditor.FullName;
            labelCreditorAdress.Text = invoice.Creditor.Adress;
            labelCreditorZIP.Text    = invoice.Creditor.ZIPCode;
            labelInvoiceDate.Text    = invoice.InvoiceDate.ToString("dd.MM.yyyy");
            labelMaturityDate.Text   = invoice.MaturityDate.ToString("dd.MM.yyyy");
        }
Esempio n. 20
0
        public override bool VisitNodeCommand(NodeCommand command)
        {
            NodeStore nodeStore = _neoStores.NodeStore;

            Track(nodeStore, command);
            Track(nodeStore.DynamicLabelStore, command.After.DynamicLabelRecords);
            return(false);
        }
Esempio n. 21
0
        private static long HighestNodeId(GraphDatabaseService db)
        {
            DependencyResolver resolver  = DependencyResolver(db);
            NeoStores          neoStores = resolver.ResolveDependency(typeof(RecordStorageEngine)).testAccessNeoStores();
            NodeStore          nodeStore = neoStores.NodeStore;

            return(nodeStore.HighestPossibleIdInUse);
        }
Esempio n. 22
0
 public async System.Threading.Tasks.Task ConnectAsync()
 {
     if (!IsConnected)
     {
         IsConnected = true;
         await NodeStore.StartNodeBinding(ApiHandler, WebSocketHandler);
     }
 }
Esempio n. 23
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void startUp()
        public virtual void StartUp()
        {
            Config       config       = Config.defaults(GraphDatabaseSettings.label_block_size, "60");
            StoreFactory storeFactory = new StoreFactory(TestDirectory.databaseLayout(), config, new DefaultIdGeneratorFactory(Fs.get()), PageCacheRule.getPageCache(Fs.get()), Fs.get(), NullLogProvider.Instance, EmptyVersionContextSupplier.EMPTY);

            _neoStores = storeFactory.OpenAllNeoStores(true);
            _nodeStore = _neoStores.NodeStore;
        }
Esempio n. 24
0
        private NodeRecord NodeRecordWithDynamicLabels(long nodeId, NodeStore nodeStore, params long[] labels)
        {
            NodeRecord node = new NodeRecord(nodeId, false, 0, 0);
            ICollection <DynamicRecord> initialRecords = AllocateAndApply(nodeStore, node.Id, labels);

            node.SetLabelField(DynamicLabelsLongRepresentation(initialRecords), initialRecords);
            return(node);
        }
        private void InitializeWidgets()
        {
            originalImageArea           = new ImageArea();
            originalImageArea.ImageMode = ImageAreaMode.Zoom;

            unassistedImagePlaceholder.Add(originalImageArea);

            segmentationStore = new NodeStore(typeof(SegmentedNode));
        }
Esempio n. 26
0
        // END HERZUM BUG FIX: alignment input-output TLAB-255


        /// <summary>
        /// Creates the input mapping column with combo box.
        /// TODO improve the input mapping combo box:
        /// 1. it doesn't set values until combo box loses focus within table view confirm change - Edited event is raised only then
        /// 2. there is no indication that the field can be modified - render combo box always, OR show some icon that it can be modified
        /// </summary>
        /// <returns>
        /// The input mapping column with combo box.
        /// </returns>
        /// <param name='inputStore'>
        /// Input store.
        /// </param>
        private TreeViewColumn CreateInputMappingColumnWithComboBox(NodeStore inputStore, string columntTitle)
        {
            Gtk.CellRendererCombo comboRenderer = new Gtk.CellRendererCombo();

            comboRenderer.HasEntry   = false;
            comboRenderer.Mode       = CellRendererMode.Editable;
            comboRenderer.TextColumn = 0;
            comboRenderer.Editable   = true;

            ListStore comboBoxStore = new ListStore(typeof(string));

            comboRenderer.Model = comboBoxStore;

            //when user activates combo box, refresh combobox store with available input mapping per node
            comboRenderer.EditingStarted += delegate(object o, EditingStartedArgs args)
            {
                comboBoxStore.Clear();
                IOItemNode     currentItem = (IOItemNode)inputStore.GetNode(new TreePath(args.Path));
                ExperimentNode currentNode = m_component.ExperimentNode;
                string         currentType = currentItem.Type;
                // HERZUM SPRINT 2.4: TLAB-162
                //InputMappings availableInputMappingsPerNode = new InputMappings (currentNode.Owner);
                InputMappings availableInputMappingsPerNode = new InputMappings(m_applicationContext.Application.Experiment);
                // END HERZUM SPRINT 2.4: TLAB-162
                if (currentNode != null && availableInputMappingsPerNode.ContainsMappingsForNode(currentNode))
                {
                    foreach (string incomingOutput in availableInputMappingsPerNode[currentNode].Keys)
                    {
                        if (string.Equals(currentType, availableInputMappingsPerNode [currentNode] [incomingOutput]))
                        {
                            comboBoxStore.AppendValues(Mono.Unix.Catalog.GetString(incomingOutput));
                        }
                    }
                }
            };

            //when edition has been completed set current item node with proper mapping
            comboRenderer.Edited += delegate(object o, EditedArgs args) {
                IOItemNode n = (IOItemNode)inputStore.GetNode(new TreePath(args.Path));
                n.MappedTo = args.NewText;
                RefreshIOHighlightInExperiment(n.MappedTo);
            };

            //finally create the column with above combo renderer
            var mappedToColumn = new TreeViewColumn();

            mappedToColumn.Title = columntTitle;
            mappedToColumn.PackStart(comboRenderer, true);

            //this method sets the text view to current mapping, when combo box is not active
            mappedToColumn.SetCellDataFunc(comboRenderer, delegate(TreeViewColumn tree_column, CellRenderer cell, ITreeNode node) {
                IOItemNode currentItem = (IOItemNode)node;
                comboRenderer.Text     = currentItem.MappedTo;
            });

            return(mappedToColumn);
        }
Esempio n. 27
0
 public NeoStoreIndexStoreView(LockService locks, NeoStores neoStores)
 {
     this.Locks             = locks;
     this._neoStores        = neoStores;
     this.PropertyStore     = neoStores.PropertyStore;
     this.NodeStore         = neoStores.NodeStore;
     this.RelationshipStore = neoStores.RelationshipStore;
     this._counts           = neoStores.Counts;
 }
Esempio n. 28
0
 void AddFolder(NodeStore Store)
 {
     if (PlatformDetection.IsWindows)
     {
         using (Ionic.Utils.FolderBrowserDialogEx dialog = new Ionic.Utils.FolderBrowserDialogEx())
         {
             dialog.Description           = "Choose the Folder to scan.";
             dialog.ShowNewFolderButton   = false;
             dialog.ShowFullPathInEditBox = true;
             if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 if (!String.IsNullOrWhiteSpace(dialog.SelectedPath))
                 {
                     try
                     {
                         Store.AddNode(new StringNode()
                         {
                             Value = new System.IO.DirectoryInfo(dialog.SelectedPath).FullName
                         });
                     }
                     catch (Exception ex)
                     {
                         MessageBox.Show(ex.Message);
                     }
                 }
             }
         }
     }
     else
     {
         using (Gtk.FileChooserDialog fc = new Gtk.FileChooserDialog("Choose the Folder to scan.",
                                                                     this,
                                                                     FileChooserAction.SelectFolder,
                                                                     "Cancel", ResponseType.Cancel,
                                                                     "Open", ResponseType.Accept))
         {
             fc.LocalOnly = false;
             if (fc.Run() == (int)ResponseType.Accept)
             {
                 try
                 {
                     Store.AddNode(new StringNode()
                     {
                         Value = new System.IO.DirectoryInfo(fc.Filename).FullName
                     });
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show(ex.Message);
                 }
             }
             //Don't forget to call Destroy() or the FileChooserDialog window won't get closed.
             fc.Destroy();
         }
     }
 }
Esempio n. 29
0
 internal ProjectView()
 {
     componentNodeStore = new NodeStore(typeof(GenericNode));
     componentNodeView  = new NodeView(componentNodeStore);
     componentNodeView.AppendColumn("Project Tree", new CellRendererText(), "text", 0);
     componentScrolledWindow = new ScrolledWindow();
     componentScrolledWindow.Add(componentNodeView);
     componentNodeView.NodeSelection.Mode     = SelectionMode.Single;
     componentNodeView.NodeSelection.Changed += new EventHandler(OnSelectionChanged);
 }
Esempio n. 30
0
    private NameTreeNode GetTreeNodeByLocation(NodeView View, NodeStore Store, double X, double Y)
    {
        View.GetPathAtPos((int)X, (int)Y, out TreePath Path);
        if (Path == null)
        {
            return(null);
        }

        return((NameTreeNode)Store.GetNode(Path));
    }
Esempio n. 31
0
 public MainWindow()
     : base(Gtk.WindowType.Toplevel)
 {
     Build ();
     Devices = new NodeStore (typeof(DeviceTreeNode));
     DeviceView = new NodeView (Devices);
     scrolledwindow1.Add (DeviceView);
     DeviceView.AppendColumn ("Name", new CellRendererText (), "text", 0);
     DeviceView.AppendColumn ("IP", new CellRendererText (), "text", 1);
     DeviceView.ShowAll ();
     DeviceView.NodeSelection.Changed += OnDeviceSelectionChanged;
     SelectedDeviceTreeNode = new DeviceTreeNode ("", "");
 }
Esempio n. 32
0
		protected override void addExpandedNodesToFringe(NodeStore fringe, Node node,
			Problem problem) 
		{

			if (!(alreadySeen(node))) 
			{
				//it is critical here put the hashcode of the object
				//into the hashtable!!
				closed.Add(node.getState().GetHashCode(),"");
				fringe.add(expandNode(node,problem));

			}
		}
Esempio n. 33
0
		public ArrayList search(Problem problem, NodeStore fringe) 
		{
			clearInstrumentation();
			fringe.add(new Node(problem.getInitialState()));
			setQueueSize(fringe.size());
			while (!(fringe.isEmpty())) 
			{
				Node node = (Node) fringe.remove();
				setQueueSize(fringe.size());
				if (problem.isGoalState(node.getState())) 
				{
					return SearchUtils.actionsFromNodes(node.getPathFromRoot());
				}
				addExpandedNodesToFringe(fringe, node, problem);
				setQueueSize(fringe.size());
			}
			return new ArrayList();//Empty List indicates Failure
		}
Esempio n. 34
0
		protected override void addExpandedNodesToFringe(NodeStore fringe, Node node,
			Problem problem) 
		{
			fringe.add(expandNode(node, problem));
		}
Esempio n. 35
0
		protected abstract void addExpandedNodesToFringe(NodeStore fringe,
			Node node, Problem p);
Esempio n. 36
0
 private void PopulateServices()
 {
     this.serviceNodes = new NodeStore (typeof(ServiceNode));
     this.clientNodes = new NodeStore (typeof(ClientNode));
     this.nvServices.NodeStore = this.serviceNodes;
     this.nvServices.AppendColumn ("Service", new Gtk.CellRendererText (), "text", 0);
     this.nvServices.NodeSelection.Changed += new EventHandler(HandleNodeSelectionChanged);
     this.nvClients.NodeStore = this.clientNodes;
     this.nvClients.AppendColumn ("Description", new CellRendererText(), "text", 0);
     this.nvClients.AppendColumn ("Host", new CellRendererText (), "text", 1);
     try {
         serviceBrowser = new ServiceBrowser ();
     } catch (Exception e) {
         Console.WriteLine (e.ToString ());
     }
     serviceBrowser.ServiceAdded += new ServiceBrowseEventHandler (HandleDiscoverServiceTypes);
     serviceBrowser.Browse ("_services._dns-sd._udp", "local");
 }
Esempio n. 37
0
    private void SetDetailView()
    {
        var selectednode = (MovieTreeNode)MovieNodeView.NodeSelection.SelectedNode;
        if (selectednode == null)
            return;
        var store = new NodeStore (typeof(DetailTreeNode));
        store.AddNode (new DetailTreeNode ("Added:", selectednode.SubAddDate));
        store.AddNode (new DetailTreeNode ("Release:", selectednode.ReleaseName));
        store.AddNode (new DetailTreeNode ("Comments:", selectednode.AuthorCommments));
        store.AddNode (new DetailTreeNode ("Language:", selectednode.Language));
        store.AddNode (new DetailTreeNode ("Rating:", selectednode.SubRating));
        store.AddNode (new DetailTreeNode ("IMDB:", selectednode.IMDBRating));
        store.AddNode (new DetailTreeNode ("Format:", selectednode.SubFormat));
        store.AddNode (new DetailTreeNode ("HearingImpaired:", selectednode.SubHearingImpaired.ToString ()));

        DetailNode.NodeStore = store;
        DetailNode.ShowAll ();
        Downloadbutton.Sensitive = true;
    }
Esempio n. 38
0
    private void GetSubs()
    {
        var store = new NodeStore (typeof(MovieTreeNode));
        statusbar1.Push (1, "Searching for filename.");
        var opensub = new OpenSubtitlesClient ();
        _subtitles = opensub.FileSearch (_fname, GetCurrentLang ());
        statusbar1.Push (2, "Found " + _subtitles.Count + " titles");
        if (_subtitles.Count > 0) {
            foreach (OpenSubtitlesClient.SearchResult sub in _subtitles) {
                var node = new MovieTreeNode {
                    Title = sub.MovieName,
                    Year = sub.MovieYear,
                    Season = sub.SeriesSeason,
                    Episode = sub.SeriesEpisode,
                    Uploader = sub.UserNickName,
                    Downloads = sub.SubDownloadsCnt,
                    DownloadLink = sub.SubDownloadLink,
                    AuthorCommments = sub.SubAuthorComment,
                    SubAddDate = sub.SubAddDate.ToShortDateString(),
                    ReleaseName = sub.MovieReleaseName,
                    IMDBRating = sub.MovieImdbRating,
                    SubRating = sub.SubRating,
                    Lang = sub.SubLanguageID,
                    Language = sub.LanguageName,
                    SubFormat = sub.SubFormat,
                    SubHearingImpaired = sub.SubHearingImpaired == "1",
                    IDMovieImdb = sub.IDMovieImdb
                };
                store.AddNode (node);
            }
        }

        MovieNodeView.NodeStore = store;
        DetailNode.NodeStore = null;
        MovieNodeView.ShowAll ();
        DetailNode.ShowAll ();

        TreeIter it;
        if (MovieNodeView.Model.GetIterFirst (out it)) {
            MovieNodeView.Selection.SelectIter (it);
            SetDetailView ();
        } else {
            Downloadbutton.Sensitive = false;
        }
    }
Esempio n. 39
0
    public MsdnView()
        : base("Msdn View")
    {
        DefaultSize = new Gdk.Size (1024,1024);

        HPaned hb = new HPaned ();

        Store = new NodeStore (typeof (TreeNode));
        WebControl wc = new WebControl ();
        ScrolledWindow sw = new ScrolledWindow ();
        NodeView view = new NodeView (Store);
        view.HeadersVisible = false;
        view.AppendColumn ("Name", new CellRendererText (), "text", 0);
        sw.WidthRequest = 300;
        InitTree ();
        Add (hb);
        hb.Add (sw);
        hb.Add (wc);
        sw.Add (view);

        // Events
        DeleteEvent += delegate {
            Application.Quit ();
        };

        view.NodeSelection.Changed += delegate {
            TreeNode n = (TreeNode) view.NodeSelection.SelectedNode;
            if (n == null)
                return;

            //
            // Fool msdn's code that tries to detect if it
            // is in a frame
            //
            string html = @"
        <frameset>
          <frame src='" + n.Href + @"?frame=true' />
        </frameset>";

            wc.OpenStream (MsdnClient.BaseUrl, "text/html");
            wc.AppendData (html);
            wc.CloseStream ();

        };
        view.RowExpanded += delegate (object o, RowExpandedArgs args) {
            TreeNode n = (TreeNode) Store.GetNode (args.Path);
            n.PopulateChildrenAsync ();
        };
    }