Exemplo n.º 1
0
        private T GetObjectFromFileFromUser <T>(string title, string extension) where T : TurboUnitObject
        {
            string filePath = GetFileFromUser(title, "*." + extension + "|*." + extension);

            if (filePath == null)
            {
                return(null);
            }
            else
            {
                return(TurboUnitObject.Load <T>(filePath));
            }
        }
Exemplo n.º 2
0
        private TurboUnitConfig LoadOrCreateConfig()
        {
            TurboUnitConfig config;
            string          directory      = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            string          configFilePath = Path.Combine(directory, "TurboUnitSettings.json");

            if (File.Exists(configFilePath))
            {
                config = TurboUnitObject.Load <TurboUnitConfig>(configFilePath);
            }
            else
            {
                config = new TurboUnitConfig()
                {
                    ConfigFilePath = configFilePath,
                    IsFirstRun     = true
                };
                config.Save(configFilePath);
            }
            return(config);
        }
 public static AssemblyFilterPreset Load(string filePath)
 {
     return(TurboUnitObject.Load <AssemblyFilterPreset>(filePath));
 }
Exemplo n.º 4
0
 public static TurboUnitConfig Load(string filePath)
 {
     return(TurboUnitObject.Load <TurboUnitConfig>(filePath));
 }