コード例 #1
0
        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);
        }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     currentBuilder = this;
     if (PlayerPrefs.HasKey(helpKey))
     {
         if (PlayerPrefs.GetInt(helpKey) == 1)
         {
             hintSteps = 3;
             Hint1.SetActive(false);
         }
     }
 }
コード例 #3
0
 /// <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();
 }
コード例 #4
0
 ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options);
コード例 #5
0
 AddGuildRoleInformation(builder, guild);
コード例 #6
0
 AddGuildMemberInformation(builder, guild);
コード例 #7
0
 AddMessageStatistics(builder, weekTotal, channelTotal);
コード例 #8
0
 AddGuildMetadata(builder, guild);
コード例 #9
0
 AddUserRoles(builder, user, guild);
コード例 #10
0
 AddUserMetadata(builder, user, lastMessageDate);
コード例 #11
0
 WriteFull(builder, type);
コード例 #12
0
                // meshDirty = false;   // Disable dirty flag

                _BuildBVHAndTriangleList(ref builder,
                                         minNumberOfGeoPerBox,
                                         normals,
                                         triangles,
                                         trianglesVertexOrder,
                                         vertices);
コード例 #13
0
ファイル: PluginLoader.cs プロジェクト: chylex/TweetDuck
 SetProperty(builder, currentTag, currentContents);
コード例 #14
0
 (_, _) => new SerilogService().UseConsole(builder, config)
コード例 #15
0
 (LogLibraryType.Serilog, LogProviderType.Graylog) => new SerilogService().UseGraylog(builder, config),
 (_, _) => new SerilogService().UseConsole(builder, config)
コード例 #16
0
        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;
            }
        }