public bool Remove(string key) { return(Comparisons.Remove(key)); }
public bool TryGetValue(string key, out Time value) { return(Comparisons.TryGetValue(key, out value)); }
void _copyViewer_OnSynchronizePlusAction(EventArgs e) { Administrator.Reset(); _copyViewer.EnableControls(false); _overallProgress = new ProgressLink(); _copyViewer.OverallProgress = _overallProgress; _currentActivityProgress = new ProgressLink(); _copyViewer.CurrentActivityProgress = _currentActivityProgress; //Validate all fields. int errorCount = ValidateFields(); if (errorCount > 0) { return; } //Save Parameters. _profileManager.UserSettings.Select(_currentKey); _profileManager.Interrupt.Reason = "OK"; SaveParameters(); RefreshCombo(); //Use directory engine to scan both directories to determine the differences. DateTime startAllDateTime = Administrator.Now; _directoryEngine = new DirectoryEngine(); _directoryEngine.Interrupt = _profileManager.Interrupt; _directoryEngine.EventBeginProgress += new Copy8.EventDelegate(_directoryEngine_OnBeginDirectoryScan); _directoryEngine.EventUpdateProgress += new Copy8.EventDelegate(_directoryEngine_OnUpdateDirectoryScan); _directoryEngine.EventEndOfProgress += new Copy8.EventDelegate(_directoryEngine_OnEndOfDirectoryScan); _directoryEngine.MonitoredTypesOnly = _profileManager.UserSettings.SelectedItem.MonitoredTypesOnly; _directoryEngine.Interrupt = _profileManager.Interrupt; _processingNew = true; _NewDirectoryListing = _directoryEngine.DirList(_profileManager.UserSettings.SelectedItem.NewBaseDir, ref mnNewFilesEstimate); _TotalBytes = mnNewFilesEstimate; //Delete log files older that the specified number of days. DeleteOldLogFiles(); _processingNew = false; string targetDirectory = _profileManager.UserSettings.SelectedItem.OldBaseDir; if (!Directory.Exists(targetDirectory)) { Directory.CreateDirectory(targetDirectory); } _directoryEngine.TargetHlq = targetDirectory; mnOldFilesEstimate = mnNewFilesEstimate; // Instead of scanning the target directory. // Load the previously synchronized snapshot to compare against. if (File.Exists(getSnapshotFileSpec(targetDirectory))) { _OldDirectoryListing = new DirectoryEntries(); _OldDirectoryListing.Load(getSnapshotFileSpec(targetDirectory), DirectoryEntries.InterpretationEnum.Target); } else { _OldDirectoryListing = _directoryEngine.DirList(targetDirectory, ref mnOldFilesEstimate); } _directoryEngine.Compare(ref _OldDirectoryListing, ref _NewDirectoryListing); _directoryEngine.Changes(_OldDirectoryListing, _NewDirectoryListing, ref _ChangedDirectoryListing, ref mnChgFilesEstimate); _comparisons = _directoryEngine.Comparisons; _copyEngine.Interrupt = _profileManager.Interrupt; //Use the Synchronize engine to perform the synchronize. //TODO: Move the directory engine calls inside the Synchronize engine. _synchronizeEngine = new SynchronizeEngine(); _synchronizeEngine.OnBeginSynchronize += new SynchronizeEngine.BeginSynchronizeHandler(_SynchronizeEngine_OnBeginSynchronize); _synchronizeEngine.OnUpdateSynchronize += new SynchronizeEngine.UpdateSynchronizeHandler(_SynchronizeEngine_OnUpdateSynchronize); _synchronizeEngine.OnEndOfSynchronize += new SynchronizeEngine.EndOfSynchronizeHandler(_SynchronizeEngine_OnEndOfSynchronize); _synchronizeEngine.CopyRule = _profileManager.UserSettings.SelectedItem.CopyRule; _synchronizeEngine.MonitoredTypesOnly = _profileManager.UserSettings.SelectedItem.MonitoredTypesOnly; _synchronizeEngine.Interrupt = _profileManager.Interrupt; try { _synchronizeEngine.Process(_comparisons, startAllDateTime); //After synchronization the target directory is synchronized with the source directory. _NewDirectoryListing.Save(getSnapshotFileSpec(targetDirectory)); Administrator.View(); } catch (ParameterException pe) { _copyViewer.SetFieldError(pe.Parameter, pe.Message); //_copyViewer.DisplayMessageBox(ae.Message, _copyViewer.Caption, MsgButtons.OK, MsgIcon.Error); } finally { _copyViewer.EnableControls(true); } }
public IEnumerator <KeyValuePair <string, Time> > GetEnumerator() { return(Comparisons.GetEnumerator()); }
public bool Remove(KeyValuePair <string, Time> item) { return(Comparisons.Remove(item)); }
protected abstract string GetComprisonString(Comparisons comparison, string[] names);
public override double payoff(double S1, double S2) { return(Comparisons.Max(w * ((I1 / S1) - (I2 / S2)) - w * K, 0.0)); }
public bool Contains(KeyValuePair <string, Time> item) { return(Comparisons.Contains(item)); }
public override double payoff(double S1, double S2) { double sum = a * S1 + b * S2; return(Comparisons.Max(w * (sum - K), 0.0)); }
public override double payoff(double S1, double S2) { return(Comparisons.Max(w1 * (S1 - K1), w2 * (S2 - K2), 0.0)); }
public override double payoff(double S1, double S2) { return(fer * Comparisons.Max(w * S1 - w * Kf, 0.0)); }
/// <summary> /// Equal to /// </summary> /// <param name="property">property as Property, enum or string</param> /// <param name="value">Value to compare</param> /// <param name="comparison">Comparisons to specify how to compare</param> /// <returns>Query</returns> public Query Where(Property property, Value value, Comparisons comparison) { var propertyEqual = new PropertyComparison(property, value, comparison, this); _elements.Add(propertyEqual); return this; }
/// <summary> /// Sorts the specified list using an insertion sort algorithm and the specified comparer. /// </summary> /// <remarks> /// Insertion sort is a O(n²) time complexity algorithm and should not be used on arbitrary lists. /// However, it has a best case time complexity of O(n) for lists that are already sorted and is quite fast when used on nearly sorted input. /// </remarks> public static void InsertionSort <T>(this IList <T> ts, IComparer <T> comparer) { InsertionSort(ts, Comparisons <T> .ToComparison(comparer)); }
public void Add(KeyValuePair <string, Time> item) { Comparisons.Add(item); }
public override double payoff(double S1, double S2) { double max = Comparisons.Max(S1, S2); return(Comparisons.Max(w * (max - K), 0.0)); }
public void Clear() { Comparisons.Clear(); }
public override double payoff(double S1, double S2) { double min = Comparisons.Min(S1, S2); return(Comparisons.Max(w * (n1 * S1 + n2 * S2 - K), 0.0)); }
public void CopyTo(KeyValuePair <string, Time>[] array, int arrayIndex) { Comparisons.CopyTo(array, arrayIndex); }
public override double payoff(double S1, double S2) { return(Comparisons.Max(S1 - S2, 0.0)); // a1S1 - a2S2 in general }
public bool CanHandle(Comparisons comparison, Member member) { return(member.Type == typeof(string)); }
protected abstract string GenerateFilterConditionFor(Comparisons comparison, T value);
internal PropertyComparison(Property property, Value value = null, Comparisons comparison = Comparisons.EqualTo, Query parent = null) : base(parent) { Comparison = comparison; Property = property; Value = value; }