public MainWindow() { xDimension = 100; yDimension = 100; InitializeComponent(); builder = new builder(xDimension, yDimension); colorsArray = new Color[10]; array = new Rectangle[xDimension, yDimension]; renderingArray = new bool[xDimension, yDimension]; InitializeComponent(); InitializeRectanglesOnCanvas(xDimension, yDimension); backgroundWorker = new BackgroundWorker(); clearingBackgroundWorker = new BackgroundWorker(); matrixIdsNumber = builder.MaxCellIdNumber; dispatcherTimer = new DispatcherTimer(); dispatcherTimer.Tick += dispatcherTimer_Tick; dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 50); backgroundWorker.DoWork += backgroundWorker_DoWork; backgroundWorker.RunWorkerCompleted += worker_RunWorkerCompleted; clearingBackgroundWorker.DoWork += clearingbackgroundWorker_DoWork; builder.StepAdding += UpdateCurrentRXStep; InitializeComboBoxes(); MakeColorsGrains(0); }
// Use this for initialization void Start() { currentBuilder = this; if (PlayerPrefs.HasKey(helpKey)) { if (PlayerPrefs.GetInt(helpKey) == 1) { hintSteps = 3; Hint1.SetActive(false); } } }
/// <summary> /// 图像缩略切剪 /// </summary> /// <param name="data">图像文件数据</param> /// <param name="width">缩略宽度,0表示与高度同比例</param> /// <param name="height">缩略高度,0表示与宽度同比例</param> /// <param name="type">目标图像文件格式</param> /// <param name="memoryPool">输出数据缓冲区内存池</param> /// <param name="seek">输出数据起始位置</param> /// <returns>图像缩略文件数据</returns> public static void Cut(ref subArray <byte> data, int width, int height, ImageFormat type, memoryPool memoryPool = null, int seek = 0) { if (data.Count != 0 && width > 0 && height > 0 && (width | height) != 0 && seek >= 0) { try { using (MemoryStream memory = new MemoryStream(data.UnsafeArray, data.StartIndex, data.Count)) { builder builder = new builder(); using (Image image = builder.CreateImage(memory)) { builder.Cut(ref data, ref width, ref height, type, memoryPool, seek); return; } } } catch (Exception error) { log.Error.Add(error, null, false); } } data.Null(); }
ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options);
AddGuildRoleInformation(builder, guild);
AddGuildMemberInformation(builder, guild);
AddMessageStatistics(builder, weekTotal, channelTotal);
AddGuildMetadata(builder, guild);
AddUserRoles(builder, user, guild);
AddUserMetadata(builder, user, lastMessageDate);
WriteFull(builder, type);
// meshDirty = false; // Disable dirty flag _BuildBVHAndTriangleList(ref builder, minNumberOfGeoPerBox, normals, triangles, trianglesVertexOrder, vertices);
SetProperty(builder, currentTag, currentContents);
(_, _) => new SerilogService().UseConsole(builder, config)
(LogLibraryType.Serilog, LogProviderType.Graylog) => new SerilogService().UseGraylog(builder, config), (_, _) => new SerilogService().UseConsole(builder, config)
static void Main(string[] args) { //task 1 List <IDeveloper> devs = new List <IDeveloper>(); Console.WriteLine("how many people you want to write info for ?"); int count = Convert.ToInt32(Console.ReadLine()); for (int i = 1; i < count + 1; i++) { Console.WriteLine("type 1 to procces person {0} as Programmer, type 2 to process person {0} as Builder", i); int type = 0; try { type = Convert.ToInt32(Console.ReadLine()); } catch (Exception ex) { Console.WriteLine(ex.Message); } if (type == 1) { IDeveloper unID = new Programmer(); unID.Create(); devs.Add(unID); } else if (type == 2) { IDeveloper unID = new builder(); unID.Create(); devs.Add(unID); } else { Console.WriteLine("{0} is not a valid type", type); } } devs.Sort(); foreach (IDeveloper i in devs) { Console.WriteLine(i); } //task 2 Dictionary <int, string> dict = new Dictionary <int, string>(); int countDict = 7; for (int i = 0; i < countDict; i++) { Console.WriteLine("Please write your name, person {0}", i + 1); string val = Console.ReadLine(); dict.Add(i + 1, val); } Console.WriteLine("enter id of the person you need, there are {0} people", countDict); search: try { int unid = Convert.ToInt32(Console.ReadLine()); if (unid > countDict) { Console.WriteLine("{0} out of range {1}", unid, countDict); } else { Console.WriteLine("{0} person is {1}", unid, dict[unid]); } } catch (FormatException) { Console.WriteLine("not a valid input type"); goto search; } }