当前位置: 首页>>代码示例>>C#>>正文


C# IWorkspace类代码示例

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


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


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