예제 #1
0
 public static ToastSetting GetSharedSettings()
 {
     if (SharedSettings == null)
     {
         SharedSettings              = new ToastSetting();
         SharedSettings.gravity      = ToastGravity.Bottom;
         SharedSettings.duration     = 0x3e8;
         SharedSettings.fontSize     = 16f;
         SharedSettings.useShadow    = true;
         SharedSettings.cornerRadius = 5f;
         SharedSettings.bgRed        = 0;
         SharedSettings.bgGreen      = 0;
         SharedSettings.bgBlue       = 0;
         SharedSettings.bgAlpha      = 0.7f;
         SharedSettings.offsetLeft   = 0;
         SharedSettings.offsetTop    = 0;
         //SharedSettings.imageLocation = ToastImageLocation.Left;
         SharedSettings.images = new Dictionary <ToastType, UIImage>
         {
             [ToastType.Error]   = ResizeImage(UIImage.FromBundle("error.png"), 20, 20),
             [ToastType.Info]    = ResizeImage(UIImage.FromBundle("info.png"), 20, 20),
             [ToastType.Default] = null,
             [ToastType.Notice]  = ResizeImage(UIImage.FromBundle("notice.png"), 20, 20),
             [ToastType.Warning] = ResizeImage(UIImage.FromBundle("warning.png"), 20, 20)
         };
         return(SharedSettings);
     }
     return(SharedSettings);
 }
예제 #2
0
        public object Clone()
        {
            var setting = new ToastSetting {
                gravity      = this.gravity,
                duration     = this.duration,
                position     = this.position,
                fontSize     = this.fontSize,
                useShadow    = this.useShadow,
                cornerRadius = this.cornerRadius,
                bgRed        = this.bgRed,
                bgGreen      = this.bgGreen,
                bgBlue       = this.bgBlue,
                bgAlpha      = this.bgAlpha,
                offsetLeft   = this.offsetLeft,
                offsetTop    = this.offsetTop,
                //imageLocation = this.imageLocation,
                images = new Dictionary <ToastType, UIImage>()
            };

            foreach (KeyValuePair <ToastType, UIImage> pair in this.images)
            {
                setting.images[pair.Key] = pair.Value;
            }
            return(setting);
        }
예제 #3
0
 public void MakeNewSetting()
 {
     ToastSetting.MakeNewSetting();
 }
예제 #4
0
 public static void MakeNewSetting()
 {
     SharedSettings = null;
 }
예제 #5
0
 public ToastSetting theSettings() => ToastSetting.GetSharedSettings();