Пример #1
0
 public StickySuperMacroAction(SDConnection connection, InitialPayload payload) : base(connection, payload)
 {
     if (payload.Settings == null || payload.Settings.Count == 0)
     {
         Settings = StickyMacroSettings.CreateDefaultSettings();
         Connection.SetSettingsAsync(JObject.FromObject(Settings));
     }
     else
     {
         Settings = payload.Settings.ToObject <StickyMacroSettings>();
         HandleFilenames();
     }
     LoadMacros();
     InitializeSettings();
 }
        public static StickyMacroSettings CreateDefaultSettings()
        {
            StickyMacroSettings instance = new StickyMacroSettings
            {
                InputText = String.Empty,
                Delay = 10,
                EnterMode = false,
                ForcedMacro = false,
                KeydownDelay = false,
                IgnoreNewline = false,
                EnabledImageFilename = string.Empty,
                DisabledImageFilename = string.Empty,
                LoadFromFiles = false,
                PrimaryInputFile = String.Empty,
                RunUntilEnd = false,
                AutoStopNum = DEFAULT_AUTO_STOP_NUM.ToString()
            };

            return instance;
        }