| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using System.Collections.Generic;
- namespace Muchinfo.MTPClient.UI.Utilities
- {
- public class ChartManager
- {
- private static Dictionary<string, int> _customMinutes = new Dictionary<string, int>();
- /// <summary>
- /// Gets the current custom minute.
- /// </summary>
- /// <param name="windowKey">The window key.</param>
- /// <returns>System.Int32.</returns>
- public static int GetCurrentCustomMinute(string windowKey)
- {
- if (_customMinutes.ContainsKey(windowKey))
- {
- return _customMinutes[windowKey];
- }
- return 0;
- }
- /// <summary>
- /// Adds the custom minute.
- /// </summary>
- /// <param name="windowKey">The window key.</param>
- /// <param name="minute">The minute.</param>
- public static void AddOrUpdateCustomMinute(string windowKey, int minute)
- {
- if (_customMinutes.ContainsKey(windowKey))
- {
- _customMinutes[windowKey] = minute;
- }
- else
- {
- _customMinutes.Add(windowKey, minute);
- }
- }
- /// <summary>
- /// Removes the custom minute.
- /// </summary>
- /// <param name="windowKey">The window key.</param>
- public static void RemoveCustomMinute(string windowKey)
- {
- if (_customMinutes.ContainsKey(windowKey))
- {
- _customMinutes.Remove(windowKey);
- }
- }
- /// <summary>
- /// Gets the active view custom minute.
- /// </summary>
- /// <returns>System.Int32.</returns>
- public static int GetActiveViewCustomMinute()
- {
- return 0;
- //var activeChartView = WindowHelper.GetWindow(WindowType.QuoteChartView);
- //if (activeChartView == null) return 1;
- //var key = activeChartView.WindowItem.WindowKey;
- //return GetCurrentCustomMinute(key);
- }
- }
- }
|