Example #1
0
        /// <summary>
        /// Set aliases to current snapshot entry. Aliases can be set even to those entries
        /// that doesn't belongs to any variable, field,..
        /// </summary>
        /// <param name="context">Context snapshot where operation is proceeded</param>
        /// <param name="aliasedEntry">Snapshot entry which will be aliased from current entry</param>
        protected override void setAliases(SnapshotBase context, ReadSnapshotEntryBase aliasedEntry)
        {
            Snapshot snapshot = ToSnapshot(context);

            snapshot.Factories.Logger.Log(snapshot, "set alias: " + this.ToString() + " from: " + aliasedEntry.ToString());
            snapshot.Factories.Benchmark.StartOperation(snapshot);

            ICopyModelSnapshotEntry entry = ToEntry(aliasedEntry);

            snapshot.Factories.Benchmark.StartAlgorithm(snapshot, AlgorithmType.SET_ALIAS);
            snapshot.Algorithms.AssignAlgorithm.AssignAlias(snapshot, path, entry.GetPath(snapshot));
            snapshot.Factories.Benchmark.FinishAlgorithm(snapshot, AlgorithmType.SET_ALIAS);

            snapshot.Factories.Benchmark.FinishOperation(snapshot);
        }
Example #2
0
        /// <summary>
        /// Set aliases to current snapshot entry. Aliases can be set even to those entries
        /// that doesn't belongs to any variable, field,..
        /// </summary>
        /// <param name="context">Context snapshot where operation is proceeded</param>
        /// <param name="aliasedEntry">Snapshot entry which will be aliased from current entry</param>
        protected override void setAliases(SnapshotBase context, ReadSnapshotEntryBase aliasedEntry)
        {
            Snapshot snapshot = ToSnapshot(context);

            SnapshotLogger.append(context, "set alias: " + this.ToString() + " from: " + aliasedEntry.ToString());

            if (snapshot.CurrentMode == SnapshotMode.InfoLevel)
            {
                return;
            }

            ICopyModelSnapshotEntry entry = ToEntry(aliasedEntry);
            AliasData data = entry.CreateAliasToEntry(snapshot);

            AssignCollector collector = new AssignCollector(snapshot);

            collector.AliasesProcessing = AliasesProcessing.BeforeCollecting;
            collector.ProcessPath(path);

            AssignAliasWorker worker = new AssignAliasWorker(snapshot);

            worker.AssignAlias(collector, data);

            data.Release(snapshot);
        }