public static Cycle GetSample(int type, float srcWidth, float srcHeight, float width, float height, float offset, int padding) { Cycle cycle = new Cycle(); float s = 1; if (srcWidth > srcHeight) { s = MathUtils.Max(srcWidth / width, srcHeight / height); } else { s = MathUtils.Min(srcWidth / width, srcHeight / height); } float scale = s; switch (type) { case 0: cycle = new Anonymous_C1(scale); cycle.SetLineWidth(5); cycle.SetDelay(45); cycle.SetColor(0xFF2E82); cycle.SetStepType(4); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.05f); cycle.AddPath(Cycle.ARC, 50, 50, 40, 0, 360); break; case 1: cycle.SetColor(0xFF7B24); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.10f); cycle.SetMultiplier(2); cycle.AddPath(Cycle.ARC, 10 * scale, 10 * scale, 10 * scale, -270, -90); cycle.AddPath(Cycle.BEZIER, 10 * scale, 0 * scale, 40 * scale, 20 * scale, 20 * scale, 0, 30 * scale, 20 * scale); cycle.AddPath(Cycle.ARC, 40 * scale, 10 * scale, 10 * scale, 90, -90); cycle.AddPath(Cycle.BEZIER, 40 * scale, 0 * scale, 10 * scale, 20 * scale, 30 * scale, 0, 20 * scale, 20 * scale); break; case 2: cycle.SetColor(0xD4FF00); cycle.SetStepType(1); cycle.SetDelay(55); cycle.SetStepsPerFrame(2); cycle.SetTrailLength(0.3f); cycle.SetPointDistance(0.1f); cycle.AddPath(Cycle.LINE, 0, 0, 30 * scale, 0); cycle.AddPath(Cycle.LINE, 30 * scale, 0 * scale, 30 * scale, 30 * scale); cycle.AddPath(Cycle.LINE, 30 * scale, 30 * scale, 0, 30 * scale); cycle.AddPath(Cycle.LINE, 0, 30 * scale, 0, 0); break; case 3: cycle = new Anonymous_C0(scale); cycle.SetColor(0x05E2FF); cycle.SetLineWidth(2); cycle.SetStepType(4); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.025f); cycle.AddPath(Cycle.ARC, 50, 50, 40, 0, 360); break; case 4: cycle.SetColor(0xFFA50000); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.025f); cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 40 * scale, 0, 360); break; case 5: cycle.SetColor(0xFF2E82); cycle.SetDelay(60); cycle.SetStepType(1); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.1f); cycle.AddPath(Cycle.LINE, 0, 20 * scale, 100 * scale, 20 * scale); cycle.AddPath(Cycle.LINE, 100 * scale, 20 * scale, 0, 20 * scale); break; case 6: cycle.SetStepsPerFrame(7); cycle.SetTrailLength(0.7f); cycle.SetPointDistance(0.01f); cycle.SetDelay(35); cycle.SetLineWidth(10); cycle.AddPath(Cycle.LINE, 20 * scale, 70 * scale, 50 * scale, 20 * scale); cycle.AddPath(Cycle.LINE, 50 * scale, 20 * scale, 80 * scale, 70 * scale); cycle.AddPath(Cycle.LINE, 80 * scale, 70 * scale, 20 * scale, 70 * scale); break; case 7: cycle.SetColor(0xD4FF00); cycle.SetStepsPerFrame(3); cycle.SetTrailLength(1); cycle.SetPointDistance(0.01f); cycle.SetLineWidth(6); cycle.SetPadding(0); cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 20 * scale, 360, 0); break; case 8: cycle.SetColor(0x05E2FF); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.02f); cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 30 * scale, 0, 360); break; case 9: cycle.SetStepType(1); cycle.SetColor(LColor.yellow); cycle.AddPath(Cycle.LINE, 10 * scale, 10 * scale, 90 * scale, 10 * scale); cycle.AddPath(Cycle.LINE, 90 * scale, 10 * scale, 90 * scale, 90 * scale); cycle.AddPath(Cycle.LINE, 90 * scale, 90 * scale, 10 * scale, 90 * scale); cycle.AddPath(Cycle.LINE, 10 * scale, 90 * scale, 10 * scale, 10 * scale); break; } float size = MathUtils.Min(srcWidth / (1 / cycle.GetPointDistance()), srcHeight / (1 / cycle.GetPointDistance())); cycle.SetPadding(padding); cycle.SetBlockWidth(size + offset); cycle.SetBlockHeight(size + offset); cycle.SetWidth(width * scale); cycle.SetHeight(height * scale); return(cycle); }
private static ResourceBundle HandleGetBundle(String bs, String locale_0, bool loadBase, Assembly loader_1) { ResourceBundle bundle = null; String bundleName = bs + locale_0; Object cacheKey = (loader_1 != null) ? (Object)loader_1 : (Object)"null"; //$NON-NLS-1$ Dictionary <String, ResourceBundle> loaderCache; lock (cache) { loaderCache = ((System.Collections.Generic.Dictionary <System.String, ResourceBundle>)ILOG.J2CsMapping.Collections.Generics.Collections.Get(cache, cacheKey)); if (loaderCache == null) { loaderCache = new Dictionary <String, ResourceBundle>(); cache[cacheKey] = loaderCache; //ILOG.J2CsMapping.Collections.Generics.Collections.Put(cache, (System.Object)(cacheKey), (System.Collections.Generic.Dictionary<System.String, ResourceBundle>)(loaderCache)); } } ResourceBundle result = (ResourceBundle)ILOG.J2CsMapping.Collections.Generics.Collections.Get(loaderCache, bundleName); if (result != null) { if (result == MISSINGBASE) { return(null); } if (result == MISSING) { if (!loadBase) { return(null); } String extension = Strip(locale_0); if (extension == null) { return(null); } return(HandleGetBundle(bs, extension, loadBase, loader_1)); } return(result); } try { Type bundleClass = ILOG.J2CsMapping.Reflect.Helper.GetNativeType(bundleName); if (typeof(ResourceBundle).IsAssignableFrom(bundleClass)) { bundle = (ResourceBundle)Activator.CreateInstance(bundleClass); } } catch (Exception e) { } if (bundle != null) { //bundle.SetLocale(locale_0); } else { String fileName_3 = bundleName.Replace('.', '/'); Stream stream = new Anonymous_C0(loader_1, fileName_3).Run(); if (stream != null) { try { try { //bundle = new PropertyResourceBundle(stream); } finally { stream.Close(); } //bundle.SetLocale(locale_0); } catch (IOException e_4) { } } } String extension_5 = Strip(locale_0); if (bundle != null) { if (extension_5 != null) { ResourceBundle parent_6 = HandleGetBundle(bs, extension_5, true, loader_1); if (parent_6 != null) { // bundle.SetParent(parent_6); } } ILOG.J2CsMapping.Collections.Generics.Collections.Put(loaderCache, (System.String)(bundleName), (ResourceBundle)(bundle)); return(bundle); } if (extension_5 != null && (loadBase || extension_5.Length > 0)) { bundle = HandleGetBundle(bs, extension_5, loadBase, loader_1); if (bundle != null) { ILOG.J2CsMapping.Collections.Generics.Collections.Put(loaderCache, (System.String)(bundleName), (ResourceBundle)(bundle)); return(bundle); } } ILOG.J2CsMapping.Collections.Generics.Collections.Put(loaderCache, (System.String)(bundleName), (ResourceBundle)((loadBase) ? MISSINGBASE : MISSING)); return(null); }
public static Cycle GetSample(int type, float srcWidth, float srcHeight, float width, float height, float offset, int padding) { Cycle cycle = new Cycle(); float s = 1; if (srcWidth > srcHeight) { s = MathUtils.Max(srcWidth / width, srcHeight / height); } else { s = MathUtils.Min(srcWidth / width, srcHeight / height); } float scale = s; switch (type) { case 0: cycle = new Anonymous_C1(scale); cycle.SetLineWidth(5); cycle.SetDelay(45); cycle.SetColor(0xFF2E82); cycle.SetStepType(4); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.05f); cycle.AddPath(Cycle.ARC, 50, 50, 40, 0, 360); break; case 1: cycle.SetColor(0xFF7B24); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.10f); cycle.SetMultiplier(2); cycle.AddPath(Cycle.ARC, 10 * scale, 10 * scale, 10 * scale, -270, -90); cycle.AddPath(Cycle.BEZIER, 10 * scale, 0 * scale, 40 * scale, 20 * scale, 20 * scale, 0, 30 * scale, 20 * scale); cycle.AddPath(Cycle.ARC, 40 * scale, 10 * scale, 10 * scale, 90, -90); cycle.AddPath(Cycle.BEZIER, 40 * scale, 0 * scale, 10 * scale, 20 * scale, 30 * scale, 0, 20 * scale, 20 * scale); break; case 2: cycle.SetColor(0xD4FF00); cycle.SetStepType(1); cycle.SetDelay(55); cycle.SetStepsPerFrame(2); cycle.SetTrailLength(0.3f); cycle.SetPointDistance(0.1f); cycle.AddPath(Cycle.LINE, 0, 0, 30 * scale, 0); cycle.AddPath(Cycle.LINE, 30 * scale, 0 * scale, 30 * scale, 30 * scale); cycle.AddPath(Cycle.LINE, 30 * scale, 30 * scale, 0, 30 * scale); cycle.AddPath(Cycle.LINE, 0, 30 * scale, 0, 0); break; case 3: cycle = new Anonymous_C0(scale); cycle.SetColor(0x05E2FF); cycle.SetLineWidth(2); cycle.SetStepType(4); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.025f); cycle.AddPath(Cycle.ARC, 50, 50, 40, 0, 360); break; case 4: cycle.SetColor(0xFFA50000); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.025f); cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 40 * scale, 0, 360); break; case 5: cycle.SetColor(0xFF2E82); cycle.SetDelay(60); cycle.SetStepType(1); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.1f); cycle.AddPath(Cycle.LINE, 0, 20 * scale, 100 * scale, 20 * scale); cycle.AddPath(Cycle.LINE, 100 * scale, 20 * scale, 0, 20 * scale); break; case 6: cycle.SetStepsPerFrame(7); cycle.SetTrailLength(0.7f); cycle.SetPointDistance(0.01f); cycle.SetDelay(35); cycle.SetLineWidth(10); cycle.AddPath(Cycle.LINE, 20 * scale, 70 * scale, 50 * scale, 20 * scale); cycle.AddPath(Cycle.LINE, 50 * scale, 20 * scale, 80 * scale, 70 * scale); cycle.AddPath(Cycle.LINE, 80 * scale, 70 * scale, 20 * scale, 70 * scale); break; case 7: cycle.SetColor(0xD4FF00); cycle.SetStepsPerFrame(3); cycle.SetTrailLength(1); cycle.SetPointDistance(0.01f); cycle.SetLineWidth(6); cycle.SetPadding(0); cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 20 * scale, 360, 0); break; case 8: cycle.SetColor(0x05E2FF); cycle.SetStepsPerFrame(1); cycle.SetTrailLength(1); cycle.SetPointDistance(0.02f); cycle.AddPath(Cycle.ARC, 50 * scale, 50 * scale, 30 * scale, 0, 360); break; case 9: cycle.SetStepType(1); cycle.SetColor(LColor.yellow); cycle.AddPath(Cycle.LINE, 10 * scale, 10 * scale, 90 * scale, 10 * scale); cycle.AddPath(Cycle.LINE, 90 * scale, 10 * scale, 90 * scale, 90 * scale); cycle.AddPath(Cycle.LINE, 90 * scale, 90 * scale, 10 * scale, 90 * scale); cycle.AddPath(Cycle.LINE, 10 * scale, 90 * scale, 10 * scale, 10 * scale); break; } float size = MathUtils.Min(srcWidth / (1 / cycle.GetPointDistance()), srcHeight / (1 / cycle.GetPointDistance())); cycle.SetPadding(padding); cycle.SetBlockWidth(size + offset); cycle.SetBlockHeight(size + offset); cycle.SetWidth(width * scale); cycle.SetHeight(height * scale); return cycle; }