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;
            }
        }
Exemplo n.º 2
0
        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();
    }
Exemplo n.º 4
0
        public static void InitAppProperty(AppProperty appProperty)
        {
            _hostname         = appProperty.Hostname;
            _hostnameFriendly = appProperty.HostnameFriendly;
            _basedomain       = appProperty.BaseDomain;

            _pfxFileName = appProperty.PfxFileName;
            _pemFileName = appProperty.PemFileName;
        }
Exemplo n.º 5
0
 public ActionResult Edit(AppProperty appProperty)
 {
     if (ModelState.IsValid)
     {
         _appPropertyService.Update(appProperty);
         return(RedirectToAction("Index"));
     }
     return(View(appProperty));
 }
Exemplo n.º 6
0
        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();
            }
        }
Exemplo n.º 7
0
        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));
        }
Exemplo n.º 8
0
        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));
        }
Exemplo n.º 9
0
        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);
        }
Exemplo n.º 11
0
        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));
        }
Exemplo n.º 12
0
        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();
        }
Exemplo n.º 13
0
        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();
        }
Exemplo n.º 14
0
        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();
        }
Exemplo n.º 15
0
        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));
        }
Exemplo n.º 16
0
        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));
        }
Exemplo n.º 17
0
        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));
        }
Exemplo n.º 18
0
        public static bool ContainsKey(AppProperty key)
        {
            Application myApp = Application.Current;

            return(myApp.Properties.ContainsKey(key.ToString()));
        }
Exemplo n.º 19
0
        //LogHelper loghelper = new LogHelper();
        //ASDDataAccessLayer.DataAccess da = new ASDDataAccessLayer.DataAccess();


        public void Execute(AppProperty app)
        {
            Console.Write("Test");
        }
Exemplo n.º 20
0
 public async Task <T> Get <T>(AppProperty key) where T : class
 {
     return(await AppPropertyHelpers.GetJson <T>(key));
 }
Exemplo n.º 21
0
 public async Task <string> GetValue(AppProperty key)
 {
     return(await AppPropertyHelpers.GetValue(key));
 }
Exemplo n.º 22
0
 public async Task <T> GetValue <T>(AppProperty key) where T : struct
 {
     return(await AppPropertyHelpers.GetValue <T>(key));
 }
Exemplo n.º 23
0
 public AppPropPanel_OnPropChangeArgs(AppProperty prop)
 {
     Prop = prop;
 }
Exemplo n.º 24
0
 public async Task Save <T>(AppProperty key, T value) where T : class
 {
     await AppPropertyHelpers.AddReplaceJson <T>(key, value);
 }
Exemplo n.º 25
0
 public async Task Clear(AppProperty key)
 {
     await AppPropertyHelpers.Clear(key);
 }
Exemplo n.º 26
0
 public void ApplicationType(AppProperty app)
 {
     throw new NotImplementedException();
 }