• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IWorkspace类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IWorkspace的典型用法代码示例。如果您正苦于以下问题:C# IWorkspace类的具体用法?C# IWorkspace怎么用?C# IWorkspace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IWorkspace类属于命名空间,在下文中一共展示了IWorkspace类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Folder

 public Folder(string name, IWorkspace workspace)
 {
     this.name = name;
     _workspace = workspace as Workspace;
     this.folders = new List<IFolder>();
     this.items = new List<IItem>();
 }
开发者ID:JadeHub,项目名称:Jade,代码行数:7,代码来源:Folder.cs


示例2: Execute

        public StringBuilder Execute(Dictionary<string, StringBuilder> values, IWorkspace theWorkspace)
        {
            try
            {

                Dev2Logger.Log.Info("Get Scheduled Resources");
                ObservableCollection<IScheduledResource> resources;
                using(var model = SchedulerFactory.CreateModel(GlobalConstants.SchedulerFolderId, SecurityWrapper))
                {
                    resources = model.GetScheduledResources();
                }

                var sb = new StringBuilder(JsonConvert.SerializeObject(resources, Formatting.Indented, new JsonSerializerSettings
                {
                    TypeNameHandling = TypeNameHandling.Objects,
                    TypeNameAssemblyFormat = FormatterAssemblyStyle.Simple
                }));
                return sb;
            }
            catch (Exception err)
            {
                Dev2Logger.Log.Error(err);
                throw;
            }
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:25,代码来源:GetScheduledResources.cs


示例3: CreateEntity

 private static Entity CreateEntity(IWorkspace workspace, string name, EntityType currentEntityType)
 {
     var entityName = name.ToLower().Trim();
     return workspace.Single<Entity>(x => x.Name.ToLower() == entityName) != null
         ? null
         : new Entity { Name = name, EntityTypeId = currentEntityType.Id };
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:7,代码来源:EntityCreator.cs


示例4: OperationalDatasetCollection

        public OperationalDatasetCollection(IWorkspace osdbWorkspace)
        {
            if (osdbWorkspace == null)
                throw new System.ArgumentNullException("osdbWorkspace");

            // Find the table and determine if this user can edit it
            ITable theTable = null;
            string theTableName = "";
            try
            {
                util.SystemDefaults theDefaults = new util.SystemDefaults();
                theTableName = OperationalDatasetCollection.TABLE_NAME;
                theTable = ((IFeatureWorkspace)osdbWorkspace).OpenTable(theTableName);
            }
            catch (Exception) {}

            if (theTable == null)
                throw new Exception("Could not open the QA parameters table '" + theTableName + "'");

            IDataset theDataset = theTable as IDataset;

            this._canRead = false;
            this._canWrite = false;

            int privs = util.PermissionsAnalyzer.Analyze(theDataset);
            this._canWrite = (privs == util.PermissionsAnalyzer.READWRITE_PERMISSION);
            this._canRead = (privs == util.PermissionsAnalyzer.READONLY_PERMISSION) || this._canWrite;

            if (this._canRead)
            {
                this.LoadNames(theTable);
                OperationalDatasetCollection._lightWeight = (ITableName)theDataset.FullName;
            }
        }
开发者ID:EAWCS1,项目名称:SUITT,代码行数:34,代码来源:OperationalDatasetCollection.cs


示例5: frmSheetMetaData

        public frmSheetMetaData(IWorkspace workSpace,OracleCommand oraCmd)
        {
            m_textBoxActive = new List<TextBox>();
            m_labelActive = new List<Label>();
            m_customField = new List<string>();

            InitializeComponent();
            m_textBox = new TextBox[9];
            m_textBox[0] = textBox24;
            m_textBox[1] = textBox18;
            m_textBox[2] = textBox20;
            m_textBox[3] = textBox16;
            m_textBox[4] = textBox15;
            m_textBox[5] = textBox17;
            m_textBox[6] = textBox21;
            m_textBox[7] = textBox19;
            m_textBox[8] = textBox14;

            m_label = new Label[9];
            m_label[0] = label26;
            m_label[1] = label20;
            m_label[2] = label25;
            m_label[3] = label18;
            m_label[4] = label17;
            m_label[5] = label19;
            m_label[6] = label24;
            m_label[7] = label21;
            m_label[8] = label16;

            this.m_workSpace = workSpace;
            m_gdata = new GDBData(this.m_workSpace);
            m_oraCmd = oraCmd;
            InitCustom();
        }
开发者ID:chinasio,项目名称:minegis,代码行数:34,代码来源:frmSheetMetaData.cs


示例6: Initialize

        public void Initialize(IWorkspace workspace)
        {
            Argument.IsNotNull(() => workspace);

            workspace.SetWorkspaceValue("AView.Width", 200d);
            workspace.SetWorkspaceValue("BView.Width", 200d);
        }
开发者ID:WildGums,项目名称:Orc.WorkspaceManagement,代码行数:7,代码来源:WorkspaceInitializer.cs


示例7: frmSelectBand

 public frmSelectBand(IMapControlDefault mapCon, IRasterLayer rasLayer, IWorkspace workSpace)
 {
     InitializeComponent();
     this.m_mapCon = mapCon;
     m_rasLayer = rasLayer;
     m_workSpace = workSpace;
 }
开发者ID:chinasio,项目名称:minegis,代码行数:7,代码来源:frmSelectBand.cs


示例8: Execute

        public StringBuilder Execute(Dictionary<string, StringBuilder> values, IWorkspace theWorkspace)
        {
            if(values == null)
            {
                throw new InvalidDataException("Empty values passed.");
            }

            StringBuilder settingsJson;
            values.TryGetValue("Settings", out settingsJson);
            if(settingsJson == null || settingsJson.Length == 0)
            {
                throw new InvalidDataException("Error: Unable to parse values.");
            }
            var serializer = new Dev2JsonSerializer();
            var result = new ExecuteMessage { HasError = false, Message = new StringBuilder() };
            try
            {
                var settings = serializer.Deserialize<Settings>(settingsJson.ToString());
                WriteSecuritySettings(theWorkspace, settings, result);
                WriteLoggingSettings(theWorkspace, settings, result);
            }
            catch (Exception ex)
            {
                Dev2Logger.Log.Error("Error writing settings.", ex);
                result.HasError = true;
                result.Message.AppendLine("Error writing settings.");
            }
            return serializer.SerializeToBuilder(result);
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:29,代码来源:SettingsWrite.cs


示例9: Execute

        /// <summary>
        /// Executes the service
        /// </summary>
        /// <param name="values">The values.</param>
        /// <param name="theWorkspace">The workspace.</param>
        /// <returns></returns>
        public StringBuilder Execute(Dictionary<string, StringBuilder> values, IWorkspace theWorkspace)
        {
            var serializer = new Dev2JsonSerializer();
            try
            {
                var res = new ExecuteMessage { HasError = false };
                if (values == null)
                {
                    throw new ArgumentNullException("values");
                }
                if (!values.ContainsKey("versionInfo"))
                {
// ReSharper disable NotResolvedInText
                    throw new ArgumentNullException("No resourceId was found in the incoming data");
// ReSharper restore NotResolvedInText
                }
               
                var version = serializer.Deserialize<IVersionInfo>(values["versionInfo"]);
                Dev2Logger.Log.Info("Get Version. " + version);
                var result = ServerVersionRepo.GetVersion(version);
                res.Message.Append(result);
                Dev2XamlCleaner dev2XamlCleaner = new Dev2XamlCleaner();
                res.Message = dev2XamlCleaner.StripNaughtyNamespaces(res.Message);


                return serializer.SerializeToBuilder(res);

            }
            catch (Exception e)
            {
                Dev2Logger.Log.Error(e);
                IExplorerRepositoryResult error = new ExplorerRepositoryResult(ExecStatus.Fail, e.Message);
                return serializer.SerializeToBuilder(error);
            }
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:41,代码来源:GetVersion.cs


示例10: BatchCreateMenuItems

        public IEnumerable<MenuItem> BatchCreateMenuItems(string[] values, IWorkspace workspace)
        {
            var ds = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;

            IList<MenuItem> result = new List<MenuItem>();
            if (values.Length > 0)
            {
                var currentCategory = Resources.Common;

                foreach (var item in values)
                {
                    if (item.StartsWith("#"))
                    {
                        currentCategory = item.Trim('#', ' ');
                    }
                    else if (item.Contains(" "))
                    {
                        IList<string> parts = new List<string>(item.Split(' '));
                        var price = ConvertToDecimal(parts[parts.Count - 1], ds);
                        parts.RemoveAt(parts.Count - 1);

                        var itemName = string.Join(" ", parts.ToArray());
                        var mi = MenuItem.Create();
                        mi.Name = itemName;
                        mi.Portions[0].Price.Amount = price;
                        mi.GroupCode = currentCategory;
                        workspace.Add(mi);
                        workspace.Add(mi.Portions[0]);
                        result.Add(mi);
                    }
                }
            }
            return result;
        }
开发者ID:basio,项目名称:veropos,代码行数:34,代码来源:DataCreationService.cs


示例11: GetALLCADbyWorkspace

 /// <summary>
 /// 直接添加所有层--通过IFeatureClassContainer
 /// </summary>
 /// <param name="mapControlDefault">地图控件</param>
 /// <param name="pFeatureWorkspace">要素工作空间</param>
 /// <param name="strFileName">文件名,包括后缀</param>
 public static void GetALLCADbyWorkspace(IMapControlDefault mapControlDefault,IWorkspace pCADWorkspace, string strFileName)
 {
     IFeatureWorkspace pFeatureWorkspace = pCADWorkspace as IFeatureWorkspace;
     IFeatureDataset pFeatureDataset = pFeatureWorkspace.OpenFeatureDataset(strFileName);
     IFeatureClassContainer pFeatureClassContainer = pFeatureDataset as IFeatureClassContainer;
     for (int i = 0; i < pFeatureClassContainer.ClassCount; i++)
     {
         IFeatureClass pFeatureClass = pFeatureClassContainer.get_Class(i);
         IFeatureLayer pFeatureLayer = null;
         if (pFeatureClass.FeatureType == esriFeatureType.esriFTAnnotation)
         {
             pFeatureLayer = new CadAnnotationLayerClass();
         }
         else
         {
             pFeatureLayer = new CadFeatureLayerClass();
         }
         if (pFeatureLayer != null)
         {
             pFeatureLayer.Name = pFeatureClass.AliasName;
             pFeatureLayer.FeatureClass = pFeatureClass;
             mapControlDefault.AddLayer(pFeatureLayer as ILayer, 0);
         }
     }
 }
开发者ID:Shen001,项目名称:AEWinForm,代码行数:31,代码来源:LoadDataHelper.cs


示例12: TnTableName

        //public static string LOAI_LOP_DULIEU
        //{
        //    get { return TnTableName._loaiLayer; }
        //    set { if (_loaiLayer == value) return; TnTableName._loaiLayer = value; }
        //}
        public TnTableName(IWorkspace workspace)
        {
            _workspace = workspace;

            //_tblDuongThua.InitIndex();
            //_tblTgdPnnDt.InitIndex();
        }
开发者ID:truonghinh,项目名称:TnX,代码行数:12,代码来源:TnTableName.cs


示例13: Execute

        public StringBuilder Execute(Dictionary<string, StringBuilder> values, IWorkspace theWorkspace)
        {
            var result = new ExecuteMessage { HasError = false };
            Dev2Logger.Log.Info("Delete Scheduled Resource Service");
            StringBuilder tmp;
            values.TryGetValue("Resource", out tmp);
            var serializer = new Dev2JsonSerializer();

            if (tmp != null)
            {
                var res = serializer.Deserialize<IScheduledResource>(tmp);
                Dev2Logger.Log.Info("Delete Scheduled Resource Service." +res);
                using(var model = SchedulerFactory.CreateModel(GlobalConstants.SchedulerFolderId, SecurityWrapper))
                {
                    model.DeleteSchedule(res);
                }
            }
            else
            {
                Dev2Logger.Log.Info("Delete Scheduled Resource Service. No Resource Selected");
                result.Message.Append("No Resource Selected");
                result.HasError = true;
            }
            return serializer.SerializeToBuilder(result);
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:25,代码来源:DeleteScheduledResource.cs


示例14: Execute

 public StringBuilder Execute(Dictionary<string, StringBuilder> values, IWorkspace theWorkspace)
 {
     IExplorerRepositoryResult item;
     var serializer = new Dev2JsonSerializer();
     try
     {
         if(values == null)
         {
             throw new ArgumentNullException("values");
         }               
         StringBuilder itemBeingDeleted;
         if(!values.TryGetValue("itemToDelete", out itemBeingDeleted))
         {
             throw new ArgumentException("itemToDelete value not supplied.");
         }
         var itemToDelete = serializer.Deserialize<ServerExplorerItem>(itemBeingDeleted);
         Dev2Logger.Log.Info("Delete Item Service."+itemToDelete);
         item = ServerExplorerRepo.DeleteItem(itemToDelete, GlobalConstants.ServerWorkspaceID);
     }
     catch(Exception e)
     {
         Dev2Logger.Log.Error("Delete Item Error" ,e);
         item = new ExplorerRepositoryResult(ExecStatus.Fail, e.Message);
     }
     return serializer.SerializeToBuilder(item);
 }
开发者ID:Robin--,项目名称:Warewolf,代码行数:26,代码来源:DeleteItemService.cs


示例15: EvaluateCheckin

 public CheckinPolicyEvaluationResult EvaluateCheckin(IWorkspace workspace, IPendingChange[] pendingChanges, string comment, ICheckinNote checkinNote, IEnumerable<IWorkItemCheckinInfo> workItemInfo)
 {
     var result = workspace.EvaluateCheckin(TfsCheckinEvaluationOptions.All, pendingChanges,
                                            pendingChanges, comment, null, checkinNote,
                                            workItemInfo);
     return new CheckinPolicyEvaluationResult(result);
 }
开发者ID:EdwinTai,项目名称:git-tfs,代码行数:7,代码来源:CheckinPolicyEvaluator.cs


示例16: IFeatureDataConverter_ConvertFeatureClass

        /// <summary>
        /// 将一个要素类从一个工作空间转移到另外一个工作空间
        /// 注意目标工作空间不能有改要素类,必须先清除  
        /// </summary>
        /// <params name="sourceWorkspace">源工作空间</params>
        /// <params name="targetWorkspace">目标工作空间</params>
        /// <params name="nameOfSourceFeatureClass">源要素类名</params>
        /// <params name="nameOfTargetFeatureClass">目标要素类名</params>
        public bool IFeatureDataConverter_ConvertFeatureClass(IWorkspace sourceWorkspace, IWorkspace targetWorkspace, string nameOfSourceFeatureClass, string nameOfTargetFeatureClass)
        {
            bool change = false;
            //create source workspace name
            IDataset sourceWorkspaceDataset = (IDataset)sourceWorkspace;
            IWorkspaceName sourceWorkspaceName = (IWorkspaceName)sourceWorkspaceDataset.FullName;
            //create source dataset name
            IFeatureClassName sourceFeatureClassName = new FeatureClassNameClass();
            IDatasetName sourceDatasetName = (IDatasetName)sourceFeatureClassName;
            sourceDatasetName.WorkspaceName = sourceWorkspaceName;
            sourceDatasetName.Name = nameOfSourceFeatureClass;
            //create target workspace name
            IDataset targetWorkspaceDataset = (IDataset)targetWorkspace;
            IWorkspaceName targetWorkspaceName = (IWorkspaceName)targetWorkspaceDataset.FullName;
            //create target dataset name
            IFeatureClassName targetFeatureClassName = new FeatureClassNameClass();
            IDatasetName targetDatasetName = (IDatasetName)targetFeatureClassName;
            targetDatasetName.WorkspaceName = targetWorkspaceName;
            targetDatasetName.Name = nameOfTargetFeatureClass;
            //Open input Featureclass to get field definitions.
            ESRI.ArcGIS.esriSystem.IName sourceName = (ESRI.ArcGIS.esriSystem.IName)sourceFeatureClassName;
            IFeatureClass sourceFeatureClass = (IFeatureClass)sourceName.Open();

            //Validate the field names because you are converting between different workspace types.
            IFieldChecker fieldChecker = new FieldCheckerClass();
            IFields targetFeatureClassFields;
            IFields sourceFeatureClassFields = sourceFeatureClass.Fields;
            IEnumFieldError enumFieldError;
            // Most importantly set the input and validate workspaces!
            fieldChecker.InputWorkspace = sourceWorkspace;
            fieldChecker.ValidateWorkspace = targetWorkspace;
            fieldChecker.Validate(sourceFeatureClassFields, out enumFieldError, out targetFeatureClassFields);
            // Loop through the output fields to find the geomerty field
            IField geometryField;
            for (int i = 0; i < targetFeatureClassFields.FieldCount; i++)
            {
                if (targetFeatureClassFields.get_Field(i).Type == esriFieldType.esriFieldTypeGeometry)
                {
                    geometryField = targetFeatureClassFields.get_Field(i);
                    // Get the geometry field's geometry defenition
                    IGeometryDef geometryDef = geometryField.GeometryDef;
                    //Give the geometry definition a spatial index grid count and grid size
                    IGeometryDefEdit targetFCGeoDefEdit = (IGeometryDefEdit)geometryDef;
                    targetFCGeoDefEdit.GridCount_2 = 1;
                    targetFCGeoDefEdit.set_GridSize(0, 0);
                    //Allow ArcGIS to determine a valid grid size for the data loaded
                    targetFCGeoDefEdit.SpatialReference_2 = geometryField.GeometryDef.SpatialReference;
                    // we want to convert all of the features
                    IQueryFilter queryFilter = new QueryFilterClass();
                    queryFilter.WhereClause = "";
                    // Load the feature class
                    IFeatureDataConverter fctofc = new FeatureDataConverterClass();
                    IEnumInvalidObject enumErrors = fctofc.ConvertFeatureClass(sourceFeatureClassName, queryFilter, null, targetFeatureClassName, geometryDef, targetFeatureClassFields, "", 1000, 0);
                    if (enumErrors.Next() == null)
                        change = true;
                    break;
                }
            }
            return change;
        }
开发者ID:ismethr,项目名称:gas-geological-map,代码行数:68,代码来源:FrmExploreToShape.cs


示例17: ApplyWorkspaceAsync

        public Task ApplyWorkspaceAsync(IWorkspace workspace)
        {
            ApplyWorkspace(workspace);

            return TaskHelper.Completed;

        }
开发者ID:llenroc,项目名称:Orc.WorkspaceManagement,代码行数:7,代码来源:WorkspaceProvider.cs


示例18: Execute

        public StringBuilder Execute(Dictionary<string, StringBuilder> values, IWorkspace theWorkspace)
        {
            try
            {

                Dev2Logger.Log.Info("Fetch Server Log Started");
                var result = new ExecuteMessage { HasError = false };
                if (File.Exists(_serverLogPath))
                {
                    var fileStream = File.Open(_serverLogPath, FileMode.Open, FileAccess.Read,FileShare.Read);
                    using (var streamReader = new StreamReader(fileStream))
                    {
                        while(!streamReader.EndOfStream)
                        {
                            result.Message.Append(streamReader.ReadLine());    
                        }
                    }
                }
                Dev2JsonSerializer serializer = new Dev2JsonSerializer();
                return serializer.SerializeToBuilder(result);
            }
            catch (Exception err)
            {
                Dev2Logger.Log.Error("Fetch Server Log Error", err);
                throw;
            }
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:27,代码来源:FetchCurrentServerLog.cs


示例19: Install

		public void Install(IWorkspace workspace)
		{
			// Add parts

			arGraph = new ActiveRecordGraphView(_model);
			arGraph.ParentWorkspace = workspace;

			outView = new OutputView(_model);
			outView.ParentWorkspace = workspace;

			projExplorer = new ProjectExplorer(_model);
			projExplorer.ParentWorkspace = workspace;

			avaShapes = new AvailableShapes(_model);
			avaShapes.ParentWorkspace = workspace;

			// Register Actions
			
			FileActionGroup group1 = new FileActionGroup();
			group1.Init(_model);
			group1.Install(workspace);

			ViewActionSet group2 = new ViewActionSet(arGraph, outView, projExplorer, avaShapes);
			group2.Init(_model);
			group2.Install(workspace);

			HelpActionSet group3 = new HelpActionSet();
			group3.Init(_model);
			group3.Install(workspace);

		}
开发者ID:ralescano,项目名称:castle,代码行数:31,代码来源:ARGeneratorLayout.cs


示例20: Execute

        public StringBuilder Execute(Dictionary<string, StringBuilder> values, IWorkspace theWorkspace)
        {
            try
            {


            string guidCsv = string.Empty;
            string type = null;

            StringBuilder tmp;
            values.TryGetValue("GuidCsv", out tmp);
            if(tmp != null)
            {
                guidCsv = tmp.ToString();
            }
            values.TryGetValue("ResourceType", out tmp);
            if(tmp != null)
            {
                type = tmp.ToString();
            }
            Dev2Logger.Log.Info("Find Resource By Id. "+guidCsv);
            // BUG 7850 - TWR - 2013.03.11 - ResourceCatalog refactor
            var resources = ResourceCatalog.Instance.GetResourceList(theWorkspace.ID, guidCsv, type);

            IList<SerializableResource> resourceList = resources.Select(new FindResourceHelper().SerializeResourceForStudio).ToList();

            Dev2JsonSerializer serializer = new Dev2JsonSerializer();
            return serializer.SerializeToBuilder(resourceList);
            }
            catch (Exception err)
            {
                Dev2Logger.Log.Error(err);
                throw;
            }
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:35,代码来源:FindResourcesByID.cs



注:本文中的IWorkspace类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IWorkspaceFileObject类代码示例发布时间:2022-05-24
下一篇:
C# IWorkflowMessageService类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap