Пример #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);
        }
Пример #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);
        }
Пример #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));
        }
Пример #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));
 }
Пример #9
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="format"></param>
		/// <param name="aditionalParameters"></param>
		protected BasicVarFormatter( DefaultFormat format, string aditionalParameters)	{
			_format = format;
			this._formatterParameters = aditionalParameters;
		}
Пример #10
0
 public Texture2DArray(int width, int height, int depth, DefaultFormat format, TextureCreationFlags flags) : this(width, height, depth, SystemInfo.GetGraphicsFormat(format), flags)
 {
 }
Пример #11
0
 extern public static GraphicsFormat GetGraphicsFormat(DefaultFormat format);
Пример #12
0
 [FreeFunction]                                                                                         // 0x0000000180104A80-0x0000000180104AB0
 public static GraphicsFormat GetGraphicsFormat(DefaultFormat format) => default;                       // 0x00000001808DF280-0x00000001808DF2C0
Пример #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);
 }
Пример #14
0
 public CustomRenderTexture(int width, int height, DefaultFormat defaultFormat)
     : this(width, height, SystemInfo.GetGraphicsFormat(defaultFormat))
 {
 }
Пример #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 );
		}
Пример #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));
 }
Пример #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);
		}
Пример #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 );
		}
Пример #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);
        }
Пример #20
0
 public SparseTexture(int width, int height, DefaultFormat format, int mipCount)
     : this(width, height, SystemInfo.GetGraphicsFormat(format), mipCount)
 {
 }
Пример #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);
 }
Пример #22
0
 public RenderTexture(int width, int height, int depth, DefaultFormat format)
     : this(width, height, depth, SystemInfo.GetGraphicsFormat(format))
 {
 }
Пример #23
0
        }                                  // Dummy constructor

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

        public CubemapArray(int width, int cubemapCount, DefaultFormat format, TextureCreationFlags flags)
        {
        }                              // 0x0000000180965F30-0x0000000180966040
Пример #31
0
        }                           // Dummy constructor

        public Cubemap(int width, DefaultFormat format, TextureCreationFlags flags)
        {
        }                              // 0x00000001809663B0-0x00000001809664A0
Пример #32
0
        }                             // Dummy constructor

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