This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSUrl url = new NSUrl (UPLOAD_LOCATION); | |
NSMutableUrlRequest request = new NSMutableUrlRequest (url); | |
request.HttpMethod = "POST"; | |
{ | |
// Unfortunately set_HTTPBodyStream isn't implemented in monotouch yet | |
Selector s = new Selector("setHTTPBodyStream:"); | |
NSInputStream stream = new NSInputStream (random_file_path); | |
Messaging.void_objc_msgSend_IntPtr (request.Handle, s.Handle, stream.Handle); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// no claim or warranty is made on this code | |
// it is very brute force | |
using System; | |
using System.Collections; | |
using System.IO; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Collections.Generic; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Elements.cs: defines the various components of our view | |
// | |
// Author: | |
// Miguel de Icaza ([email protected]) | |
// | |
// Copyright 2010, Novell, Inc. | |
// | |
// Code licensed under the MIT X11 license | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.DirectoryServices.AccountManagement; | |
...... | |
using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, ADDomain)) | |
{ | |
var user = UserPrincipal.FindByIdentity(pc, IdentityType.SamAccountName, ADDomain + "\\" + username); | |
var group = GroupPrincipal.FindByIdentity(pc, "Admins. del dominio"); | |
var y = user.IsMemberOf(group); | |
var z = user.GetGroups().ToList(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//most of the non-declared variables here are at the class level - eg window is: | |
// UIWindow window | |
// etc. | |
window = new UIWindow (UIScreen.MainScreen.Bounds); | |
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BTPinchGestureRecognizer : UIPinchGestureRecognizer | |
{ | |
public BTPinchGestureRecognizer(NSObject target, Selector action) : base(target, action) | |
{ | |
ShouldReceiveTouch += (sender, touch) => { | |
//if (touch.View is UISlider || touch.View is MPVolumeView) return false; | |
return true; | |
}; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This function gets the string between 2 strings | |
//Usage | |
string myString = "<span>Joe Smith</span>"; | |
string [] result = GetStringInBetween("<span>", "</span>", myString); | |
string output = result[0]; | |
string next = result[1]; | |
//Function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////////////////////////////////////////// | |
//// PSPDFKitGlobal.h // | |
////////////////////////////////////////// | |
public partial class PSPDFKitGlobal | |
{ | |
private static PSPDFLogLevel _PSPDFLogLevel; | |
public static PSPDFLogLevel LogLevel | |
{ | |
get |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Sets the anchor point and translates the view so that it stays in its current position. | |
/// Normally, changing the anchor point also adjusts the view's position. | |
/// </summary> | |
/// <param name='oView'>the view whose anchor point has to be modified</param> | |
/// <param name='oNewAnchorPoint'>the new anchor point</param> | |
public void SetAnchorPointAndTranslate(PointF oNewAnchorPoint ) | |
{ | |
UIView oView = this; | |
PointF oNewPoint = new PointF(oView.Bounds.Width * oNewAnchorPoint.X, oView.Bounds.Height * oNewAnchorPoint.Y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
using MonoTouch.Dialog; | |
using System.IO; | |
using MonoTouch.MessageUI; | |
using System.Threading; | |
using MonoTouch.ObjCRuntime; | |
using System.Globalization; | |
using System.Xml.Linq; |
OlderNewer