private void ShowSelectUrlDialog(KryptonTextBox txt, UrlType type) { if (type == UrlType.Folder) { FolderBrowserDialog fbd = new FolderBrowserDialog(); fbd.RootFolder = Environment.SpecialFolder.MyComputer; if (System.IO.Directory.Exists(txt.Text)) { fbd.SelectedPath = txt.Text; } if (fbd.ShowDialog() == DialogResult.OK) { txt.Text = fbd.SelectedPath; } } else { OpenFileDialog ofd = new OpenFileDialog(); if (System.IO.File.Exists(txt.Text)) { ofd.FileName = txt.Text; } if (ofd.ShowDialog() == DialogResult.OK) { txt.Text = ofd.FileName; } } }
/// <summary> /// Gets a ZephyrFile implementation matching the URL type passed in. /// </summary> /// <param name="url">The Fullname or URL of the directory.</param> /// <param name="clients">A collection of connection clients.</param> /// <returns>A ZephyrFile implementation.</returns> public static ZephyrDirectory GetZephyrDirectory(string url, Clients clients = null) { ZephyrDirectory dir = null; UrlType type = GetUrlType(url); switch (type) { case UrlType.LocalDirectory: dir = new WindowsZephyrDirectory(url); break; case UrlType.NetworkDirectory: dir = new WindowsZephyrDirectory(url); break; case UrlType.AwsS3Directory: dir = new AwsS3ZephyrDirectory(clients?.aws, url); break; default: throw new Exception($"Url [{url}] Is Not A Known Directory Type."); } return(dir); }
/// <summary> /// 取得用户信息 /// </summary> private void GetUserInfoOnCloudRender() { #if UNITY_STANDALONE_WIN JObject jo = new JObject(); switch (platformType) { case PlatformType.Purchase: if (!string.IsNullOrEmpty(_token)) { jo["token"] = _token; byte[] postBtye = System.Text.Encoding.UTF8.GetBytes(jo.ToString()); string data = System.Convert.ToBase64String(postBtye); _urlType = UrlType.Login_purchase; Up(data); CallBack = LoginCallBack; } break; case PlatformType.Simple: if (!string.IsNullOrEmpty(_sequenceCode)) { _urlType = UrlType.Login_simple; Up(_sequenceCode); CallBack = LoginCallBack; } break; } #elif UNITY_WEBPLAYER Application.ExternalCall("getUserInfoForWebPlayer"); #elif UNIT_WEBGL _GetUserInfo(); #endif }
private async Task <bool> UpdateOrderUrl(string id, string url, UrlType urlType) { var order = await GetOrderById(id); if (order == null) { return(false); } switch (urlType) { case UrlType.Success: order.SuccessUrl = url; break; case UrlType.Error: order.ErrorUrl = url; break; case UrlType.InProgress: order.ProgressUrl = url; break; } await _storeRequestClient.ApiStoreOrderPostWithHttpMessagesAsync(order); return(true); }
public ObjectId ComputeInputHash(UrlType type, string filePath) { var hash = ObjectId.Empty; switch (type) { case UrlType.File: hash = builderContext.InputHashes.ComputeFileHash(filePath); break; case UrlType.Internal: if (!buildTransaction.TryGetValue(filePath, out hash)) { Logger.Warning("Location " + filePath + " does not exist currently and is required to compute the current command hash. The build cache will not work for this command!"); } break; case UrlType.Virtual: var providerResult = VirtualFileSystem.ResolveProvider(filePath, true); var dbProvider = providerResult.Provider as DatabaseFileProvider; var microProvider = providerResult.Provider as MicroThreadFileProvider; if (microProvider != null) { dbProvider = microProvider.ThreadLocal.Value as DatabaseFileProvider; } if (dbProvider != null) { dbProvider.AssetIndexMap.TryGetValue(providerResult.Path, out hash); } break; } return(hash); }
private static string GetUriExtension(UrlType urlType) { string urlExtension; switch (urlType) { case UrlType.Xml: urlExtension = "xml"; break; case UrlType.Json: urlExtension = "json"; break; case UrlType.API: urlExtension = "api"; break; case UrlType.Tests: urlExtension = "tests"; break; case UrlType.Coverage: urlExtension = "coverage"; break; default: throw new ArgumentOutOfRangeException(nameof(urlType)); } return(urlExtension); }
public bool Accept(Uri location, SpiderContext context, ISpiderResource parentSpider) { UrlType urlType = ((WebSpiderResource)parentSpider).addingUrlType; if ( !(urlType == UrlType.Img && this.downloadImagesFromExternalSite) && !(urlType != UrlType.Img && this.downloadResourceFromExternalSite) ) { string tempbase = context.BaseLocation; int i; if ((i = tempbase.LastIndexOf("/")) >= 0) { tempbase = tempbase.Substring(0, i + 1); } if (!location.OriginalString.StartsWith(tempbase)) { return(false); } } return(true); }
public async static Task <string> GetFromBaseAsync(UrlType type, string value) { string url = string.Empty; string key = string.Empty; switch (type) { case UrlType.Town: url = "http://nigeriapostcode.com.ng/index.php/ajax/getUrbanTown"; key = "state_id"; break; case UrlType.Area: url = "http://nigeriapostcode.com.ng/index.php/ajax/getUrbanAreas"; key = "town_id"; break; case UrlType.Street: url = "http://nigeriapostcode.com.ng/index.php/ajax/getUrbanStreets"; key = "area_id"; break; } var response = await new HttpClient().PostAsync(url, new StringContent($"{key}={value}", Encoding.UTF8, "application/x-www-form-urlencoded")); return(await response.Content.ReadAsStringAsync()); }
/// <summary> /// Gets the URL for using in the ref field to link to a work item in MTM /// </summary> /// <param name="urlType">The type of url to construct</param> /// <param name="id">The id of the item (although in the case of a test result this is the ID of the run</param> /// <param name="runRelativeID">This is only for a test result and is the ID of the test result</param> /// <param name="projectName">The name of the team project</param> /// <returns>a formatted url string</returns> private string GetURL(UrlType urlType, int id, int runRelativeID, string projectName) { //URL format is: mtm://<server name>:<port>/<tfs vdir>/<Collection name>/p:<project name>/<center group>/<group specific> //An example is mtm://tfs2010:8080/tfs/DefaultCollection/p:BlogEngine.NET/testing/testplan/open?id=123 //test case = mtm://testServer/tfs/DefaultCollection/p:Woodgrove/testing/testcase/open?id=<ID> //test plan = mtm://testServer/tfs/DefaultCollection/p:Woodgrove/testing/testplan/connect?id=<ID> //test result = mtm://testServer/tfs/DefaultCollection/p:Woodgrove/testing/testresult/open?id=<runrelative ID>?runid=<run id> //test run = mtm://testServer/tfs/DefaultCollection/p:Woodgrove/testing/testrun/open?id=<run id> string server = _wis.TeamProjectCollection.Uri.ToString().Replace("http", "mtm"); //Returns http://[server]:[port]/tfs/[collection] - need to replace http with mtm string url = server + string.Format("/p:{0}/testing/", projectName); switch (urlType) { case UrlType.WorkItem: url += string.Format("/testcase/open?id={0}", id); break; case UrlType.TestPlan: url += string.Format("/testplan/connect?id={0}", id); break; case UrlType.TestRun: url += string.Format("/testrun/open?id={0}", id); break; case UrlType.TestResult: url += string.Format("/testresult/open?id={0}?runid={1}", runRelativeID, id); break; } return(url); }
/// <summary> /// 生成urlType列表 /// </summary> /// <returns></returns> private List <UrlType> GenerateUrlTypes() { var list = new List <UrlType>(); list.AddRange(config.ios.urlTypes); if (config.weChat.enable) { var idUrltype = new UrlType { id = "wexin", urlScheme = config.weChat.appId }; list.Add(idUrltype); var linkUrltype = new UrlType { id = "ulink", urlScheme = string.Join(",", config.weChat.associatedDomains.ToArray()) }; list.Add(linkUrltype); } if (config.baiduMap.enable) { var idUrltype = new UrlType { id = "baidu", urlScheme = $"baidu{config.baiduMap.iOSAppId}" }; list.Add(idUrltype); } return(list); }
public RequestState(HttpWebRequest req, string url, UrlType urltype, int index) { Req = req; Url = url; WebUrlType = urltype; Index = index; }
//------------------------------------------------ private string CreateUrlPropertyBlock(string key, UrlType type) { StringBuilder block = new StringBuilder(); string datatype = "string"; string propertyBody = "get { return Resources." + this.Key + "Urls." + key + "; }"; if (type == UrlType.Url) { propertyBody = "get { return " + SiteUrlsBuilder.GetGlobalResolveMethodIdentifire() + "(Resources." + this.Key + "Urls." + key + "); }"; } //Property Blook block.Append("\n\t#region --------------" + key + "--------------"); block.Append("\n\t//---------------------------------"); block.Append("\n\t//" + key); block.Append("\n\t//---------------------------------"); block.Append("\n\tpublic " + datatype + " " + key); block.Append("\n\t{"); block.Append("\n\t\t" + propertyBody); block.Append("\n\t}"); block.Append("\n\t//----------------------"); block.Append("\n\t#endregion"); //-------------------------- return(block.ToString()); }
public static string GetUrlPrefix(UrlType urlType) { switch (urlType) { case UrlType.Absolute: return(string.Empty); case UrlType.RelativeToDataPath: return(Application.dataPath); case UrlType.RelativeToPeristentPath: return(Application.persistentDataPath); case UrlType.RelativeToProjectPath: #if !UNITY_WINRT_8_1 string parentPath = ".."; #if UNITY_STANDALONE_OSX && !UNITY_EDITOR_OSX parentPath += "/.."; #endif // UNITY_STANDALONE_OSX && !UNITY_EDITOR_OSX return(System.IO.Path.GetFullPath(System.IO.Path.Combine( Application.dataPath, parentPath)).Replace('\\', '/')); #else return(string.Empty); #endif // UNITY_WINRT_8_1 case UrlType.RelativeToStreamingAssetsPath: return(Application.streamingAssetsPath); default: return(string.Empty); } }
private static bool TryLookupUrl(UrlType urlType, out string url) { url = null; // Once the internet has been found missing, don't bother trying it again for the duration of the program. if (!_internetAvailable) { return(false); } try { using (var s3Client = new BloomS3Client(null)) { s3Client.Timeout = TimeSpan.FromMilliseconds(2500.0); s3Client.ReadWriteTimeout = TimeSpan.FromMilliseconds(3000.0); s3Client.MaxErrorRetry = 1; var jsonContent = s3Client.DownloadFile(BloomS3Client.BloomDesktopFiles, kUrlLookupFileName); Urls urls = JsonConvert.DeserializeObject <Urls>(jsonContent); url = urls.GetUrlById(urlType.ToJsonPropertyString()); if (!string.IsNullOrWhiteSpace(url)) { return(true); } Logger.WriteEvent("Unable to look up URL type " + urlType); } } catch (Exception e) { _internetAvailable = false; Logger.WriteEvent("Exception while attempting look up of URL type " + urlType + ": " + e); } return(false); }
public static Uri GetWorkflowUri(IContextualResourceModel resourceModel, string xmlData, UrlType urlType) { if(resourceModel == null || resourceModel.Environment == null || resourceModel.Environment.Connection == null || !resourceModel.Environment.IsConnected) { return null; } var environmentConnection = resourceModel.Environment.Connection; string urlExtension = "xml"; switch(urlType) { case UrlType.XML: break; case UrlType.JSON: urlExtension = "json"; break; default: throw new ArgumentOutOfRangeException("urlType"); } var relativeUrl = string.Format("/secure/{0}.{1}?", resourceModel.Category, urlExtension); relativeUrl += xmlData; relativeUrl += "&wid=" + environmentConnection.WorkspaceID; Uri url; Uri.TryCreate(environmentConnection.WebServerUri, relativeUrl, out url); return url; }
static UrlType GetUrlType(string url) { UrlType urlType = UrlType.Local; if (AzureHelper.MatchHandler(url)) { urlType = UrlType.Azure; } else if (AzureHelper.MatchFileHandler(url)) { urlType = UrlType.AzureFile; } else if (S3Helper.MatchHandler(url)) { urlType = UrlType.S3; } else if (SkyDriveHelper.MatchHandler(url)) { urlType = UrlType.SkyDrive; } else if (SharepointHelper.MatchHandler(url)) { urlType = UrlType.Sharepoint; } else if (DropboxHelper.MatchHandler(url)) { urlType = UrlType.Dropbox; } else { urlType = UrlType.Local; // local filesystem. } return(urlType); }
private void GetAll(UrlType type) { List <string> urls = new List <string>(); switch (type) { case UrlType.Page: urls.Add(SearchRoot); break; case UrlType.Item: urls.AddRange(UrlManager.GetAll(UrlType.Page)); break; case UrlType.Image: string[] tmpUrls = UrlManager.GetAll(UrlType.Item); tmpUrls = ClearExsitItems(tmpUrls); if (tmpUrls.Length == 0) { PassOutputAndStopRunning(); } urls.AddRange(tmpUrls); break; } foreach (string url in urls) { string html = HtmlDownloader.DownloadHtml(url); string[] newUrls = HtmlParser.Parse(html, type); for (int i = 0; i < newUrls.Length; i++) { newUrls[i] = newUrls[i].Replace("amp;", ""); } UrlManager.AddRange(newUrls, type); } }
public T GetData <T>(ApiType api, UrlType type, string sortBy = "", int?numResults = null, int?resultOffset = null) where T : class { if (numResults.HasValue) { parameters.Add("numResults", numResults.Value.ToString()); } if (resultOffset.HasValue) { parameters.Add("resultOffset", resultOffset.Value.ToString()); } if (sortBy == "DESC") { parameters.Add("sortBy", sortBy); } requestUrl = string.Concat(string.Format(ApiUrl, api.ToDescriptionString(), type.ToDescriptionString()), parameters.ToQueryString(true)); var xmlString = PostRequest(); if (string.IsNullOrEmpty(xmlString)) { return(default(T)); } T response; using (var reader = new StringReader(xmlString)) { var serializer = new XmlSerializer(typeof(T)); response = serializer.Deserialize(reader) as T; } return(response); }
protected async Task <bool> UpdateUrl(string id, string url, UrlType urlType) { var payRequest = await GetStoreRequest(id); if (payRequest == null) { return(false); } switch (urlType) { case UrlType.Success: payRequest.SuccessUrl = url; break; case UrlType.Error: payRequest.ErrorUrl = url; break; case UrlType.InProgress: payRequest.ProgressUrl = url; break; } await StoreRequestClient.ApiStorePostWithHttpMessagesAsync(payRequest); await Log.WriteInfoAsync(this.GetType().Name, $"{nameof(UpdateUrl)} - {urlType.ToString()}", LogContextPayRequest(payRequest), $"Update callback url for request by {id}"); return(true); }
/// <summary> /// 重载构造函数 /// </summary> /// <param name="bText">按妞的文字</param> /// <param name="bUrl">按钮的javascript/vbscript的Onclick字符</param> /// <param name="bHint">按钮提示信息</param> /// <param name="bType">按钮链接类型</param> /// <param name="bDefautl">是否默认选中当前按钮</param> public WebNavigationUrl(string bText, string bUrl, string bHint, UrlType bType, bool bDefautl) { _btnText = bText; _btnUrl = bUrl; _btnHint = bHint; _btnType = bType; _btnDefaultSelect = bDefautl; }
/// <summary> /// InitFirstUrl /// </summary> /// <param name="param"></param> /// <returns></returns> protected override string InitFirstUrl(ZhiXingAndShiXinParameter param) { _name = param.Name; _identifier = param.Identifier; _type = param.Type; _urlType = _type.ToLower().Equals("zhixing") ? UrlType.ZhiXing : UrlType.ShiXin; return(_zhixingUrl); }
/// <summary> /// 重载构造函数 /// </summary> /// <param name="bText">按妞的文字</param> /// <param name="bUrl">按钮的javascript/vbscript的Onclick字符</param> /// <param name="bHint">按钮提示信息</param> /// <param name="bType">按钮链接类型</param> /// <param name="bDefautl">是否默认选中当前按钮</param> public sys_NavigationUrl(string bText, string bUrl, string bHint, UrlType bType,bool bDefautl) { _btnText = bText; _btnUrl = bUrl; _btnHint = bHint; _btnType = bType; _btnDefaultSelect = bDefautl; }
public UrlMarker(TextDocument doc, string url, UrlType urlType, string style, int startColumn, int endColumn) { this.doc = doc; this.url = url; this.urlType = urlType; this.style = style; this.startColumn = startColumn; this.endColumn = endColumn; }
private void SaveContents(string xml, string url, UrlType urltype) { if (string.IsNullOrEmpty(xml)) { return; } paserDate(xml, url, urltype); }
private static string LookupFullUrl(UrlType urlType, bool sandbox = false, Action <string> acceptFinalUrl = null) { if (sandbox) { urlType = GetSandboxUrlType(urlType); } string url; if (s_liveUrlCache.TryGetValue(urlType, out url)) { return(url); } if (!Program.RunningUnitTests) { // (If we're running unit tests, we can go with the default URLs. // Otherwise, try to get the real ones, now or later.) if (acceptFinalUrl == null) { // If it really is necessary, you can remove this message. It's just designed to make someone think // if adding a call that might slow things down and send the query twice. If that happens, consider // adding some locking to make sure the actual server query only gets sent once. Debug.Fail( "If at all possible, you should provide an appropriate acceptFinalUrl param when looking up a url during startup."); // We need the true value now. Get it. if (TryGetUrlDataFromServer() && s_liveUrlCache.TryGetValue(urlType, out url)) { return(url); } Logger.WriteEvent("Unable to look up URL type " + urlType); } else { // We can live with a fallback value for now, but get the real one in the background, // and then deliver it. var backgroundWorker = new BackgroundWorker(); backgroundWorker.DoWork += (sender, args) => { if (TryGetUrlDataFromServer() && s_liveUrlCache.TryGetValue(urlType, out url)) { acceptFinalUrl(url); } else { Logger.WriteEvent("Unable to look up URL type " + urlType); } }; backgroundWorker.RunWorkerAsync(); } } var fallbackUrl = LookupFallbackUrl(urlType); Logger.WriteEvent($"Using fallback URL: {fallbackUrl}"); return(fallbackUrl); }
//------------------------------------------------ //AddUrl /* * public void AddUrl(string key, UrlType type) * { * if (!urls.Contains(key)) * { * Propreties.Append(CreateUrlPropertyBlock(key,type)); * Tags.Append(CreateXmlNode( key, type)); * urls.Add(key, null); * } * }*/ //------------------------------------------------ public void AddUrl(string key, string url, UrlType type) { if (!urls.Contains(key)) { Propreties.Append(CreateUrlPropertyBlock(key, type)); Tags.Append(CreateXmlNode(key, url)); urls.Add(key, null); } }
public UrlMarker(LineSegment line, string url, UrlType urlType, string style, int startColumn, int endColumn) { this.line = line; this.url = url; this.urlType = urlType; this.style = style; this.startColumn = startColumn; this.endColumn = endColumn; }
protected override void OnPreInit(EventArgs e) { base.OnPreInit(e); string rs = RequestSource.ToLower(); if (UrlType.ToLower() == "tab") { if (this.IsLogin) { if (IsCompanyCheck == true || rs == "toptab" || rs == "noneedcheck") { this.MasterPageFile = "~/MasterPage/Site1.master"; } else { Response.Clear(); Response.Write("{isCheck:false}"); Response.End(); } } else { Response.Clear(); Response.Write("{Islogin:false}"); Response.End(); } } else { if (IsLogin == false) { EyouSoft.Security.Membership.UserProvider.RedirectLogin(); return; } this.MasterPageFile = "~/MasterPage/Site1.master"; string url = Request.Url.PathAndQuery.ToLower(); string s = Server.UrlEncode("page:" + url); if (IsTravelUser)//旅行社用户 { Response.Clear(); Response.Write("<script type='text/javascript'>location.href='/Default.aspx#" + s + "';</script><h1><a href='/Default.aspx#" + s + "'>页面会自动跳转到后台系统,如果没有自动跳转,则点此链接进入后台系统</a></h1>"); Response.End(); } else if (IsAirTicketSupplyUser) { Response.Clear(); Response.Write("<script type='text/javascript'>location.href='/TicketsCenter/Default.aspx#" + s + "';</script><h1><a href='/Default.aspx#" + s + "'>页面会自动跳转到后台系统,如果没有自动跳转,则点此链接进入后台系统</a></h1>"); Response.End(); } else { Response.Clear(); Response.Write("<script type='text/javascript'>location.href='/Default.aspx#" + s + "';</script><h1><a href='/Default.aspx#" + s + "'>页面会自动跳转到后台系统,如果没有自动跳转,则点此链接进入后台系统</a></h1>"); Response.End(); } } }
/// <summary> /// Returns the scalar type for the strings, decimals, uris, etc... /// </summary> /// <param name="type"></param> /// <param name="scalarType"></param> /// <returns></returns> public static bool TryGetBuiltInScalarType( Type type, [NotNullWhen(true)] out ScalarType?scalarType ) { if (type == typeof(string)) { scalarType = new StringType(); } else if (type == typeof(decimal)) { scalarType = new DecimalType(); } else if (type == typeof(int)) { scalarType = new IntType(); } else if (type == typeof(bool)) { scalarType = new BooleanType(); } else if (type == typeof(float)) { scalarType = new FloatType(); } else if (type == typeof(Guid)) { scalarType = new UuidType(); } else if (type == typeof(DateTime)) { scalarType = new DateTimeType(); } else if (type == typeof(byte)) { scalarType = new ByteType(); } else if (type == typeof(Uri)) { scalarType = new UrlType(); } else if (type == typeof(long)) { scalarType = new LongType(); } else if (type == typeof(short)) { scalarType = new ShortType(); } else { scalarType = null; } return(scalarType is object); }
public ObjectUrl(UrlType type, string path) { if (path == null) { throw new ArgumentException("path"); } Type = type; Path = path; }
public ObjectUrl(UrlType type, string path) { if (path is null) { throw new ArgumentException(nameof(path)); } Type = type; Path = path; }
public static string ApiURL(string component, UrlType urlType) { string apiUrl = Operations.ApiUrl(urlType); string apiFunc = "/measures/component?metricKeys="; List <MetricKeys> metricKeys = new KeyRepository().MetricKeys(); string url = Operations.UrlBuild(apiUrl, apiFunc, metricKeys, component); return(url); }
public UrlMarker (TextDocument doc, DocumentLine line, string url, UrlType urlType, string style, int startColumn, int endColumn) { this.doc = doc; this.line = line; this.url = url; this.urlType = urlType; this.style = style; this.startColumn = startColumn; this.endColumn = endColumn; doc.LineChanged += HandleDocLineChanged; }
/// <summary> /// 构造函数 /// </summary> /// <param name="_ButtonName">按钮名称</param> /// <param name="_ButtonUrl">按钮链接</param> /// <param name="_ButtonPopedom">按钮所属权限</param> /// <param name="_ButtonUrlType">按钮链接类型</param> /// <param name="_ButtonIcon">按钮Icon</param> /// <param name="_ButtonVisible">是否显示</param> public HeadMenuButtonItem(string _ButtonName, string _ButtonUrl, PopedomType _ButtonPopedom, UrlType _ButtonUrlType, string _ButtonIcon, bool _ButtonVisible ) { this._ButtonIcon = _ButtonIcon; this._ButtonName = _ButtonName; this._ButtonPopedom = _ButtonPopedom; this._ButtonUrl = _ButtonUrl; this._ButtonUrlType = _ButtonUrlType; this._ButtonVisible = _ButtonVisible; }
/// <exclude /> public PageUrlOptions(string dataScopeIdentifierName, CultureInfo locale, Guid pageId, UrlType urlType) { Verify.ArgumentNotNullOrEmpty(dataScopeIdentifierName, "dataScopeIdentifierName"); Verify.ArgumentNotNull(locale, "locale"); Verify.ArgumentCondition(pageId != Guid.Empty, "pageId", "PageId should not be an empty guid."); DataScopeIdentifierName = dataScopeIdentifierName; Locale = locale; PageId = pageId; UrlType = urlType; }
public static string UrlTypeName(UrlType e) { switch (e) { case UrlType.Topic: return AppConstants.TopicUrlIdentifier; case UrlType.Member: return AppConstants.MemberUrlIdentifier; case UrlType.Tag: return AppConstants.TagsUrlIdentifier; default: return AppConstants.CategoryUrlIdentifier; } }
private static string ModifyUrl(string outputUrl, UrlType outputUrlType) { if (outputUrlType == UrlType.S3) { return S3Helper.FormatUrl(outputUrl); } else { return outputUrl; } }
public Browser(UrlType type,Form next ) { InitializeComponent(); this.type = type; this.next = next; }
// default to local filesystem public static IBlobHandler GetHandler(UrlType urlType, string url) { if (DebugMode) { Console.WriteLine("GetHandler start"); } IBlobHandler blobHandler; switch (urlType) { case UrlType.Azure: blobHandler = new AzureHandler(url); break; case UrlType.AzureFile: blobHandler = new AzureFileHandler(url); break; case UrlType.S3: blobHandler = new S3Handler(url); break; case UrlType.SkyDrive: blobHandler = new SkyDriveHandler(url); break; case UrlType.Local: blobHandler = new FileSystemHandler(url); break; //case UrlType.Sharepoint: // blobHandler = new SharepointHandler(url); // break; case UrlType.Dropbox: blobHandler = new DropboxHandler(url); break; default: blobHandler = new FileSystemHandler(url); break; } if (DebugMode) { Console.WriteLine("GetHandler retrieved " + blobHandler.GetType().ToString()); } return blobHandler; }
/// <summary> /// 信息提示类 /// </summary> /// <param name="M_Type">类型1:操作日志2:安全日志</param> /// <param name="M_Title">标题</param> /// <param name="M_Body">内容</param> /// <param name="M_IconType">icon类型</param> /// <param name="M_WriteToDB">是否写入DB</param> /// <param name="Url">链接地址</param> /// <param name="M_UrlType">链接类型</param> /// <param name="ReturnScript">执行Script脚本字符串(需加<script></script>)</param> public static void MessageBox(int M_Type, string M_Title, string M_Body, Icon_Type M_IconType, bool M_WriteToDB, string Url, UrlType M_UrlType,string ReturnScript) { List<sys_NavigationUrl> M_ButtonList = new List<sys_NavigationUrl>(); M_ButtonList.Add(new sys_NavigationUrl("确定", Url, "", M_UrlType, true)); MessageBox(M_Type, M_Title, M_Body, M_IconType, M_WriteToDB, M_ButtonList,ReturnScript); }
public ObjectId ComputeInputHash(UrlType type, string filePath) { var hash = ObjectId.Empty; switch (type) { case UrlType.File: hash = builderContext.InputHashes.ComputeFileHash(filePath); break; case UrlType.ContentLink: case UrlType.Content: if (!buildTransaction.TryGetValue(filePath, out hash)) Logger.Warning("Location " + filePath + " does not exist currently and is required to compute the current command hash. The build cache will not work for this command!"); break; case UrlType.Virtual: var providerResult = VirtualFileSystem.ResolveProvider(filePath, true); var dbProvider = providerResult.Provider as DatabaseFileProvider; var microProvider = providerResult.Provider as MicroThreadFileProvider; if (microProvider != null) { dbProvider = microProvider.ThreadLocal.Value as DatabaseFileProvider; } if (dbProvider != null) { dbProvider.AssetIndexMap.TryGetValue(providerResult.Path, out hash); } break; } return hash; }
internal static bool UrlIs(string url, UrlType urlType) { return NativeMethods.UrlIs(url, urlType); }
public UrlMarker (LineSegment line, string url, UrlType urlType, string style, int startColumn, int endColumn) { this.line = line; this.url = url; this.urlType = urlType; this.style = style; this.startColumn = startColumn; this.endColumn = endColumn; }
public static string BasicUrl(UrlType type) { return getDataPath() + "/" + type.ToString(); }
/// <summary> /// Gets the URL for using in the ref field to link to a work item in MTM /// </summary> /// <param name="urlType">The type of url to construct</param> /// <param name="id">The id of the item (although in the case of a test result this is the ID of the run</param> /// <param name="runRelativeID">This is only for a test result and is the ID of the test result</param> /// <param name="projectName">The name of the team project</param> /// <returns>a formatted url string</returns> private string GetURL(UrlType urlType, int id, int runRelativeID, string projectName) { //URL format is: mtm://<server name>:<port>/<tfs vdir>/<Collection name>/p:<project name>/<center group>/<group specific> //An example is mtm://tfs2010:8080/tfs/DefaultCollection/p:BlogEngine.NET/testing/testplan/open?id=123 //test case = mtm://testServer/tfs/DefaultCollection/p:Woodgrove/testing/testcase/open?id=<ID> //test plan = mtm://testServer/tfs/DefaultCollection/p:Woodgrove/testing/testplan/connect?id=<ID> //test result = mtm://testServer/tfs/DefaultCollection/p:Woodgrove/testing/testresult/open?id=<runrelative ID>?runid=<run id> //test run = mtm://testServer/tfs/DefaultCollection/p:Woodgrove/testing/testrun/open?id=<run id> string server = _wis.TeamProjectCollection.Uri.ToString().Replace("http", "mtm"); //Returns http://[server]:[port]/tfs/[collection] - need to replace http with mtm string url = server + string.Format("/p:{0}/testing/", projectName); switch (urlType) { case UrlType.WorkItem: url += string.Format("/testcase/open?id={0}", id); break; case UrlType.TestPlan: url += string.Format("/testplan/connect?id={0}", id); break; case UrlType.TestRun: url += string.Format("/testrun/open?id={0}", id); break; case UrlType.TestResult: url += string.Format("/testresult/open?id={0}?runid={1}", runRelativeID, id); break; } return url; }
public static string BasicUrl(UrlType type, Langs lang) { string res = getDataPath() + "/" + type.ToString(); if (lang != Langs.no) res += "/" + lang.ToString(); return res; }
public static string BasicUrl(UrlType type, string url) { return BasicUrl(type) + "/" + url; }
public ObjectId ComputeInputHash(UrlType type, string filePath) { return commandContext.ComputeInputHash(type, filePath); }
public static UrlString BuildUrl(UrlType urlType, PageUrlOptions options) { Verify.ArgumentNotNull(options, "options"); Verify.ArgumentCondition(urlType != UrlType.Undefined, "urlType", "Url type is undefined"); if (urlType == UrlType.Public) { var lookupTable = PageStructureInfo.GetIdToUrlLookup(options.DataScopeIdentifierName, options.Locale); if (!lookupTable.ContainsKey(options.PageId)) { return null; } var publicUrl = new UrlString(lookupTable[options.PageId]); if(options.DataScopeIdentifierName != DataScopeIdentifier.GetDefault().Name) { publicUrl["dataScope"] = options.DataScopeIdentifierName; } return publicUrl; } if(urlType == UrlType.Internal) { string basePath = UrlUtils.ResolvePublicUrl("Renderers/Page.aspx"); var result = new UrlString(basePath); result["pageId"] = options.PageId.ToString(); result["cultureInfo"] = options.Locale.ToString(); result["dataScope"] = options.DataScopeIdentifierName; return result; } throw new NotImplementedException("BuildUrl function supports only 'Public' and 'Unternal' urls."); }
internal protected override ObjectId ComputeInputHash(UrlType type, string filePath) { return executeContext.ComputeInputHash(type, filePath); }
static void ParseArguments(string[] args) { var i = 0; if (args.Length > 0) { while (i < args.Length) { switch (args[i]) { case VersionFlag: Assembly Reference = typeof(azurecopy.AzureHandler).Assembly; Version Version = Reference.GetName().Version; Console.WriteLine(Version.ToString()); break; case ExampleFlag: _action = Action.Examples; break; case VerboseFlag: ConfigHelper.Verbose = true; break; case ParallelUploadFlag: i++; ConfigHelper.ParallelFactor = Convert.ToInt32(GetArgument(args, i)); break; case RetryAttemptDelayInSecondsFlag: i++; ConfigHelper.RetryAttemptDelayInSeconds = Convert.ToInt32(GetArgument(args, i)); break; case MaxRetryAttemptsFlag: i++; ConfigHelper.MaxRetryAttempts = Convert.ToInt32(GetArgument(args, i)); break; case ChunkSizeFlag: i++; ConfigHelper.ChunkSizeInMB = Convert.ToInt32(GetArgument(args, i)); break; case SkyDriveCodeFlag: i++; ConfigHelper.SkyDriveCode = GetArgument(args, i); break; // if we have this flag, then we simply want to redirect user to a given url. // then prompt for code (response from browser). Then save it to the app.config file. // will do similar for dropbox. case ConfigOneDriveFlag: ConfigureOneDrive(); break; // if we have this flag, then we simply want to redirect user to a given url. // then prompt for code (response from browser). Then save it to the app.config file. case ConfigDropboxFlag: ConfigureDropbox(); break; case DestBlobType: i++; var destType = GetArgument(args, i); if (destType == "page") { ConfigHelper.DestinationBlobTypeSelected = DestinationBlobType.Page; } else if (destType == "block") { ConfigHelper.DestinationBlobTypeSelected = DestinationBlobType.Block; } break; case MonitorBlobCopyFlag: ConfigHelper.MonitorBlobCopy = false; break; case BlobCopyFlag: ConfigHelper.UseBlobCopy = true; _action = Action.BlobCopy; break; case ListContainerBlobsFlag: i++; _inputUrl = GetArgument(args, i); _inputUrlType = GetUrlType(_inputUrl); // any modification of the URL (S3) _inputUrl = ModifyUrl(_inputUrl, _inputUrlType); _listContainer = true; _action = Action.List; break; case ListContainersFlag: i++; _inputUrl = GetArgument(args, i); _inputUrl = SanitizeUrl(_inputUrl); _inputUrlType = GetUrlType(_inputUrl); // any modification of the URL (S3) _inputUrl = ModifyUrl(_inputUrl, _inputUrlType); _listContainer = true; _action = Action.ListContainers; break; case MakeContainerFlag: i++; _inputUrl = GetArgument(args, i); _inputUrlType = GetUrlType(_inputUrl); _makeContainer = true; _action = Action.Make; break; case SharepointUsernameFlag: case SharepointUsernameShortFlag: i++; var username = GetArgument(args, i); ConfigHelper.SharepointUsername = username; break; case SharepointPasswordFlag: case SharepointPasswordShortFlag: i++; var password = GetArgument(args, i); ConfigHelper.SharepointPassword = password; break; case AzureAccountKeyFlag: case AzureAccountKeyShortFlag: i++; var azureKey = GetArgument(args, i); ConfigHelper.AzureAccountKey = azureKey; ConfigHelper.SrcAzureAccountKey = azureKey; ConfigHelper.TargetAzureAccountKey = azureKey; break; case AWSAccessKeyIDFlag: case AWSAccessKeyIDShortFlag: i++; var s3AccessKey = GetArgument(args, i); ConfigHelper.AWSAccessKeyID = s3AccessKey; ConfigHelper.SrcAWSAccessKeyID = s3AccessKey; ConfigHelper.TargetAWSAccessKeyID = s3AccessKey; break; case AWSSecretAccessKeyIDFlag: case AWSSecretAccessKeyIDShortFlag: i++; var s3SecretKey = GetArgument(args, i); ConfigHelper.AWSSecretAccessKeyID = s3SecretKey; ConfigHelper.SrcAWSSecretAccessKeyID = s3SecretKey; ConfigHelper.TargetAWSSecretAccessKeyID = s3SecretKey; break; case SourceAzureAccountKeyFlag: case SourceAzureAccountKeyShortFlag: i++; var srcAzureKey = GetArgument(args, i); ConfigHelper.SrcAzureAccountKey = srcAzureKey; break; case SourceAWSAccessKeyIDFlag: case SourceAWSAccessKeyIDShortFlag: i++; var srcS3AccessKey = GetArgument(args, i); ConfigHelper.SrcAWSAccessKeyID = srcS3AccessKey; break; case SourceAWSSecretAccessKeyIDFlag: case SourceAWSSecretAccessKeyIDShortFlag: i++; var srcS3SecretKey = GetArgument(args, i); ConfigHelper.SrcAWSSecretAccessKeyID = srcS3SecretKey; break; case TargetAzureAccountKeyFlag: case TargetAzureAccountKeyShortFlag: i++; var targetAzureKey = GetArgument(args, i); ConfigHelper.TargetAzureAccountKey = targetAzureKey; break; case TargetAWSAccessKeyIDFlag: case TargetAWSAccessKeyIDShortFlag: i++; var targetS3AccessKey = GetArgument(args, i); ConfigHelper.TargetAWSAccessKeyID = targetS3AccessKey; break; case TargetAWSSecretAccessKeyIDFlag: case TargetAWSSecretAccessKeyIDShortFlag: i++; var targetS3SecretKey = GetArgument(args, i); ConfigHelper.TargetAWSSecretAccessKeyID = targetS3SecretKey; break; case DebugFlag: DebugMode = true; break; case InputUrlFlag: i++; _inputUrl = GetArgument(args, i); _inputUrlType = GetUrlType(_inputUrl); // any modification of the URL (S3) _inputUrl = ModifyUrl(_inputUrl, _inputUrlType); if (_action == Action.None) { _action = Action.NormalCopy; } break; case OutputUrlFlag: i++; _outputUrl = GetArgument(args, i); _outputUrlType = GetUrlType(_outputUrl); // any modification of the URL (S3) _outputUrl = ModifyUrl(_outputUrl, _outputUrlType); if (_action == Action.None) { _action = Action.NormalCopy; } break; case DownloadFlag: i++; ConfigHelper.DownloadDirectory = GetArgument(args, i); ConfigHelper.AmDownloading = true; break; default: break; } i++; } } else { Console.WriteLine(UsageString); } }
public static string GenerateUrl(UrlType e, string slug) { return VirtualPathUtility.ToAbsolute(string.Format("~{0}{1}/{2}/", Dialogue.Settings().ForumRootUrl, UrlTypeName(e), HttpUtility.HtmlDecode(slug))); }
internal protected abstract ObjectId ComputeInputHash(UrlType type, string filePath);
public static string GenerateUrl(UrlType e) { return VirtualPathUtility.ToAbsolute(string.Format("~{0}", UrlTypeName(e))); }
public static IUrlTextLineMarker CreateUrlTextMarker (TextEditor editor, IDocumentLine line, string value, UrlType url, string syntax, int startCol, int endCol) { return editor.TextMarkerFactory.CreateUrlTextMarker (editor, line, value, url, syntax, startCol, endCol); }
public static string UrlTypeName(UrlType e) { switch (e) { case UrlType.Topic: return Dialogue.Settings().TopicUrlName; case UrlType.Member: return Dialogue.Settings().MemberUrlName; case UrlType.Login: return Dialogue.Settings().LoginUrl; case UrlType.Register: return Dialogue.Settings().RegisterUrl; case UrlType.TopicCreate: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlCreateTopic); case UrlType.EmailConfirmation: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlEmailConfirmation); case UrlType.Leaderboard: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlLeaderboard); case UrlType.Activity: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlActivity); case UrlType.TopicsRss: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlTopicsRss); case UrlType.ActivityRss: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlActivityRss); case UrlType.CategoryRss: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlCategoryRss); case UrlType.Badges: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlBadges); case UrlType.Favourites: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlFavourites); case UrlType.PostReport: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlPostReport); case UrlType.EditPost: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlEditPost); case UrlType.MessageInbox: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlMessageInbox); case UrlType.MessageOutbox: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlMessageOutbox); case UrlType.MessageCreate: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlCreatePrivateMessage); case UrlType.MessageView: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlViewPrivateMessage); case UrlType.ReportMember: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlViewReportMember); case UrlType.EditMember: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlEditMember); case UrlType.ChangePassword: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlChangePassword); case UrlType.Search: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlSearch); case UrlType.SpamOverview: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlSpamOverview); case UrlType.Authorise: return GenerateUrl(UrlType.Dialogue, AppConstants.PageUrlAuthorise); case UrlType.GoogleLogin: return VirtualPathUtility.ToAbsolute("~/umbraco/Surface/GoogleOAuthSurface/GoogleLogin"); case UrlType.FacebookLogin: return VirtualPathUtility.ToAbsolute("~/umbraco/Surface/FacebookOAuthSurface/FacebookLogin"); case UrlType.PostDelete: return VirtualPathUtility.ToAbsolute("~/umbraco/Surface/DialoguePostSurface/DeletePost"); case UrlType.FileDelete: return VirtualPathUtility.ToAbsolute("~/umbraco/Surface/DialogueUploadSurface/DeleteUploadedFile"); case UrlType.KillSpammer: return VirtualPathUtility.ToAbsolute("~/umbraco/Surface/DialogueMemberSurface/KillSpammer"); case UrlType.BanMember: return VirtualPathUtility.ToAbsolute("~/umbraco/Surface/DialogueMemberSurface/BanMember"); case UrlType.UnBanMember: return VirtualPathUtility.ToAbsolute("~/umbraco/Surface/DialogueMemberSurface/UnBanMember"); default: return Dialogue.Settings().DialogueUrlName; } }
public IEnumerable<Uri> GetResources(UrlType urlType, string baseUri) { return GetEnumerator(regs[(int)urlType], baseUri, this.htmlData); }
protected override ObjectId ComputeInputHash(UrlType type, string filePath) { return processBuilderRemote.ComputeInputHash(type, filePath); }
public static string GenerateUrl(UrlType e, string slug) { return VirtualPathUtility.ToAbsolute(string.Format("~/{0}/{1}/", UrlTypeName(e), HttpUtility.UrlEncode( HttpUtility.HtmlDecode(slug)) )); }
/// <summary> /// 信息提示类 /// </summary> /// <param name="M_Type">类型1:操作日志2:安全日志</param> /// <param name="M_Title">标题</param> /// <param name="M_Body">内容</param> /// <param name="M_IconType">Icon类型</param> /// <param name="Url">Url</param> /// <param name="M_UrlType">按钮链接类型</param> public static void MessageBox(int M_Type, string M_Title, string M_Body, Icon_Type M_IconType, string Url,UrlType M_UrlType) { MessageBox(M_Type, M_Title, M_Body, M_IconType, true, Url, M_UrlType,""); }