internal bool AddTo(Microsoft.Web.Administration.BindingCollection collection) { string bindingInformation = "*:" + _port + ":" + _hostName; Microsoft.Web.Administration.Binding existingBinding = collection.SingleOrDefault(b => b.BindingInformation.Equals(bindingInformation, StringComparison.InvariantCultureIgnoreCase)); bool changed = false; if (existingBinding != null) { if (existingBinding.Protocol != _protocol) { existingBinding.Protocol = _protocol; changed = true; } if (existingBinding.BindingInformation != bindingInformation) { existingBinding.BindingInformation = bindingInformation; changed = true; } } else { collection.Add(bindingInformation, _protocol); changed = true; } return changed; }
public static void AddLBpaths(Microsoft.VisualBasic.Collection data) { ContentAPI apiCont = new ContentAPI(); Ektron.Cms.Library.EkLibrary objLib; int lbICount; int lbFCount; Collection lb; Collection cLbs; lbICount = 0; lbFCount = 0; objLib = apiCont.EkLibraryRef; cLbs = objLib.GetAllLBPaths("images"); if (cLbs.Count > 0) { foreach (Collection tempLoopVar_lb in cLbs) { lb = tempLoopVar_lb; lbICount++; data.Add(HttpContext.Current.Server.MapPath((string)(lb["LoadBalancePath"])), (string)("LoadBalanceImagePath_" + lbICount), null, null); } } data.Add(lbICount, "LoadBalanceImageCount", null, null); cLbs = null; lb = null; cLbs = objLib.GetAllLBPaths("files"); if (cLbs.Count > 0) { foreach (Collection tempLoopVar_lb in cLbs) { lb = tempLoopVar_lb; lbFCount++; data.Add(HttpContext.Current.Server.MapPath((string)(lb["LoadBalancePath"])), (string)("LoadBalanceFilePath_" + lbFCount), null, null); } } data.Add(lbFCount, "LoadBalanceFileCount", null, null); cLbs = null; }
/// <summary> /// ��ʼ��TreeView �� RootNode /// </summary> private void InitTreeRootNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC) { DataView dataView = new DataView(); dataView = dataTbl1.Copy().DefaultView; dataView.RowFilter = "ClassParentID = ClassID"; foreach(DataRowView drv in dataView) { Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode(); tn.ID = drv["ClassID"].ToString(); tn.Text = drv["ClassName"].ToString(); tn.ImageUrl = GetIcon(drv["ClassType"].ToString(),_imagepath); //tn.NavigateUrl = "# onclick='alert('dddd')'"; //tn.Target = "self"; TNC.Add(tn); InitChildNodeDataTable(Int32.Parse(tn.ID.ToString())); InitTreeChildNode(tn.Nodes,tn.ID); } dataTbl1 = null; dataTbl2 = null; }
/// <summary> /// ��ʼ��TreeView �� ChildNode /// </summary> private void InitTreeChildNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC, string classParentID) { DataView dataView = new DataView(); dataView = dataTbl2.Copy().DefaultView ; dataView.RowFilter = "ClassParentID = " + classParentID + ""; foreach(DataRowView drv in dataView) { Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode(); tn.ID = drv["ClassID"].ToString(); tn.Text = drv["ClassName"].ToString(); tn.ImageUrl = GetIcon(drv["ClassType"].ToString(),_imagepath); //tn.NavigateUrl = "#"; //tn.Target = "parent"; TNC.Add(tn); InitTreeChildNode(tn.Nodes,tn.ID); } }
private IFeatureClass FindFeatureClassByName(IWorkspace workspace, string name, Microsoft.VisualBasic.Collection colFCByName) { IFeatureClass esriFeatureClass = null; try { // try to retrieve FeatureClass in collection esriFeatureClass = (IFeatureClass)colFCByName[name]; return esriFeatureClass; } catch { } IEnumDataset enumDatasets; IDataset esriDataset; IFeatureClassContainer featContainer; // get datasets enumDatasets = workspace.get_Datasets(esriDatasetType.esriDTFeatureDataset); enumDatasets.Reset(); esriDataset = enumDatasets.Next(); while (esriDataset != null) { // try to find class in dataset try { featContainer = (IFeatureClassContainer)esriDataset; // get FeatureClass from current dataset esriFeatureClass = featContainer.get_ClassByName(name); if (esriFeatureClass != null) { // if exists add to collection and quit colFCByName.Add(esriFeatureClass, name, null, null); return esriFeatureClass; } } catch { } // try another dataset esriDataset = enumDatasets.Next(); } try { // try to find FeatureClass in workspace featContainer = (IFeatureClassContainer)workspace; esriFeatureClass = featContainer.get_ClassByName(name); if (esriFeatureClass != null) { // if exists add to collection and quit colFCByName.Add(esriFeatureClass, name, null, null); return esriFeatureClass; } } catch { } return null; }
/// <summary> /// ��ʼ��TreeView �� RootNode /// </summary> private void InitTreeRootNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC) { DataView dataView = new DataView(); dataView = dataTbl1.Copy().DefaultView; dataView.RowFilter = "Super_Position_ID = Position_ID"; foreach (DataRowView drv in dataView) { Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode(); tn.ID = drv["Position_ID"].ToString(); tn.Text = "<span onmouseover=javascript:title='" + drv["Position_Description"].ToString() + "'>" + drv["Position_Name"].ToString() + "</span>"; tn.ImageUrl = GetIcon("8"); tn.NavigateUrl = "ListView.aspx?PositionID=" + tn.ID; tn.Target = "MainFrame"; TNC.Add(tn); InitChildNodeDataTable(Int32.Parse(tn.ID.ToString())); InitTreeChildNode(tn.Nodes, tn.ID); } dataTbl1 = null; dataTbl2 = null; }
protected override SPField CreateField(Microsoft.SharePoint.SPFieldCollection fieldCollection) { TaxonomyField field = (TaxonomyField)fieldCollection.CreateNewField(FieldType, Name); fieldCollection.Add(field); return fieldCollection[Name]; }
/// <summary> /// ��ʼ��TreeView �� RootNode /// </summary> private void InitTreeRootNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC) { DataView dataView = new DataView(); dataView = dataTbl1.Copy().DefaultView; // dataView.RowFilter = "ClassParentID = ClassID"; foreach(DataRowView drv in dataView) { Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode(); tn.ID = drv["ClassID"].ToString(); tn.Text = "<span onmousemove=javascript:title='"+drv["ClassName"]+"'>"+drv["ClassName"].ToString()+"</span>"; //tn.ImageUrl = GetIcon(drv["ClassType"].ToString()); tn.NavigateUrl = "Switch.aspx?Action=1&ClassID="+drv["ClassID"].ToString(); tn.Target = "MainFrame"; TNC.Add(tn); InitChildNodeDataTable(Int32.Parse(tn.ID.ToString())); InitTreeChildNode(tn.Nodes,tn.ID); } dataTbl1 = null; dataTbl2 = null; }
/// <summary> /// ��ʼ��TreeView �� RootNode /// </summary> private void InitTreeRootNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC) { DataView dataView = new DataView(); dataView = dataTbl1.Copy().DefaultView; // dataView.RowFilter = "ClassParentID = ClassID"; foreach(DataRowView drv in dataView) { Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode(); tn.ID = drv["ClassID"].ToString(); tn.Text = "<span onmousemove=javascript:title='"+drv["ClassName"]+"'>"+drv["ClassName"].ToString()+"</span>"; tn.ImageUrl = GetIcon(drv["ClassType"].ToString()); tn.NavigateUrl = "RightList.aspx?ClassID="+drv["ClassID"].ToString() + "&SrcID=" + SrcID.ToString() + "&DisplayType=" + DisplayType.ToString(); tn.Target = "RightList"; TNC.Add(tn); InitChildNodeDataTable(Int32.Parse(tn.ID.ToString())); InitTreeChildNode(tn.Nodes,tn.ID); } dataTbl1 = null; dataTbl2 = null; Microsoft.Web.UI.WebControls.TreeNode tnn = new Microsoft.Web.UI.WebControls.TreeNode(); tnn.ID = "0"; tnn.Text = "<span onmousemove=javascript:title='ȫ�ֶ���'>ȫ�ֶ���</span>"; tnn.ImageUrl = GetIcon("-1"); tnn.NavigateUrl = "RightList.aspx?ClassID=0&SrcID=" + SrcID.ToString() + "&DisplayType=" + DisplayType.ToString(); tnn.Target = "RightList"; TNC.Add(tnn); }
/// <summary> /// ��ʼ��TreeView �� ChildNode /// </summary> private void InitTreeChildNode(Microsoft.Web.UI.WebControls.TreeNodeCollection TNC, string classParentID) { DataView dataView = new DataView(); dataView = dataTbl2.Copy().DefaultView ; dataView.RowFilter = "ClassParentID = " + classParentID + ""; foreach(DataRowView drv in dataView) { Microsoft.Web.UI.WebControls.TreeNode tn = new Microsoft.Web.UI.WebControls.TreeNode(); tn.ID = drv["ClassID"].ToString(); tn.Text = "<span onmousemove=javascript:title='"+drv["ClassName"]+"'>"+drv["ClassName"].ToString()+"</span>"; tn.ImageUrl = GetIcon(drv["ClassType"].ToString()); tn.NavigateUrl = "RightList.aspx?ClassID="+drv["ClassID"].ToString() + "&SrcID=" + SrcID.ToString() + "&DisplayType=" + DisplayType.ToString(); tn.Target = "RightList"; TNC.Add(tn); InitTreeChildNode(tn.Nodes,tn.ID); } }
private void SetParameterValue(string parameterName, Microsoft.Practices.Prism.UriQuery query, double? value) { if (value.HasValue) { query.Add(parameterName, value.Value.ToString(CultureInfo.InvariantCulture)); } }