Skip to content

Instantly share code, notes, and snippets.

View WildGenie's full-sized avatar
🤖
I ❤️ Machine Learning

Bilgehan Zeki ÖZAYTAÇ WildGenie

🤖
I ❤️ Machine Learning
View GitHub Profile
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Sep05_PeriodicalTable //CHANGE TO YOUR NAMESPACE!!!
public class Element
{
public int AtomicNumber { get; set; }
public string Symbol { get; set; }
public string Name { get; set; }
public decimal AtomicWeight { get; set; }
// public string GroupNumber { get; set; }
// public string GroupName { get; set; }
// public string Period { get; set; }
I have created a InfoProgressBar control which uses a TransparentLabel control. Testing on a form with a Timer, I get some slight glitches displaying the text every 30-40 value changes if using a timer interval of less than 250 milliseconds (probably because of the time required to update the screen is greater than the timer interval).
It would be possible to modify UpdateText method to insert all the calculated values into CustomText but it isn't something that I have needed yet. This would remove the need for the DisplayType property and enumerate.
The TransparentLabel class was created by adding a new UserControl and changing it to inheriting from Label with the following implementation:
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
You will have to override the OnPaint method, call the base implementation and the paint your own text.
You will need to create your own CustomProgressBar and then override OnPaint to draw what ever text you want.
Custom Progress Bar Class
namespace ProgressBarSample
{
public enum ProgressBarDisplayText
public void LoadCustomRequestExample()
{
var frame = WebBrowser.GetMainFrame();
//Create a new request knowing we'd like to use PostData
var request = frame.CreateRequest(initializePostData:true);
request.Method = "POST";
request.Url = "custom://cefsharp/PostDataTest.html";
request.PostData.AddData("test=123&data=456");
@WildGenie
WildGenie / Main.cs
Created May 2, 2017 03:50 — forked from itshaadi/Main.cs
workaround for drag and drop in CefSharp (winfrom)
using System.Collections.Generic;
using Gma.System.MouseKeyHook; // for simulating OnDragDrop https://github.com/gmamaladze/globalmousekeyhook
using System.Windows.Forms;
using CefSharp;
public partial class MainForm : Form
{
private IList<string> dropFiles;
private ChromiumWebBrowser Browser;
IntPtr DragableRegionNative = Native.CreateRectRgn(0, 0, 0, 0);
void RegionsChangedCallback(DraggableRegion[] Regions)
{
Native.SetRectRgn(DragableRegionNative, 0, 0, 0, 0);
if (Regions == null)
return;
@WildGenie
WildGenie / highlight.xml
Created March 24, 2017 10:12 — forked from thecodejunkie/highlight.xml
Explicit cs Implict reference of NETStandard.Library
Are there any differences to the two approaches below? I.e impliclity ending up with the package reference to
NETStandard.Library 1.6.1, dvs running with DisableImplicitFrameworkReferences = true and adding an explicit
reference to NETStandard.Library?
Any pros/cons for either? Any hidden/implicit impacts?
See https://github.com/dotnet/sdk/pull/633#issuecomment-272515440 for some context
<Project Sdk="Microsoft.NET.Sdk">
@WildGenie
WildGenie / google_proxy.js
Created March 23, 2017 09:55 — forked from Ation/google_proxy.js
Google compression proxy
/**
* Data Compression Proxy Extension for Google Chrome on Desktop
* (c) 2014 Jerzy Głowacki. License: Apache 2.0
*/
var MD5 = function(e) {
 function h(a,b){var c,d,e,f,g;e=a&2147483648;f=b&2147483648;c=a&1073741824;d=b&1073741824;g=(a&1073741823)+(b&1073741823);return c&d?g^2147483648^e^f:c|d?g&1073741824?g^3221225472^e^f:g^1073741824^e^f:g^e^f}function k(a,b,c,d,e,f,g){a=h(a,h(h(b&c|~b&d,e),g));return h(a<<f|a>>>32-f,b)}function l(a,b,c,d,e,f,g){a=h(a,h(h(b&d|c&~d,e),g));return h(a<<f|a>>>32-f,b)}function m(a,b,d,c,e,f,g){a=h(a,h(h(b^d^c,e),g));return h(a<<f|a>>>32-f,b)}function n(a,b,d,c,e,f,g){a=h(a,h(h(d^(b|~c),e),g));return h(a<<f|a>>>32-f,b)}function p(a){var b="",d="",c;for(c=0;3>=c;c++)d=a>>>8*c&255,d="0"+d.toString(16),b+=d.substr(d.length-2,2);return b}var f=[],q,r,s,t,a,b,c,d;e=function(a){a=a.replace(/\r\n/g,"\n");for(var b="",d=0;d<a.length;d++){var c=a.charCodeAt(d);128>c?b+=String.fromCharCode(c):(127<c&&2048>c?b+=String.fromCharCode(c>>6|192):(b+=String.fromCharCode(c>>12|224),b+=Stri
#!/bin/bash
clear
echo "$COL_GREEN Radius Manager installer script for CENTOS 6.x 32bit"
echo "Copyright 2004-2013, DMA Softlab LLC"
echo "All right reserved.. $COL_RESET"
echo "$COL_GREEN Script modified by Syed Jahanzaib for CENTOS"
# Colors Config . . . [[ JZ . . . ]]
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"