public Node(TNSProxy.IMapManager mapManager) { IsFocused = false; IsTranscluded = false; IsLocationDirty = false; MapManager = mapManager; }
public CompendiumArchiveProcessor(FileInfo compendiumFile, Proxy.IMapManager mapManager, Proxy.INode map) { CompendiumFile = compendiumFile; _zipFile = new ZipFile(CompendiumFileStream); _fileCount = _zipFile.FileNamesInZip.Count(); _fileNames = _zipFile.FileNamesInZip.ToList(); MapManager = mapManager; Map = map; }
public BatchSaveCollapseStatesOperation(Proxy.IMapManager mapManager, PermissionLevel group) : base(mapManager) { if (group < PermissionLevel.Author) { _visibilityKey = "Visibility"; _collapseStateKey = "CollapseState"; } else { _visibilityKey = "AuthorVisibility"; _collapseStateKey = "AuthorCollapseState"; } }
public override void Update(Proxy.NodeType nodeType, ref Soap.TransactionFramework.TransactionChain chain) { if (Facade != null) { TransactionFramework.AddNodeTransactionLink addNodeTransaction = Facade.TransactionOrigin as TransactionFramework.AddNodeTransactionLink; if (addNodeTransaction != null) { if (addNodeTransaction.TransactionStatus == TransactionFramework.ServerStatus.ProcessingClient) { addNodeTransaction.NodeType = nodeType; return; } } } DelayedActions.Enqueue(new DelayedNodeAction() { Action = Proxy.TransactionActionType.TypeUpdated, NodeType = nodeType }); }
public override void ConnectNode(Proxy.ConnectionType connectionType, Proxy.INode node, ref Soap.TransactionFramework.TransactionChain chain) { base.ConnectNode(connectionType, node, ref chain); if (Facade != null) { TransactionFramework.AddRelationshipTransactionLink addRelationshipTransaction = Facade.TransactionOrigin as TransactionFramework.AddRelationshipTransactionLink; if (addRelationshipTransaction != null) { if (addRelationshipTransaction.TransactionStatus == TransactionFramework.ServerStatus.ProcessingClient) { addRelationshipTransaction.AddNode(connectionType, node); return; } } } DelayedActions.Enqueue(new DelayedRelationshipAction() { Action = Proxy.TransactionActionType.Updated, ConnectionType = connectionType, Node = node }); }
public override void ConnectNode(Proxy.ConnectionType connectionType, Proxy.INode node, ref TransactionFramework.TransactionChain chain) { base.ConnectNode(connectionType, node, ref chain); if (LastUpdateRelationship != null && LastUpdateRelationship.TransactionStatus == TransactionFramework.ServerStatus.ProcessingClient) { LastUpdateRelationship.AddNode(connectionType, node); } else { LastUpdateRelationship = CreateNewUpdateRelationship(); LastUpdateRelationship.AddNode(connectionType, node); chain.AddTransaction(LastUpdateRelationship); } chain.TransactionExecuting += OnTransactionExecuting; }
public override void Update(Proxy.RelationshipType relationshipType, ref TransactionFramework.TransactionChain chain) { RelationshipType = relationshipType; if (LastUpdateRelationship != null && LastUpdateRelationship.TransactionStatus == TransactionFramework.ServerStatus.ProcessingClient) { LastUpdateRelationship.RelationshipType = relationshipType; } else { LastUpdateRelationship = CreateNewUpdateRelationship(); LastUpdateRelationship.RelationshipType = relationshipType; chain.AddTransaction(LastUpdateRelationship); } chain.TransactionExecuting += OnTransactionExecuting; }
IMetadata IViewModelMetadataFactory.CreateMetadata(TNSProxy.IMetadataSet newMetadataSet) { return new Metadata(newMetadataSet, MapManager); }
public DeleteRelationships(Proxy.IMapManager mapManager) : base(mapManager) { }
public override void Update(Proxy.NodeType nodeType, ref TransactionFramework.TransactionChain chain) { NodeType = nodeType; if (LastUpdateNode != null && LastUpdateNode.TransactionStatus == TransactionFramework.ServerStatus.ProcessingClient) { LastUpdateNode.NodeType = nodeType; } else { LastUpdateNode = CreateNewUpdateNode(nodeType); chain.AddTransaction(LastUpdateNode); } chain.TransactionExecuting += OnTransactionExecuting; }
public InProcessNode(Proxy.IMapManager mapManager) : base(mapManager) { }
public Proxy.IRelationship CreateRelationship(Guid domainId, Guid rootMapId, Proxy.RelationshipType relationshipType, string originalId, ref TransactionFramework.TransactionChain chain) { TransactionFramework.AddRelationshipTransactionLink createRelationshipTransaction = new TransactionFramework.AddRelationshipTransactionLink(); createRelationshipTransaction.MapManager = this; createRelationshipTransaction.DomainId = domainId; createRelationshipTransaction.RootMapId = rootMapId; createRelationshipTransaction.RelationshipType = relationshipType; createRelationshipTransaction.OriginalId = originalId; chain.AddTransaction(createRelationshipTransaction); Proxy.IRelationship relationship = createRelationshipTransaction.CreateInProcessObjects(); return relationship; }
public IFileProcessor CreateFileProcessor(FileInfo file, Proxy.IMapManager mapManager, Proxy.INode map, Point location) { if (file.Name.EndsWith(".zip")) { using (FileStream fileStream = file.OpenRead()) { bool isCompendiumExport = false; bool hasExportsFolderAndXml = false; bool hasLinkedFilesFolder = false; ZipFile zipFile = new ZipFile(fileStream); foreach (string filename in zipFile.FileNamesInZip) { if (filename.StartsWith("Exports/")) { if (filename.EndsWith(".xml")) { isCompendiumExport = true; //hasExportsFolderAndXml = true; break; } } //if (filename.StartsWith("Linked Files/")) //{ // hasLinkedFilesFolder = true; //} //if (hasExportsFolderAndXml && hasLinkedFilesFolder) //{ // isCompendiumExport = true; // break; //} } if (isCompendiumExport) { var compendiumFileProcessor = new CompendiumArchiveProcessor(file, mapManager, map); return compendiumFileProcessor; } } } else if (file.Name.EndsWith(".xml")) { using (var stream = file.OpenRead()) { var compendiumXmlProcessor = new CompendiumXmlFileProcessor(stream, "", ""); compendiumXmlProcessor.MapManager = mapManager; compendiumXmlProcessor.Map = map; if (compendiumXmlProcessor.Nodes.Any()) { return compendiumXmlProcessor; } } } return new DroppedFileProcessor(file, location); }
public void CreateRootMap(Guid domainId, string mapName, Proxy.NodeType nodeType, string originalId) { ServiceProxy.CreateRootMapAsync(System.Windows.Browser.HtmlPage.Document.DocumentUri.ToString(), domainId, mapName, NodeTypes.ConvertProxyToService(nodeType), originalId); }
public Proxy.INode CreateNode(Guid domainId, Guid rootMapId, Proxy.NodeType nodeType, string originalId, ref TransactionFramework.TransactionChain chain) { TransactionFramework.AddNodeTransactionLink createNodeTransaction = new TransactionFramework.AddNodeTransactionLink(); createNodeTransaction.MapManager = this; createNodeTransaction.DomainId = domainId; createNodeTransaction.RootMapId = rootMapId; createNodeTransaction.NodeType = nodeType; createNodeTransaction.OriginalId = originalId; chain.AddTransaction(createNodeTransaction); Proxy.INode node = createNodeTransaction.CreateInProcessObjects(); return node; }
public void QueryMapByNodeAsync(Proxy.INode node, int depth) { QueryMapResponseStateInfo responseStateInfo = new QueryMapResponseStateInfo(); responseStateInfo.ResponseType = QueryMapResponseStateType.ByNode; ServiceProxy.QueryMapAsync(System.Windows.Browser.HtmlPage.Document.DocumentUri.ToString(), node.DomainId, node.Id, depth, null, null, responseStateInfo); }
public void QueryMapByNodeAsync(Proxy.INode node) { QueryMapByNodeAsync(node, 1); }
public TranscludeNodesOperation(Proxy.IMapManager mapManager) : base(mapManager) { }
public SoapRelationship(Proxy.IMapManager mapManager) : base(mapManager) { Status = Proxy.LoadState.None; }
public Node(TNSProxy.INode node) { Proxy = node; MapManager = node.MapManager; }
public ConnectTranscludedNodesOperation(Proxy.IMapManager mapManager) : base(mapManager) { }
private void OnAcquireNodesByDomainCompleted(object sender, Proxy.NodesEventArgs e) { foreach (Proxy.Node node in e.Nodes.Values) { if (node.NodeType == _mapManager.NodeTypes["DomainNode"]) { // TODO: The following line doesn't actually need to be here. NodeUid = node.Id.ToString(); SetNodeId(node.Id); InitializeNavigator(GetDomainId().Value, GetNodeId().Value); } } }
private TransactionFramework.UpdateNodeTransactionLink CreateNewUpdateNode(Proxy.NodeType nodeType) { TransactionFramework.UpdateNodeTransactionLink updateNode = new TransactionFramework.UpdateNodeTransactionLink(); updateNode.DomainId = DomainId; updateNode.MapManager = MapManager; updateNode.Node = this; updateNode.NodeType = nodeType; return updateNode; }
public BatchDeleteNodesOperation(Proxy.IMapManager mapManager) : base(mapManager) { }
public SoapNode(Proxy.IMapManager mapManager) : base(mapManager) { Status = Proxy.LoadState.None; }
public UpdateNodeTypeOperation(Proxy.IMapManager mapManager) : base(mapManager) { }
public InProcessRelationship(Proxy.IMapManager mapManager) : base(mapManager) { }
public void LoadNode(TNSProxy.IRelationship relationship, TNSProxy.INode node) { Proxy = node; if (node.Status == TNSProxy.LoadState.Full) { /// Check that there isn't more than one MapContainerRelationship. If there is then this node is transcluded. IEnumerable<TNSProxy.IRelationship> mapContainerRelationships = node.Relationships.FindRelationships(MapManager.ConnectionTypes["From"], MapManager.RelationshipTypes["MapContainerRelationship"]); NumTranclusions = mapContainerRelationships.Count(rel => rel.MapManager.RelationshipFactory.FindRelationship(rel.Id) != null); IsTranscluded = (NumTranclusions > 1); //BUG: value changes based on the current view, possibly incorrect as the node is either transcluded or not transcluded regardless of the view TNSProxy.NodeMetadataCollection metadata = node.Metadata; string xPositionAsString = "0"; string yPositionAsString = "0"; if (metadata.FindMetadata(relationship, "XPosition") != null) { xPositionAsString = metadata.FindMetadata(relationship, "XPosition").Value; } if (metadata.FindMetadata(relationship, "YPosition") != null) { yPositionAsString = metadata.FindMetadata(relationship, "YPosition").Value; } if (metadata.FindMetadata(relationship, "CollapseState") != null) { _viewerCollapseState = (CollapseState)Enum.Parse(typeof(CollapseState), metadata.FindMetadata(relationship, "CollapseState").Value, true); } else { _viewerCollapseState = CollapseState.None; } if (metadata.FindMetadata(relationship, "Visibility") != null) { _viewerVisibility = metadata.FindMetadata(relationship, "Visibility").Value.Equals("visible", StringComparison.OrdinalIgnoreCase) ? Visibility.Visible : Visibility.Collapsed; } else { _viewerVisibility = Visibility.Visible; } if (metadata.FindMetadata(relationship, "AuthorCollapseState") != null) { _authorCollapseState = (CollapseState)Enum.Parse(typeof(CollapseState), metadata.FindMetadata(relationship, "AuthorCollapseState").Value, true); } else { _authorCollapseState = CollapseState.None; } if (metadata.FindMetadata(relationship, "AuthorVisibility") != null) { _authorVisibility = metadata.FindMetadata(relationship, "AuthorVisibility").Value.Equals("visible", StringComparison.OrdinalIgnoreCase) ? Visibility.Visible : Visibility.Collapsed; } else { _authorVisibility = Visibility.Visible; } if (!string.IsNullOrEmpty(xPositionAsString) && !string.IsNullOrEmpty(yPositionAsString)) { double xPosition; double yPosition; if (double.TryParse(xPositionAsString, out xPosition) && double.TryParse(yPositionAsString, out yPosition)) { _location = new Point(xPosition, yPosition); } } IDictionary<string, TNSProxy.IMetadataSet> nodeMetadata = metadata.FindMetadata(null, (TNSProxy.ConnectionType)null); foreach (TNSProxy.IMetadataSet metadataSet in nodeMetadata.Values) { IMetadata viewModelMetadata = ViewModelMetadataFactory.CreateMetadata(metadataSet); viewModelMetadata.PropertyChanged += OnMetadataPropertyChanged; Metadata.Add(viewModelMetadata.Name, viewModelMetadata); NodeProperties.UIMetadata.Add(viewModelMetadata.Name, viewModelMetadata.Value); } if (!_isMetadataChangeRegistered) { Metadata.CollectionChanged += OnCollectionChanged; _isMetadataChangeRegistered = true; } } }
public ConnectNodesOperation(Proxy.IMapManager mapManager) : base(mapManager) { }
private Proxy.NodeMetadataCollection GetMetadataCollection(Proxy.INode proxy) { return proxy.Metadata; }