public static void InitAppProperty(AppProperty appProperty) { _dnsZoneName = appProperty.AzureDnsZoneName.Trim(); _dnsResGroup = appProperty.AzureDnsResGroup.Trim(); _resourceName = appProperty.ResourceName.Trim(); _resourceResGroup = appProperty.ResourceResGroup.Trim(); _hostname = appProperty.Hostname.Trim(); _hostnameFriendly = appProperty.HostnameFriendly; _pfxFileName = appProperty.PfxFileName; if (appProperty.IsFunctionApp && appProperty.IsSlot) { _resourceType = ResourceType.FunctionAppSlot; _slotName = appProperty.SlotName.Trim(); } else if (appProperty.IsSlot) { _resourceType = ResourceType.WebAppSlot; _slotName = appProperty.SlotName.Trim(); } else if (appProperty.IsFunctionApp) { _resourceType = ResourceType.FunctionApp; } else { _resourceType = ResourceType.WebApp; } }
public ActionResult DeleteConfirmed(int id) { AppProperty appProperty = _appPropertyService.GetById((int)id); _appPropertyService.Delete(appProperty.ID); return(RedirectToAction("Index")); }
// Use this for initialization void Start() { appOfTrigger.appNum = 3; appOfTrigger.phoneState = true; //appOfTrigger.appList = new List<string>() {"痘印","bilibili","吃鸡" }; //SaveByJson(); //appOfTrigger= LoadJson(); //Debug.Log(appOfTrigger.appNum); //Debug.Log(appOfTrigger.phoneState); //foreach (var item in appOfTrigger.appList) //{ // Debug.Log(item); //} appOfTrigger.appList = new List <AppProperty>(); AppProperty appProperty = new AppProperty { appName = "douyin", triggerID = "trigger", triggerFavour = true, useTimeList = new List <int> { 6, 7, 8 } }; appOfTrigger.appList.Add(appProperty); //SaveByJson(); // appOfTrigger = LoadJson(); }
public static void InitAppProperty(AppProperty appProperty) { _hostname = appProperty.Hostname; _hostnameFriendly = appProperty.HostnameFriendly; _basedomain = appProperty.BaseDomain; _pfxFileName = appProperty.PfxFileName; _pemFileName = appProperty.PemFileName; }
public ActionResult Edit(AppProperty appProperty) { if (ModelState.IsValid) { _appPropertyService.Update(appProperty); return(RedirectToAction("Index")); } return(View(appProperty)); }
public static async Task Clear(AppProperty key) { Application myApp = Application.Current; bool check = myApp.Properties.ContainsKey(key.ToString()); if (check) { myApp.Properties.Remove(key.ToString()); await myApp.SavePropertiesAsync(); } }
public static async Task <T> GetValue <T>(AppProperty key) where T : struct { Application myApp = Application.Current; bool check = myApp.Properties.ContainsKey(key.ToString()); if (check) { var property = myApp.Properties[key.ToString()]; return((T)property); } return(default(T)); }
public static async Task <string> GetValue(AppProperty key) { Application myApp = Application.Current; bool check = myApp.Properties.ContainsKey(key.ToString()); if (check) { var property = myApp.Properties[key.ToString()]; return((string)property); } return(default(string)); }
public ActionResult Delete(int?id) { if (id == null) { return(StatusCode(StatusCodes.Status400BadRequest)); } AppProperty appProperty = _appPropertyService.GetById((int)id); if (appProperty == null) { return(StatusCode(StatusCodes.Status404NotFound)); } return(View(appProperty)); }
public override object ProvideValue(IServiceProvider serviceProvider) { if (Key == null) { return(null); } if (AppProperty.TryGet(Key, out var value)) { return(value); } return(null); }
public static async Task <bool> AddReplaceJsonToSecureStorage <T>(AppProperty key, T value) { bool check = await ContainsSecureStorageKey(key.ToString()); if (check) { RemoveValueFromSecureStorage(key.ToString()); } string json; json = JsonConvert.SerializeObject(value); return(await SetValueToSecureStorage(key.ToString(), json)); }
public static async Task AddReplaceValue <T>(AppProperty key, T value) where T : struct { Application myApp = Application.Current; bool check = myApp.Properties.ContainsKey(key.ToString()); if (check) { myApp.Properties.Remove(key.ToString()); } myApp.Properties.Add(key.ToString(), value); await myApp.SavePropertiesAsync(); }
public static async Task AddReplaceBinary <T>(AppProperty key, T value) where T : class { var bytes = SerialiserHelper.ToBytes(value); Application myApp = Application.Current; bool check = myApp.Properties.ContainsKey(key.ToString()); if (check) { myApp.Properties.Remove(key.ToString()); } myApp.Properties.Add(key.ToString(), bytes); await myApp.SavePropertiesAsync(); }
public static async Task AddReplaceJson <T>(AppProperty key, T value) { Application myApp = Application.Current; bool check = myApp.Properties.ContainsKey(key.ToString()); if (check) { myApp.Properties.Remove(key.ToString()); } string json; json = JsonConvert.SerializeObject(value); myApp.Properties.Add(key.ToString(), json); await myApp.SavePropertiesAsync(); }
public static T Get <T>(AppProperty key) { Application myApp = Application.Current; bool check = myApp.Properties.ContainsKey(key.ToString()); if (check) { var property = myApp.Properties[key.ToString()]; if (property is null) { Clear(key); return(default(T)); } return((T)property); } return(default(T)); }
public static async Task <T> GetBinary <T>(AppProperty key) where T : class { Application myApp = Application.Current; bool check = myApp.Properties.ContainsKey(key.ToString()); if (check) { var property = myApp.Properties[key.ToString()]; if (property is null) { await Clear(key); return(default(T)); } var result = SerialiserHelper.FromBytes <T>((byte[])property); return(result); } return(default(T)); }
public static async Task <T> GetJson <T>(AppProperty key) where T : class { Application myApp = Application.Current; bool check = myApp.Properties.ContainsKey(key.ToString()); if (check) { var property = myApp.Properties[key.ToString()] as string; if (string.IsNullOrEmpty(property)) { await Clear(key); return(default(T)); } var result = JsonConvert.DeserializeObject <T>(property); return(result); } return(default(T)); }
public static bool ContainsKey(AppProperty key) { Application myApp = Application.Current; return(myApp.Properties.ContainsKey(key.ToString())); }
//LogHelper loghelper = new LogHelper(); //ASDDataAccessLayer.DataAccess da = new ASDDataAccessLayer.DataAccess(); public void Execute(AppProperty app) { Console.Write("Test"); }
public async Task <T> Get <T>(AppProperty key) where T : class { return(await AppPropertyHelpers.GetJson <T>(key)); }
public async Task <string> GetValue(AppProperty key) { return(await AppPropertyHelpers.GetValue(key)); }
public async Task <T> GetValue <T>(AppProperty key) where T : struct { return(await AppPropertyHelpers.GetValue <T>(key)); }
public AppPropPanel_OnPropChangeArgs(AppProperty prop) { Prop = prop; }
public async Task Save <T>(AppProperty key, T value) where T : class { await AppPropertyHelpers.AddReplaceJson <T>(key, value); }
public async Task Clear(AppProperty key) { await AppPropertyHelpers.Clear(key); }
public void ApplicationType(AppProperty app) { throw new NotImplementedException(); }