示例#1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="loggerRef"></param>
 /// <param name="indent"></param>
 public FilterLogger(Reference <ILogger> loggerRef, string indent)
 {
     MinLogSeverity = LogSeverity.DebugL3;
     _loggerRef     = loggerRef.Clone();
     _logger        = _loggerRef.Target;
     _indent        = indent;
 }
        /// <summary>
        /// Creates a copy of a project item to another folder
        /// </summary>
        /// <param name="ref">Project item to copy</param>
        /// <param name="dest">Destination folder</param>
        /// <returns>Reference to the copy</returns>
        public Reference ProjectItemCopy(Reference @ref, Reference dest)
        {
            // Create a clone reference
            var copyRef = (Reference)@ref.Clone();

            // Copy storage file
            string refPath         = Path.GetFileName(@ref.StoragePath.TrimEnd('\\'));
            string destinationPath = (dest.TargetKind == ReferenceTargetKind.Directory) ? dest.StoragePath : Path.GetDirectoryName(dest.StoragePath);
            string newPath         = Path.Combine(destinationPath, refPath);

            if (@ref.TargetKind == ReferenceTargetKind.Directory)
            {
                DirectoryHelper.CopyDirectory(@ref.StoragePath, newPath);

                // Update children
                UpdateRenameChildren(copyRef, copyRef.StoragePath, newPath);
            }
            else
            {
                // Find a nonconflicting file name
                newPath = GetNonConflictingPath(refPath, destinationPath);

                // Copy
                File.Copy(@ref.StoragePath, newPath);
            }

            // Parent reference
            copyRef.Name        = Path.GetFileName(newPath);
            copyRef.StoragePath = newPath;
            dest.Add(copyRef);
            return(copyRef);
        }
示例#3
0
 public Reference copy(Reference r)
 {
     Ice.Identity ident = r.getIdentity();
     if (ident.name.Length == 0 && ident.category.Length == 0)
     {
         return(null);
     }
     return((Reference)r.Clone());
 }
示例#4
0
 public MarketDataRealtimeServer(
     Reference <ILogger> loggerRef,
     AsyncThreadQueue threadQueue,
     ICoreClient client)
 {
     _loggerRef       = loggerRef?.Clone() ?? throw new ArgumentNullException(nameof(loggerRef));
     _threadQueue     = threadQueue;
     _client          = client;
     _subsDetailIndex = new Dictionary <Guid, SubscriptionDetail>();
 }
示例#5
0
 public ISimpleStep Clone()
 {
     return(new TaskStep()
     {
         Name = Name,
         Condition = Condition,
         ContinueOnError = ContinueOnError,
         Enabled = Enabled,
         Environment = new Dictionary <String, String>(Environment ?? new Dictionary <String, String>(0, StringComparer.Ordinal)),
         Inputs = new Dictionary <String, String>(Inputs ?? new Dictionary <String, String>(0, StringComparer.OrdinalIgnoreCase)),
         Reference = Reference?.Clone(),
         TimeoutInMinutes = TimeoutInMinutes,
     });
 }
示例#6
0
 public object Clone()
 {
     try
     {
         Binding clone = (Binding)MemberwiseClone();
         clone.target     = (Reference)target.Clone();
         clone.expression = expression != null ? (Expression)expression.Clone() : null;
         clone.id         = id == null ? null : ExpressionUtils.generateBindingId();
         return(clone);
     }
     catch (CloneNotSupportedException ex)
     {
         throw new InvalidOperationException(ex.ToString(), ex);
     }
 }
示例#7
0
        public MarketDataRealtimeClient(
            Reference <ILogger> loggerRef,
            AsyncThreadQueue clientThreadQueue,
            ICoreClient client,
            MDSProviderId dataProvider)
        {
            if (dataProvider == MDSProviderId.Undefined)
            {
                throw new ArgumentNullException(nameof(dataProvider));
            }
            ProviderId        = dataProvider;
            _loggerRef        = loggerRef?.Clone() ?? throw new ArgumentNullException(nameof(loggerRef));
            ClientThreadQueue = clientThreadQueue ?? new AsyncThreadQueue(_loggerRef.Target);
            _mds = new MarketDataRealtimeServer(_loggerRef, clientThreadQueue, client);
            var serverSettings = new NamedValueSet();

            serverSettings.Set(MdpConfigName.ProviderId, (int)dataProvider);
            _mds.ApplySettings(serverSettings);
            _mds.Start();
        }
示例#8
0
 protected override Image Load()
 {
     return((Image)Reference.Clone());
 }
示例#9
0
 public LaunchPackage(Reference <ICoreClient> clientRef, InternalRequest request)
 {
     _ClientRef = clientRef.Clone();
     _Request   = request;
 }
示例#10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CoreClientFactory"/> class.
 /// </summary>
 public CoreClientFactory(Reference <ILogger> loggerRef)
 {
     _loggerRef = loggerRef.Clone();
 }