예제 #1
0
        public string AhmetMehmet()
        {
            MK mikrotik = new MK("vpn.wifiburada.com");

            if (!mikrotik.Login("admin", "As081316"))
            {
                //Console.WriteLine("Could not log in");
                mikrotik.Close();
                return("Hatalı");
            }
            var aa = "";

            //var aaa = "";
            mikrotik.Send("/ip/address/print");
            mikrotik.Send("?=address=10.1.1.1/24");
            mikrotik.Send(".tag=sss", true);
            foreach (string h in mikrotik.Read())
            {
                aa += h;
                aa += "\n";
                //return h;
                //Console.WriteLine(h);
            }


            return(aa);
        }
        /// <summary>
        /// Helper method to call the Mshtml DragOver routine using .NET DragEventArgs
        /// </summary>
        /// <param name="e"></param>
        private void CallMshtmlDragOver(DragEventArgs e, bool allowEffects, bool allowExceptions)
        {
            if (mshtmlDropTargetImpl == null)
            {
                return;
            }

            try
            {
                // convert data types
                POINT      pt         = new POINT(); pt.x = e.X; pt.y = e.Y;
                DROPEFFECT dropEffect = ConvertDropEffect(e.AllowedEffect);
                MK         keyState   = ConvertKeyState(e.KeyState);

                // suppress effects if requested
                if (!allowEffects)
                {
                    dropEffect = DROPEFFECT.NONE;
                }

                // call mshtml
                mshtmlDropTargetImpl.DragOver(keyState, pt, ref dropEffect);

                // copy any changes to the dropEffect back into the event args
                e.Effect = ConvertDropEffect(dropEffect);
            }
            catch (Exception)
            {
                if (allowExceptions)
                {
                    throw;
                }
            }
        }
예제 #3
0
        private static MK ParseModifierPartOfString(string parseString)
        {
            MK     result   = (MK)0;
            string parseMod = parseString.ToUpperInvariant();

            while (parseMod.Length >= SHORTESTIDLENGTH)
            {
                if (parseMod.StartsWith("CONTROL", StringComparison.Ordinal))
                {
                    result  |= MK.Control;
                    parseMod = parseMod.Substring(CONTROLLENGTH);
                }
                else if (parseMod.StartsWith("SHIFT"))
                {
                    result  |= MK.Shift;
                    parseMod = parseMod.Substring(SHIFTLENGTH);
                }
                else if (parseMod.StartsWith("WIN"))
                {
                    result  |= MK.Win;
                    parseMod = parseMod.Substring(WINALTLENGTH);
                }
                else if (parseMod.StartsWith("ALT"))
                {
                    result  |= MK.Alt;
                    parseMod = parseMod.Substring(WINALTLENGTH);
                }
                else
                {
                    throw new ArgumentOutOfRangeException("The modifier passed was invalid");
                }
            }
            return(result);
        }
예제 #4
0
        void Interop.IDropTarget.DragOver(MK grfKeyState, Point pt, ref DragDropEffects pdwEffect)
        {
            Point    clientLocation = m_TreeView.PointToClient(pt);
            TreeNode node           = m_TreeView.HitTest(clientLocation).Node;

            CheckDragScroll(clientLocation);

            if (node != null)
            {
                if ((m_DragTarget == null) ||
                    (node != m_DragTarget.Node))
                {
                    if (m_DragTarget != null)
                    {
                        m_DragTarget.Dispose();
                    }

                    m_DragTarget = new DragTarget(node, grfKeyState,
                                                  pt, ref pdwEffect);
                }
                else
                {
                    m_DragTarget.DragOver(grfKeyState, pt, ref pdwEffect);
                }
            }
            else
            {
                pdwEffect = 0;
            }
        }
예제 #5
0
        // public to allow for unit testing, its mildly complex set of rules.
        public void ParseKeyStringToModAndKey(string keyString, out MK mod, out VK_Keys key)
        {
            #region entry code

            if (string.IsNullOrEmpty(keyString))
            {
                throw new ArgumentNullException("keyString", "The keyString must be non empty");
            }
            if (keyString.IndexOf('_') < SHORTESTIDLENGTH)
            {
                throw new ArgumentOutOfRangeException("keyString", "The keystring must be specified in the form MODIFIER_KEY");
            }

            #endregion

            key = (VK_Keys)0;

            string[] parts = keyString.Split(new char[] { '_' });
            if (parts.Length != 2)
            {
                throw new ArgumentOutOfRangeException("The keyString was not passed in the format MODIFIER_KEY");
            }

            mod = ParseModifierPartOfString(parts[0]);
            key = ParseKeyPartOfString(parts[1]);

            if (mod == (MK)0)
            {
                throw new ArgumentOutOfRangeException("The modifier passed was not correctly formed");
            }
        }
        /// <summary>
        /// Helper to convert .NET key state into Win32 key state
        /// </summary>
        /// <param name="keyState">.NET key state</param>
        /// <returns>Win32 key state</returns>
        public static MK ConvertKeyState(int keyState)
        {
            MK targetKeyState = 0;

            if ((keyState & 1) == 1)
            {
                targetKeyState |= MK.LBUTTON;
            }
            if ((keyState & 2) == 2)
            {
                targetKeyState |= MK.RBUTTON;
            }
            if ((keyState & 4) == 4)
            {
                targetKeyState |= MK.SHIFT;
            }
            if ((keyState & 8) == 8)
            {
                targetKeyState |= MK.CONTROL;
            }
            if ((keyState & 16) == 16)
            {
                targetKeyState |= MK.MBUTTON;
            }
            // NOTE: Win32 MK constants don't include the alt-key, the underlying
            // implementation will check for it using GetKeyState(VK_MENU) < 0
            return(targetKeyState);
        }
        /// <summary>
        /// Helper to cal the Mshtml DragDrop routine using .NET DragEventArgs
        /// </summary>
        /// <param name="e">event args</param>
        private void CallMshtmlDragDrop(DragEventArgs e, bool allowExceptions)
        {
            if (mshtmlDropTargetImpl == null)
            {
                return;
            }

            try
            {
                // extract ole data object
                IOleDataObject oleDataObject = SafeExtractOleDataObject(e.Data);

                // convert data types
                POINT      pt         = new POINT(); pt.x = e.X; pt.y = e.Y;
                DROPEFFECT dropEffect = ConvertDropEffect(e.AllowedEffect);
                MK         keyState   = ConvertKeyState(e.KeyState);

                // call mshtml
                mshtmlDropTargetImpl.Drop(oleDataObject, keyState, pt, ref dropEffect);

                // copy any changes to the dropEffect back into the event args
                e.Effect = ConvertDropEffect(dropEffect);
            }
            catch (Exception)
            {
                if (allowExceptions)
                {
                    throw;
                }
            }
        }
 private void btdn_Click(object sender, EventArgs e)
 {
     if (PK_TaiKhoan(TK.Text) == false)
     {
         con.Open();
         SqlCommand    cmd    = new SqlCommand("Select matkhau from TaiKhoan_admin where taikhoan='" + TK.Text + "'", con);
         SqlDataReader reader = cmd.ExecuteReader();
         reader.Read();
         if (reader.GetValue(0).ToString() == MK.Text)
         {
             DDN = true;
             this.Close();
         }
         else if (reader.GetValue(0).ToString() != MK.Text)
         {
             MessageBox.Show("Sai Mật Khẩu", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             MK.Focus();
             con.Close();
             return;
         }
     }
     else
     {
         MessageBox.Show("Tài Khoản Không Tồn Tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         TK.Focus();
         con.Close();
         return;
     }
     con.Close();
 }
예제 #9
0
        // koristi se za fiskalni
        public User AddUser(string username, string password, Profile ActivProfile, MK mikrotik)
        {
            User u = null;

            try
            {
                mikrotik.Send("/ip/hotspot/user/add");
                mikrotik.Send("=profile=" + ActivProfile.Name);
                mikrotik.Send("=name=" + username);
                mikrotik.Send("=limit-uptime=" + ActivProfile.UpTime);
                mikrotik.Send("=password=" + password, true);

                List <string> res = mikrotik.Read();

                foreach (var item in res)
                {
                    logger.Info(item.ToString());
                }

                u          = new User();
                u.Username = username;
                u.Password = password;
            }
            catch (Exception ex)
            {
                return(u);
            }
            return(u);
        }
예제 #10
0
        public void RegisterHotkey(IntPtr hWnd, MK modifier, VK_Keys key, PerformHotkeyAction action, string actionParameter)
        {
            HotkeyStore hks = new HotkeyStore()
            {
                ActionParameter  = actionParameter,
                HWnd             = hWnd,
                Action           = action,
                Controller       = (VK_Keys)(int)key,
                Modifier         = modifier,
                UniqueIdentifier = incrementalHotkeyRegister
            };

            if (!hks.Register())
            {
                int    err       = Marshal.GetLastWin32Error();
                string secondary = "Error:" + err.ToString();
                if (err == 1409)
                {
                    secondary = "The hotkey has already been registered.  Use a different combination than (" + modifier.ToString() + "+" + key.ToString();
                }

                throw new InvalidProgramException("The call to register a hotkey with windows failed. " + secondary);
            }
            interestedKeyCombos.Add(hks);
            incrementalHotkeyRegister++;
        }
예제 #11
0
        public ActionResult DeleteConfirmed(int id)
        {
            MK mK = db.MK.Find(id);

            db.MK.Remove(mK);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        /// <summary>
        /// Provides target feedback to the user and communicates the drop's effect to the DoDragDrop function so it can communicate the effect of the drop back to the source
        /// </summary>
        /// <param name="grfKeyState">Current state of the keyboard modifier keys on the keyboard</param>
        /// <param name="pt">POINTL structure containing the current cursor coordinates in screen coordinates</param>
        /// <param name="pdwEffect">Pointer to the current effect flag. Valid values are from the enumeration DROPEFFECT</param>
        void OpenLiveWriter.Interop.Com.IDropTarget.DragOver(MK grfKeyState, POINT pt, ref DROPEFFECT pdwEffect)
        {
            Debug.Fail("Unexpected call to IDropTarget.DragOver");

            if (mshtmlDropTargetImpl != null)
            {
                mshtmlDropTargetImpl.DragOver(grfKeyState, pt, ref pdwEffect);
            }
        }
        /// <summary>
        /// Incorporates the source data into the target window, removes target feedback, and releases the data object
        /// </summary>
        /// <param name="pDataObj">Pointer to the IDataObject interface on the data object being transferred in the drag-and-drop operation</param>
        /// <param name="grfKeyState">Current state of the keyboard modifier keys on the keyboard</param>
        /// <param name="pt">POINTL structure containing the current cursor coordinates in screen coordinates</param>
        /// <param name="pdwEffect">Pointer to the current effect flag. Valid values are from the enumeration DROPEFFECT</param>
        void OpenLiveWriter.Interop.Com.IDropTarget.Drop(IOleDataObject pDataObj, MK grfKeyState, POINT pt, ref DROPEFFECT pdwEffect)
        {
            Debug.Fail("Unexpected call to IDropTarget.Drop");

            if (mshtmlDropTargetImpl != null)
            {
                mshtmlDropTargetImpl.Drop(pDataObj, grfKeyState, pt, ref pdwEffect);
            }
        }
예제 #14
0
 public ActionResult Edit([Bind(Include = "Id,mk_name")] MK mK)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mK).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mK));
 }
예제 #15
0
 private static void Mdv_HostAttached(object sender, MK.MobileDevice.USBMultiplexArgs args)
 {
     Console.WriteLine("libimobiledevice.dll detected device attached to host.");
     Console.WriteLine("Device Locked: {0}", args.IsLocked);
     //Console.WriteLine("Uninstalled.");
     Console.WriteLine("FMIP: {0}", mdv.FindMyiPhoneEnabled);
     //Console.WriteLine("PurpleBuddy GetValue: {0}", mdv.RequestProperty<string>("com.apple.PurpleBuddy", "SetupState"));
     var pb = mdv.RequestProperties("com.apple.PurpleBuddy");
     mdv.EnableWifiConnection();
 }
예제 #16
0
 void Interop.IDropTarget.Drop(ComTypes.IDataObject pDataObj, MK grfKeyState, Point pt, ref DragDropEffects pdwEffect)
 {
     if (m_DragTarget != null)
     {
         m_DragTarget.DragDrop(pDataObj, grfKeyState, pt,
                               ref pdwEffect);
         m_DragTarget.Dispose();
         m_DragTarget = null;
     }
 }
예제 #17
0
 private void RemoveUser(User item, MK mt)
 {
     try
     {
         mt.Send("/ip/hotspot/user/remove");
         mt.Send("=numbers=" + item.Username);
     }
     catch (Exception)
     {
     }
 }
예제 #18
0
        public MK mikrotikLogin()
        {
            MK mikrotik = new MK("vpn.wifiburada.com");

            if (!mikrotik.Login("admin", "As081316"))
            {
                throw new System.Exception("Bağlantı Hatası");
            }

            return(mikrotik);
        }
예제 #19
0
 public void DragOver(MK keyState, Point pt, ref DragDropEffects effect)
 {
     if (m_DropTarget != null)
     {
         m_DropTarget.DragOver(keyState, pt, ref effect);
     }
     else
     {
         effect = 0;
     }
 }
예제 #20
0
        public ActionResult Create([Bind(Include = "Id,mk_name")] MK mK)
        {
            if (ModelState.IsValid)
            {
                db.MK.Add(mK);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mK));
        }
예제 #21
0
 public void changeListMK()
 {
     foreach (MataKuliah MK in listMK)
     {
         if (MK.getNamaMatKul() == splitNama(pilihanMatkul) && MK.getHariSol() == DaytoInt(splitHari(pilihanMatkul)) && MK.getJamSol() == splitJam(pilihanMatkul))
         {
             MK.setRuanganSol(pilihanRuanganAvail);
             MK.setHariSol(DaytoInt(pilihanHari));
             MK.setJamSol(pilihanJam);
         }
     }
 }
예제 #22
0
        protected void btn_Click(object sender, EventArgs e)
        {
            MK mikro = new MK();

            if (!mikro.Login())
            {
            }
            else
            {
                Response.Redirect("login.aspx");
            }
        }
예제 #23
0
        public void ParseHK_ControlAlt_IsFound()
        {
            string        hkString = "CONTROLALT_X";
            HotkeySupport sut      = new HotkeySupport();
            MK            parsedModifier;
            VK_Keys       parsedKey;

            sut.ParseKeyStringToModAndKey(hkString, out parsedModifier, out parsedKey);
            MK ctrlAlt = MK.Control | MK.Alt;

            Assert.Equal(ctrlAlt, parsedModifier);
            Assert.Equal(VK_Keys.X, parsedKey);
        }
예제 #24
0
        public List <Profile> GetAllProfiles()
        {
            MK mt = new MK(Properties.Settings.Default.RouterIp, Properties.Settings.Default.ApiPort);

            if (mt.Login(Properties.Settings.Default.ApiUser, Properties.Settings.Default.ApiPassword))
            {
                return(Profile.GetProfileMT(mt));
            }
            else
            {
                return(null);
            }
        }
예제 #25
0
        public string ARMOneToken()
        {
            HttpClient webclient = new HttpClient();

            SecureCredentials decrypt = new SecureCredentials();

            var uname = Configuration.GetSection("AppSettings").GetSection("ArmOneUsername").Value;
            var pass  = Configuration.GetSection("AppSettings").GetSection("ArmOnePassword").Value;
            var Url   = Configuration.GetSection("AppSettings").GetSection("ArmOneToken").Value;

            var Username     = decrypt.DecryptCredentials(uname);
            var Password     = decrypt.DecryptCredentials(pass);
            var EmailAddress = Configuration.GetSection("AppSettings").GetSection("ARMOneEmail").Value;

            Uri    mUrl  = new Uri(Url);
            string Token = "";

            Dictionary <string, object> data = new Dictionary <string, object>();

            data.Add("Username", Username);
            data.Add("Password", Password);
            data.Add("EmailAddress", EmailAddress);

            var MySerializedObject = JsonConvert.SerializeObject(data);

            var content = new StringContent(MySerializedObject, Encoding.UTF8, "application/json");

            var task = Task.Run(async() =>
            {
                return(await webclient.PostAsync(mUrl, content));
            });

            var response = task.Result;

            if (response.StatusCode == HttpStatusCode.OK)
            {
                response.EnsureSuccessStatusCode();
                var task1 = Task.Run(async() =>
                {
                    return(await response.Content.ReadAsStringAsync());
                });

                var rep = task1.Result;

                Dictionary <string, object> aoresult = JsonConvert.DeserializeObject <Dictionary <string, object> >(rep);

                aoresult.TryGetValue("CustomerReference", out object MK);
                Token = MK.ToString();
            }
            return(Token);
        }
예제 #26
0
        // GET: MKs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MK mK = db.MK.Find(id);

            if (mK == null)
            {
                return(HttpNotFound());
            }
            return(View(mK));
        }
예제 #27
0
 HResult IDropSource.QueryContinueDrag(bool fEscapePressed, MK grfKeyState)
 {
     if (fEscapePressed)
     {
         return(HResult.DRAGDROP_S_CANCEL);
     }
     else if ((grfKeyState & (MK.MK_LBUTTON | MK.MK_RBUTTON)) == 0)
     {
         return(HResult.DRAGDROP_S_DROP);
     }
     else
     {
         return(HResult.S_OK);
     }
 }
예제 #28
0
 public bool Empty()
 {
     return((Left.Count() +
             Right.Count() +
             Up.Count() +
             Down.Count() +
             LP.Count() +
             MP.Count() +
             HP.Count() +
             PPP.Count() +
             LK.Count() +
             MK.Count() +
             HK.Count() +
             KKK.Count() +
             Clear.Count()
             ) == 0);
 }
예제 #29
0
        void Interop.IDropTarget.DragEnter(ComTypes.IDataObject pDataObj, MK grfKeyState, Point pt, ref DragDropEffects pdwEffect)
        {
            Point    clientLocation = m_TreeView.PointToClient(pt);
            TreeNode node           = m_TreeView.HitTest(clientLocation).Node;

            DragTarget.Data          = pDataObj;
            m_TreeView.HideSelection = true;

            if (node != null)
            {
                m_DragTarget = new DragTarget(node, grfKeyState, pt, ref pdwEffect);
            }
            else
            {
                pdwEffect = 0;
                //return -1;
            }
            //return 0;
        }
예제 #30
0
            public DragTarget(TreeNode node, MK keyState, Point pt, ref DragDropEffects effect)
            {
                m_Node           = node;
                m_Node.BackColor = SystemColors.Highlight;
                m_Node.ForeColor = SystemColors.HighlightText;

                m_DragExpandTimer          = new Timer();
                m_DragExpandTimer.Interval = 1000;
                m_DragExpandTimer.Tick    += new EventHandler(m_DragExpandTimer_Tick);
                m_DragExpandTimer.Start();

                try
                {
                    m_DropTarget = Folder.GetIDropTarget(node.TreeView);
                    m_DropTarget.DragEnter(m_Data, keyState, pt, ref effect);
                }
                catch (Exception ex)
                {
                    Console.Write("\nError ShellTreeView.cs\n" + ex.Message);
                }
            }
예제 #31
0
        private string command(string command, string router)
        {
            string output = "";
            MK mikrotik = new MK(router);

            if (!mikrotik.Login("api", "api"))
            {
                //MessageBox.Show("Could not log in");
                mikrotik.Close();
                return "false";
            }

            mikrotik.Send(command);
            mikrotik.Send(".tag=sss", true);

            foreach (string response in mikrotik.Read())
            {
                output += response;
            }
            return output;
        }
예제 #32
0
        private void FiscalTimer_Tick(object sender, EventArgs e)
        {
            logger.Info("START: FiscalTimer_Tick");

            try
            {
                int fiskalNumberFromDatabes = GetGarsonLastFiscalNumber();

                if (fiskalNumberFromDatabes > curentFiscalNumber)
                {
                    curentFiscalNumber = fiskalNumberFromDatabes;

                    string username = curentFiscalNumber.ToString("000000");
                    logger.Info("New user = "******"Login mt = " + ok.ToString());
                    if (ok)
                    {
                        List <Profile> profiles = Profile.GetProfileMT(mt);
                        Profile        p        = profiles.Where(x => x.Name == Properties.Settings.Default.GarsonProfile).FirstOrDefault();
                        AddUser(username, "password", p, mt);
                        logger.Info("addUser = (" + username + ",password," + p.Name + ")");
                        string[] stri = p.UpTime.Split(':');
                        int      durationInHours;
                        int.TryParse(stri[0], out durationInHours);
                        ActivUsers.Add(new User()
                        {
                            Username = username, Created = DateTime.Now, DurationInHours = durationInHours
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
            }
        }
예제 #33
0
		public PageFrameCompiler(Type windowType, MK.JavaScript.WindowAttribute windowAttribute)
			: base(
#if !OBFUSCATE
"Page=" + windowAttribute.Path.Replace('/', '_').Replace('~', '_') + "=" +
#endif
Guid.NewGuid().ToString()
			) {
			this.WindowType = windowType;
			this.WindowAttribute = windowAttribute;
		}
예제 #34
0
        private static void Tai_Connect(object sender, MK.MobileDevice.TAI.ConnectEventArgs args)
        {

        }
예제 #35
0
 private static void Mdv_Connect(object sender, MK.MobileDevice.ConnectEventArgs args)
 {
     Console.WriteLine("libimobiledevice.dll Connected [MUX] to " + mdv.DeviceName);
     Console.WriteLine("IsWifiConnect: {0}", mdv.IsWifiConnect);
 }
       public DummyDataContext()
       {
           
           Europa = new Continent();
           Europa.ContinentID = 1;
           Europa.Name = "Europa";

           Graad = new Grade(1);
          
           Belgium = new Country("Belgie",Europa);
           England = new Country("England",Europa);
           Belgium.CountryID = 1;
           England.CountryID = 2;
           //Belgium.AboveEquator = true;
           //England.AboveEquator = false; //voor te testen. England ligt obviously boven de Equator
           int[] temp = new int[]{1,5,3,4,5,6,7,8,9,10,40,12};
           int[] sed = new int[] {10, 206, 30, 200, 50, 60, 70, 80, 20, 100, 110, 120};
           int[] temp2 = new int[] { 1, 2, 3, 0, -10, -12, 7, 8, 9, 10, 11, 12 };
           int[] sed2 = new int[] { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120 };
           NegTempClimateChart = new ClimateChart("Chelsea",2000,2030,temp2,sed2, -20, 10);
           NegTempClimateChart.Country = England;
           NegTempClimateChart.ClimateChartID = 2;
           England.ClimateCharts = new List<ClimateChart>{NegTempClimateChart};
           Gent = new ClimateChart("gent",1950,1960,temp,sed, 55, 6);
           Gent.Country = Belgium;
           Gent.ClimateChartID = 1;
           ClimateCharts = new List<ClimateChart>{ Gent };
           Belgium.ClimateCharts = ClimateCharts;  
           Countries = new List<Country>{ Belgium,England };
           Europa.Countries = Countries;
           Continenten = new List<Continent>{ Europa };
           Graad.Continents = Continenten;
           Parameter tw = new TW("Wat is de temperatuur van de warmste maand (TW)?");
           Parameter mw = new MW("Wat is de warmste maand?");
           Parameter mk = new MK("Wat is de temperatuur van de koudste maand?");
           Parameter tk = new TK("Wat is de temperatuur van de koudste maand (TK)?");
           Parameter d = new D("Hoeveel droge maanden zijn er?");
           Parameter nz = new NZ("Hoeveelheid neerslag in de zomer?");
           Parameter nw = new NW("Hoeveelheid neerslag in de winter?");
           Parameter tj = new TJ("");
           Parameter nj = new NJ("");
           Parameter tm = new TM("");
           //ClauseComponent tw10 = new Clause("TW <= 10", tw, "<=", 10);
           //ClauseComponent CC2 = new Clause("TW <= 10", tw, "<", 10);
           //ClauseComponent CC3 = new Clause("TW <= 10", tw, ">=", 10);
           //ClauseComponent CC4 = new Clause("TW <= 10", tw, ">", 10);
           //ClauseComponent res1 = new Result("YES", "geen woestijn");
           //ClauseComponent res2 = new Result("NO", "woestijn");
           //tw10.ClauseComponentId = 1;
           //res1.ClauseComponentId = 2;
           //res2.ClauseComponentId = 3;
           //tw10.Add(true, res1);
           //tw10.Add(false, res2);
           //CC2.Add(true, res1);
           //CC2.Add(false, res2);
           //CC3.Add(true, res1);
           //CC3.Add(false, res2);
           //CC4.Add(true, res1);
           //CC4.Add(false, res2);
           //DetTable = new DeterminateTable();
           
           //DetTable2 = new DeterminateTable();
           
           //DetTable3 = new DeterminateTable();
           
           //DetTable4 = new DeterminateTable();
           Graad.DeterminateTableProp = DetTable;

           Country belgië = new Country { Name = "België" };
           temps = new int[] { 10, 12, 12, 14, 15, 20, 28, 32, 28, 16, 6, 2 };
           sed = new[] { 120, 145, 200, 120, 150, 100, 140, 40, 100, 120, 130, 100 };
           chart = new ClimateChart("Gent", 1990, 1991, temps, sed, 55, 6);
           chart.Country = belgië;

           temps2 = new int[] { 14, 15, 17, 21, 25, 27, 28, 27, 26, 23, 19, 15 };
           sed2 = new[] { 7, 4, 4, 2, 0, 0, 0, 0, 0, 1, 3, 5 };
           chart2 = new ClimateChart("Kaïro", 1961, 1990, temps2, sed2, -20, 2);
           Country egypte = new Country { Name = "Egypte" };
           //egypte.AboveEquator = false;
           chart2.Country = egypte;

           temps3 = new int[] { 0, 1, 5, 11, 17, 22, 25, 24, 20, 14, 9, 3 };
           sed3 = new[] { 77, 73, 91, 96, 97, 91, 103, 95, 86, 77, 97, 86 };
           chart3 = new ClimateChart("New York", 1961, 1990, temps3, sed3, 50, -50);
           Country newyork = new Country { Name = "New York" };
           chart3.Country = newyork;

           temps4 = new int[] { 25, 1, 5, 11, 17, 22, 25, 24, 20, 14, 9, 3 };
           sed4 = new[] { 1, 2, 0, 0, 0, 100, 100, 100, 100, 100, 0, 0 };
           chart4 = new ClimateChart("Fictief", 1961, 1990, temps4, sed4, 60, 20);
           Country fictief = new Country { Name = "Fictief" };
           chart4.Country = fictief;
           

           byte[] picture = null;
           ClauseComponent tw10 = new Clause("TW <= 10", tw, "<=", 10);
           ClauseComponent tw0 = new Clause("TW <= 0", tw, "<=", 0);
           ClauseComponent tw0Yes = new Result("Koud klimaat zonder dooiseizoen", "Ijswoestijnklimaat", picture);
           ClauseComponent tw0No = new Result("Koud klimaat met dooiseizoen", "Toendraklimaat", picture);
           tw0.Add(true, tw0Yes);
           tw0.Add(false, tw0No);
           tw10.Add(true, tw0);
           ClauseComponent tj0 = new Clause("TJ <= 0", tj, "<=", 0);
           tw10.Add(false, tj0);


           ClauseComponent tj0Yes = new Result("Koudgematigd klimaat met strenge winter", "Taigaklimaat", picture);
           tj0.Add(true, tj0Yes);
           ClauseComponent nj200 = new Clause("NJ <= 200", nj, "<=", 200);

           ClauseComponent tk15 = new Clause("TK <= 15", tk, "<=", 15);
           ClauseComponent tk15Yes = new Result("Gematigd altijd droog klimaat", "Woestijnklimaat van de middelbreedten", picture);
           ClauseComponent tk15No = new Result("Warm altijd droog klimaat", "Woestijnklimaat van de tropen", picture);
           tk15.Add(true, tk15Yes);
           tk15.Add(false, tk15Yes);
           nj200.Add(true, tk15);
           tj0.Add(false, nj200);

           ClauseComponent tk18 = new Clause("TK <= 18", tk, "<=", 18);
           ClauseComponent nj400 = new Clause("NJ <= 400", nj, "<=", 400);
           ClauseComponent nj400Yes = new Result("Gematigd, droog klimaat", "Steppeklimaat", picture);
           ClauseComponent tk10N = new Clause("TK <= -10", tk, "<=", -10);
           ClauseComponent tk10NYes = new Result("Koudgematigd klimaat met strenge winter", "Taigaklimaat", picture);
           ClauseComponent d1 = new Clause(" D <= 1", d, "<=", 1);
           ClauseComponent tk3N = new Clause("TK <= -3", tk, "<=", -3);
           ClauseComponent tk3NYes = new Result("Koelgematigd klimaat met koude winter", "Gemengd-woudklimaat", picture);
           ClauseComponent tw22 = new Clause(" TW <= 22", tw, "<=", 22);
           ClauseComponent tw22Yes = new Result("Koelgematigd klimaat met zachte winter", "Loofbosklimaat", picture);
           ClauseComponent tw22No = new Result("Warmgematigd altijd nat klimaat", "Subtropisch regenwoudklimaat", picture);
           ClauseComponent nznw = new Clause("NZ <= NW", nz, nw);
           ClauseComponent tw222 = new Clause("TW <= 22", tw, "<=", 22);
           ClauseComponent tw222Yes = new Result("Koelgematigd klimaat met natte winter", "Hardbladige-vegetatieklimaat van de centrale middelbreedten", picture);
           ClauseComponent tw222No = new Result("Warmgematigd klimaat met natte winter", "Hardbladige-vegetatieklimaat van de subtropen", picture);
           ClauseComponent nznwNo = new Result("Warmgematigd klimaat met natte zomer", "Subtropisch savanneklimaat", picture);

           tw222.Add(true, tw222Yes);
           tw222.Add(false, tw222No);
           nznw.Add(true, tw222);
           nznw.Add(false, nznwNo);
           tw22.Add(true, tw22Yes);
           tw22.Add(false, tw22No);
           tk3N.Add(true, tk3NYes);
           tk3N.Add(false, tw22);
           d1.Add(true, tk3N);
           d1.Add(false, nznw);
           tk10N.Add(true, tk10NYes);
           tk10N.Add(false, d1);
           nj400.Add(true, nj400Yes);
           nj400.Add(false, tk10N);
           tk18.Add(true, nj400);
           nj200.Add(false, tk18);

           ClauseComponent d12 = new Clause("D <= 1", d, "<=", 1);
           ClauseComponent d12Yes = new Result("Warm klimaat met nat seizoen", "Tropisch savanneklimaat", picture);
           ClauseComponent d12No = new Result("Warm altijd nat klimaat", "Tropisch regenwoudklimaat", picture);
           d12.Add(true, d12Yes);
           d12.Add(false, d12No);
           tk18.Add(false, d12);
           dTable = new DeterminateTable();

           List<ClauseComponent> results1 = (new ClauseComponent[]
                {
                    tw0, tj0,nj200, tk15,tk18, nj400, tk10N, d1, tk3N, tw22, nznw, tw222, d12,
                    tw0Yes, tw0No, tj0Yes,
                    tk15Yes, tk15No, nj400Yes, tk10NYes, tk3NYes,
                    tw22Yes, tw22No, tw222Yes, tw222No, nznwNo,
                    d12Yes, d12No, tw10
                }).ToList();

           results1.ForEach(r => dTable.AllClauseComponents.Add(r));
       }
        public override DragDropEffects ProvideDragFeedback(Point screenPoint, int keyState, DragDropEffects supportedEffects)
        {
            if (_unhandledDropTarget == null)
                return DragDropEffects.None;

            _mkKeyState = MshtmlEditorDragAndDropTarget.ConvertKeyState(keyState);
            _effect = MshtmlEditorDragAndDropTarget.ConvertDropEffect(supportedEffects);
            _point = new POINT();
            _point.x = screenPoint.X;
            _point.y = screenPoint.Y;

            // We have to call begin drag here because we need the location and key state which we dont have in BeginDrag()
            if (!_hasCalledBeginDrag)
            {
                _hasCalledBeginDrag = true;
                _unhandledDropTarget.DragEnter(_oleDataObject, _mkKeyState, _point, ref _effect);
            }

            _unhandledDropTarget.DragOver(_mkKeyState, _point, ref _effect);

            return MshtmlEditorDragAndDropTarget.ConvertDropEffect(_effect);
        }
 public void DragOver(MK grfKeyState, POINT pt, ref OpenLiveWriter.Interop.Com.DROPEFFECT pdwEffect)
 {
     _contentEditorSite.DragOver(grfKeyState, pt, ref pdwEffect);
 }
        /// <summary>
        /// Incorporates the source data into the target window, removes target feedback, and releases the data object
        /// </summary>
        /// <param name="pDataObj">Pointer to the IDataObject interface on the data object being transferred in the drag-and-drop operation</param>
        /// <param name="grfKeyState">Current state of the keyboard modifier keys on the keyboard</param>
        /// <param name="pt">POINTL structure containing the current cursor coordinates in screen coordinates</param>
        /// <param name="pdwEffect">Pointer to the current effect flag. Valid values are from the enumeration DROPEFFECT</param>
        void OpenLiveWriter.Interop.Com.IDropTarget.Drop(IOleDataObject pDataObj, MK grfKeyState, POINT pt, ref DROPEFFECT pdwEffect)
        {
            Debug.Fail("Unexpected call to IDropTarget.Drop");

            if (mshtmlDropTargetImpl != null)
            {
                mshtmlDropTargetImpl.Drop(pDataObj, grfKeyState, pt, ref pdwEffect);
            }
        }
 public void Drop(OpenLiveWriter.Interop.Com.IOleDataObject pDataObj, MK grfKeyState, POINT pt, ref OpenLiveWriter.Interop.Com.DROPEFFECT pdwEffect)
 {
     _contentEditorSite.Drop(pDataObj, grfKeyState, pt, ref pdwEffect);
 }
        /// <summary>
        /// Provides target feedback to the user and communicates the drop's effect to the DoDragDrop function so it can communicate the effect of the drop back to the source
        /// </summary>
        /// <param name="grfKeyState">Current state of the keyboard modifier keys on the keyboard</param>
        /// <param name="pt">POINTL structure containing the current cursor coordinates in screen coordinates</param>
        /// <param name="pdwEffect">Pointer to the current effect flag. Valid values are from the enumeration DROPEFFECT</param>
        void OpenLiveWriter.Interop.Com.IDropTarget.DragOver(MK grfKeyState, POINT pt, ref DROPEFFECT pdwEffect)
        {
            Debug.Fail("Unexpected call to IDropTarget.DragOver");

            if (mshtmlDropTargetImpl != null)
            {
                mshtmlDropTargetImpl.DragOver(grfKeyState, pt, ref pdwEffect);
            }
        }