Exemplo n.º 1
0
        public override void OnEnable()
        {
            I18n.Instance.ApplyLanguage(new Language());

            srcBili   = new BiliBili();
            srcTwitch = new Twitch();

            base.EventBus.BindEvent <InitCommandEvent>(evt => new BaseCommand(evt.Commands));
            base.EventBus.BindEvent <InitSourceEvent>(evt => {
                evt.Sources.AddSource(srcBili);
                evt.Sources.AddSource(srcTwitch);
            });

            fltFormat     = new DefaultFormat();
            fltGift       = new GiftReceivePeeker();
            fltOnline     = new OnlineChangePeeker();
            fltDeadunlock = new MessageDeadLoopLimiter();

            base.EventBus.BindEvent <InitFilterEvent>(evt => evt.Filters.AddFilters(fltFormat, fltGift, fltOnline, fltDeadunlock));

            base.EventBus.BindEvent <LoadCompleteEvent>(DefaultPlugin_onLoadComplete);

            clientOSU = new DirectOSUIRCBot();

            base.EventBus.BindEvent <InitClientEvent>(evt => {
                evt.Clients.AddAllClient(clientOSU);
#if (DEBUG)
                evt.Clients.AddClient(new ConsoleReciveSendOnlyClient());
#endif
            });

            IO.CurrentIO.WriteColor("Default Plugin by Deliay", ConsoleColor.DarkCyan);
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUp()
        public virtual void SetUp()
        {
            JsonFormat       inner     = new JsonFormat();
            List <MediaType> supported = new List <MediaType>();
            MediaType        requested = MediaType.APPLICATION_JSON_TYPE;

            _input = new DefaultFormat(inner, supported, requested);
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public java.util.Map<String, Object> readMap(final String input, String... requiredKeys) throws org.neo4j.server.rest.repr.BadInputException
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
        public override IDictionary <string, object> ReadMap(string input, params string[] requiredKeys)
        {
            Dictionary <string, object> result = new Dictionary <string, object>();

            if (input.Length == 0)
            {
                return(result);
            }

            foreach (string pair in input.Split("&", true))
            {
                string[] fields = pair.Split("=", true);
                string   key;
                string   value;

                try
                {
                    string charset = StandardCharsets.UTF_8.name();
                    key   = EnsureThatKeyDoesNotHavePhPStyleParenthesesAtTheEnd(URLDecoder.decode(fields[0], charset));
                    value = URLDecoder.decode(fields[1], charset);
                }
                catch (UnsupportedEncodingException e)
                {
                    throw new BadInputException(e);
                }

                object old = result[key];
                if (old == null)
                {
                    result[key] = value;
                }
                else
                {
                    IList <object> list;
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: if (old instanceof java.util.List<?>)
                    if (old is IList <object> )
                    {
                        list = (IList <object>)old;
                    }
                    else
                    {
                        list        = new List <object>();
                        result[key] = list;
                        list.Add(old);
                    }
                    list.Add(value);
                }
            }

            return(DefaultFormat.validateKeys(result, requiredKeys));
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public java.util.Map<String, Object> readMap(String input, String... requiredKeys) throws org.neo4j.server.rest.repr.BadInputException
        public override IDictionary <string, object> ReadMap(string input, params string[] requiredKeys)
        {
            if (Empty(input))
            {
                return(DefaultFormat.validateKeys(Collections.emptyMap(), requiredKeys));
            }
            try
            {
                return(DefaultFormat.validateKeys(JsonHelper.jsonToMap(StripByteOrderMark(input)), requiredKeys));
            }
            catch (Exception ex)
            {
                throw new BadInputException(ex);
            }
        }
		/// <summary>
		/// Builds var formatter
		/// </summary>
		/// <param name="format"></param>
		/// <param name="parameters"></param>
		/// <returns></returns>
		public static IVarFormatter Build( DefaultFormat format, string parameters ){
			
			switch(  format ){
				case DefaultFormat.Text:
					return new TextVarFormatter(parameters);
				case DefaultFormat.Boolean:
					return new BooleanVarFormatter(parameters);
				case DefaultFormat.Custom:
					return new CustomVarFormatter( parameters );
				case DefaultFormat.DateTime:
					return new DateTimeVarFormatter(parameters);
				case DefaultFormat.Number:
					return new NumberVarFormatter(parameters);
				default:
					return new TextVarFormatter(parameters);
			}
		}
        /// <summary>
        /// Builds var formatter
        /// </summary>
        /// <param name="format"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public static IVarFormatter Build(DefaultFormat format, string parameters)
        {
            switch (format)
            {
            case DefaultFormat.Text:
                return(new TextVarFormatter(parameters));

            case DefaultFormat.Boolean:
                return(new BooleanVarFormatter(parameters));

            case DefaultFormat.Custom:
                return(new CustomVarFormatter(parameters));

            case DefaultFormat.DateTime:
                return(new DateTimeVarFormatter(parameters));

            case DefaultFormat.Number:
                return(new NumberVarFormatter(parameters));

            default:
                return(new TextVarFormatter(parameters));
            }
        }
		/// <summary>
		/// Builds var formatter
		/// </summary>
		/// <param name="format"></param>
		/// <returns></returns>
		public static IVarFormatter Build( DefaultFormat format ){
			return Build( format, null);
		}
 public virtual GraphicsFormat GetGraphicsFormat(DefaultFormat format)
 {
     return(EditorSystemInfo.GetGraphicsFormat(format));
 }
Exemplo n.º 9
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="format"></param>
		/// <param name="aditionalParameters"></param>
		protected BasicVarFormatter( DefaultFormat format, string aditionalParameters)	{
			_format = format;
			this._formatterParameters = aditionalParameters;
		}
Exemplo n.º 10
0
 public Texture2DArray(int width, int height, int depth, DefaultFormat format, TextureCreationFlags flags) : this(width, height, depth, SystemInfo.GetGraphicsFormat(format), flags)
 {
 }
Exemplo n.º 11
0
 extern public static GraphicsFormat GetGraphicsFormat(DefaultFormat format);
Exemplo n.º 12
0
 [FreeFunction]                                                                                         // 0x0000000180104A80-0x0000000180104AB0
 public static GraphicsFormat GetGraphicsFormat(DefaultFormat format) => default;                       // 0x00000001808DF280-0x00000001808DF2C0
Exemplo n.º 13
0
 /// <summary>
 /// Create custom formatable var.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="format"></param>
 /// <param name="formatParameters"></param>
 public FormatableVariable(string name, DefaultFormat format, string formatParameters) : base(name)
 {
     _formatter = GetFormatter(format, formatParameters);
 }
Exemplo n.º 14
0
 public CustomRenderTexture(int width, int height, DefaultFormat defaultFormat)
     : this(width, height, SystemInfo.GetGraphicsFormat(defaultFormat))
 {
 }
Exemplo n.º 15
0
		/// <summary>
		/// Create custom formatable var.
		/// </summary>
		/// <param name="name"></param>
		/// <param name="format"></param>
		/// <param name="formatParameters"></param>
		public FormatableVariable( string name, DefaultFormat format, string formatParameters):base( name )
		{			
			_formatter = GetFormatter( format, formatParameters );
		}
Exemplo n.º 16
0
 /// <summary>
 /// Get formatter by enum.
 /// </summary>
 /// <param name="format"></param>
 /// <param name="parameters"></param>
 /// <returns></returns>
 protected IVarFormatter GetFormatter(DefaultFormat format, string parameters)
 {
     return(VarFormatterFactory.Build(format, parameters));
 }
Exemplo n.º 17
0
		/// <summary>
		/// Get formatter by enum.
		/// </summary>
		/// <param name="format"></param>
		/// <param name="parameters"></param>
		/// <returns></returns>
		protected IVarFormatter GetFormatter( DefaultFormat format, string parameters ){
			return VarFormatterFactory.Build(format, parameters);
		}
Exemplo n.º 18
0
		/// <summary>
		/// Create custom formatable var.
		/// </summary>
		/// <param name="name"></param>
		/// <param name="optional"></param>
		/// <param name="format"></param>
		/// <param name="formatParameters"></param>
		public FormatableVariable( string name, bool optional, DefaultFormat format, string formatParameters):base( name, optional )
		{			
			_formatter = GetFormatter( format, formatParameters );
		}
Exemplo n.º 19
0
        //----------------------------------------------------------
        private bool OnKeyTab(bool bEnAvant)
        {
            List <CValeurUnite> valeurs = CValeurUnite.DecomposeChaineFormattée(Text);

            int           nIndexDansFormat = 0;
            int           nSel             = SelectionStart;
            StringBuilder bl        = new StringBuilder();
            List <int>    nStartPos = new List <int>();

            foreach (CValeurUnite valeur in valeurs)
            {
                nStartPos.Add(bl.Length);
                bl.Append(valeur.ToString());
            }

            int nLastUnite = -1;

            List <string> strFormatsDef = new List <string>();

            strFormatsDef.AddRange(DefaultFormat.Split(' '));

            //Navigation dedans
            for (int nIndex = 0; nIndex < valeurs.Count; nIndex++)
            {
                string strTmp = valeurs[nIndex].ToString();

                int nTmp = strFormatsDef.IndexOf(valeurs[nIndex].Unite);
                if (nTmp > nLastUnite)
                {
                    nLastUnite = nTmp;
                }

                if (nSel < strTmp.Length + nIndexDansFormat)
                {
                    Text = bl.ToString();
                    if (bEnAvant)
                    {
                        SelectionStart = nIndexDansFormat + strTmp.Length;
                        if (nIndex < valeurs.Count - 1)
                        {
                            SelectionLength = valeurs[nIndex + 1].Valeur.ToString().Length;
                        }
                        return(true);
                    }
                    else
                    {
                        if (nIndex == 0)
                        {
                            return(false);
                        }
                        SelectionStart  = nStartPos[nIndex - 1];
                        SelectionLength = valeurs[nIndex - 1].Valeur.ToString().Length;
                        return(true);
                    }
                }
                nIndexDansFormat += strTmp.Length;
            }
            if (bEnAvant)
            {
                if (nLastUnite + 1 < strFormatsDef.Count() && valeurs.Count > 0 && valeurs[valeurs.Count - 1].Unite.Trim() == "")
                {
                    Text           += strFormatsDef[nLastUnite + 1];
                    SelectionStart  = Text.Length;
                    SelectionLength = 0;
                    return(true);
                }
            }



            return(false);
        }
Exemplo n.º 20
0
 public SparseTexture(int width, int height, DefaultFormat format, int mipCount)
     : this(width, height, SystemInfo.GetGraphicsFormat(format), mipCount)
 {
 }
Exemplo n.º 21
0
 /// <summary>
 /// Create custom formatable var.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="optional"></param>
 /// <param name="format"></param>
 /// <param name="formatParameters"></param>
 public FormatableVariable(string name, bool optional, DefaultFormat format, string formatParameters) : base(name, optional)
 {
     _formatter = GetFormatter(format, formatParameters);
 }
Exemplo n.º 22
0
 public RenderTexture(int width, int height, int depth, DefaultFormat format)
     : this(width, height, depth, SystemInfo.GetGraphicsFormat(format))
 {
 }
Exemplo n.º 23
0
        }                                  // Dummy constructor

        public Texture2DArray(int width, int height, int depth, DefaultFormat format, TextureCreationFlags flags)
        {
        }                              // 0x00000001808DF900-0x00000001808DFA70
Exemplo n.º 24
0
 public Cubemap(int width, DefaultFormat format, TextureCreationFlags flags)
     : this(width, SystemInfo.GetGraphicsFormat(format), flags)
 {
 }
Exemplo n.º 25
0
 public virtual GraphicsFormat GetGraphicsFormat(DefaultFormat format)
 {
     return(UnityEngine.SystemInfo.GetGraphicsFormat(format));
 }
Exemplo n.º 26
0
 public static GraphicsFormat GetGraphicsFormat(DefaultFormat format)
 {
     return(ShimManager.SystemInfoShim.GetGraphicsFormat(format));
 }
Exemplo n.º 27
0
 /// <summary>
 /// Builds var formatter
 /// </summary>
 /// <param name="format"></param>
 /// <returns></returns>
 public static IVarFormatter Build(DefaultFormat format)
 {
     return(Build(format, null));
 }
Exemplo n.º 28
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="format"></param>
		protected BasicVarFormatter( DefaultFormat format)	{
			_format = format;
		}
Exemplo n.º 29
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="format"></param>
 /// <param name="aditionalParameters"></param>
 protected BasicVarFormatter(DefaultFormat format, string aditionalParameters)
 {
     _format = format;
     this._formatterParameters = aditionalParameters;
 }
Exemplo n.º 30
0
        }                                // Dummy constructor

        public CubemapArray(int width, int cubemapCount, DefaultFormat format, TextureCreationFlags flags)
        {
        }                              // 0x0000000180965F30-0x0000000180966040
Exemplo n.º 31
0
        }                           // Dummy constructor

        public Cubemap(int width, DefaultFormat format, TextureCreationFlags flags)
        {
        }                              // 0x00000001809663B0-0x00000001809664A0
Exemplo n.º 32
0
        }                             // Dummy constructor

        public Texture3D(int width, int height, int depth, DefaultFormat format, TextureCreationFlags flags)
        {
        }                              // 0x00000001808E1A40-0x00000001808E1BB0
Exemplo n.º 33
0
 public CubemapArray(int width, int cubemapCount, DefaultFormat format, TextureCreationFlags flags)
     : this(width, cubemapCount, SystemInfo.GetGraphicsFormat(format), flags)
 {
 }
Exemplo n.º 34
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="format"></param>
 protected BasicVarFormatter(DefaultFormat format)
 {
     _format = format;
 }
Exemplo n.º 35
0
 public override GraphicsFormat GetGraphicsFormat(DefaultFormat format)
 {
     return(base.GetGraphicsFormat(format));
 }