Exemple #1
0
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertAsync()
        {
            // Snippet: InsertAsync(string, InstanceTemplate, CallSettings)
            // Additional: InsertAsync(string, InstanceTemplate, CancellationToken)
            // Create client
            InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();

            // Initialize request argument(s)
            string           project = "";
            InstanceTemplate instanceTemplateResource = new InstanceTemplate();
            // Make the request
            lro::Operation <Operation, Operation> response = await instanceTemplatesClient.InsertAsync(project, instanceTemplateResource);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation <Operation, Operation> retrievedResponse = await instanceTemplatesClient.PollOnceInsertAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        /// <summary>
        /// Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.
        /// Documentation https://developers.google.com/compute/beta/reference/instanceTemplates/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="body">A valid Compute beta body.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Insert(ComputeService service, string project, InstanceTemplate body, InstanceTemplatesInsertOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }

                // Building the initial request.
                var request = service.InstanceTemplates.Insert(body, project);

                // Applying optional parameters to the request.
                request = (InstanceTemplatesResource.InsertRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request InstanceTemplates.Insert failed.", ex);
            }
        }
        /// <summary>
        /// Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.
        /// Documentation https://developers.google.com/compute/alpha/reference/instanceTemplates/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="body">A valid compute alpha body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Insert(computeService service, string project, InstanceTemplate body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }

                // Make the request.
                return(service.InstanceTemplates.Insert(body, project).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request InstanceTemplates.Insert failed.", ex);
            }
        }
Exemple #4
0
        public other_document()
        {
            InitializeComponent();

            //txt_gender.Choices = gender_choices;
            template = new InstanceTemplate();

            var args = new InstanceArgs("api/auth/users/", null, User.Api, "个人资料", Deleteable: false);

            args.margin = new Thickness(0, 10, 0, 10);
            args.items.Add(new InstanceArgs.Item("id", "用户名", "text"));
            args.items.Add(new InstanceArgs.Item("name", "姓名", "text"));
            args.items.Add(new InstanceArgs.Item("gender", "性别", "choice", data: gender_choices.ToArray()));
            args.items.Add(new InstanceArgs.Item("register_time", "注册时间", "text"));
            args.items.Add(new InstanceArgs.Item("last_login_time", "最近登录", "text"));

            template.Construct(args);
            ContentGrid.Children.Add(template);

            list_temp = new ListTemplate();
            var largs = new ListArgs(null, User.Api, "管理的班级");

            largs.columns.Add(new ListArgs.Column("id", "班级编号",
                                                  hyperlink: ListArgs.autohyperlink("class-instance").add("id").lambda));
            largs.columns.Add(new ListArgs.Column("name", "班级名称",
                                                  hyperlink: ListArgs.autohyperlink("class-instance").add("id").lambda));

            list_temp.Construct(largs);
            ListGrid.Children.Add(list_temp);
        }
        public async stt::Task GetRequestObjectAsync()
        {
            moq::Mock <InstanceTemplates.InstanceTemplatesClient> mockGrpcClient = new moq::Mock <InstanceTemplates.InstanceTemplatesClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetInstanceTemplateRequest request = new GetInstanceTemplateRequest
            {
                Project          = "projectaa6ff846",
                InstanceTemplate = "instance_template6cae3083",
            };
            InstanceTemplate expectedResponse = new InstanceTemplate
            {
                Id   = 11672635353343658936UL,
                Kind = "kindf7aa39d9",
                Name = "name1c9368b0",
                CreationTimestamp    = "creation_timestamp235e59a1",
                SourceInstanceParams = new SourceInstanceParams(),
                Properties           = new InstanceProperties(),
                SourceInstance       = "source_instancea8512e83",
                Description          = "description2cf9da67",
                SelfLink             = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <InstanceTemplate>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            InstanceTemplatesClient client = new InstanceTemplatesClientImpl(mockGrpcClient.Object, null);
            InstanceTemplate        responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            InstanceTemplate responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void Get()
        {
            moq::Mock <InstanceTemplates.InstanceTemplatesClient> mockGrpcClient = new moq::Mock <InstanceTemplates.InstanceTemplatesClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetInstanceTemplateRequest request = new GetInstanceTemplateRequest
            {
                Project          = "projectaa6ff846",
                InstanceTemplate = "instance_template6cae3083",
            };
            InstanceTemplate expectedResponse = new InstanceTemplate
            {
                Id   = 11672635353343658936UL,
                Kind = "kindf7aa39d9",
                Name = "name1c9368b0",
                CreationTimestamp    = "creation_timestamp235e59a1",
                SourceInstanceParams = new SourceInstanceParams(),
                Properties           = new InstanceProperties(),
                SourceInstance       = "source_instancea8512e83",
                Description          = "description2cf9da67",
                SelfLink             = "self_link7e87f12d",
            };

            mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            InstanceTemplatesClient client   = new InstanceTemplatesClientImpl(mockGrpcClient.Object, null);
            InstanceTemplate        response = client.Get(request.Project, request.InstanceTemplate);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemple #7
0
        public instance()
        {
            InitializeComponent();

            template = new InstanceTemplate();
            var args = new InstanceArgs("api/classrooms/basic/", null, User.Api, Title,
                                        Margin: new Thickness(0, 10, 0, 10));

            args.items.Add(new InstanceArgs.Item("id", "教室编号", "text"));
            args.items.Add(new InstanceArgs.Item("name", "教室名称", "text"));
            args.items.Add(new InstanceArgs.Item("size", "教室大小", "text"));
            template.Construct(args);
            ContentGrid.Children.Add(template);

            list_temp = new ListTemplate();
            var largs = new ListArgs("api/record/classroom-records/", User.Api, "教室使用记录", Searchable: true);

            largs.columns.Add(new ListArgs.Column("id", "编号"));
            largs.columns.Add(new ListArgs.Column("student_name_related", "学生姓名",
                                                  hyperlink: ListArgs.autohyperlink("student-other-document").add("id", "student").lambda));
            largs.columns.Add(new ListArgs.Column("time_in", "进入时间"));
            largs.columns.Add(new ListArgs.Column("time_out", "离开时间"));
            list_temp.Construct(largs);
            //ListGrid.Children.Add(list_temp);
        }
Exemple #8
0
        internal void _Initialize(V8Engine v8EngineProxy, NativeFunctionTemplateProxy *nativeFunctionTemplateProxy)
        {
            if (v8EngineProxy == null)
            {
                throw new ArgumentNullException("v8EngineProxy");
            }

            if (nativeFunctionTemplateProxy == null)
            {
                throw new ArgumentNullException("nativeFunctionTemplateProxy");
            }

            _Engine = v8EngineProxy;

            _NativeFunctionTemplateProxy = nativeFunctionTemplateProxy;

            InstanceTemplate        = _Engine.CreateObjectTemplate <ObjectTemplate>();
            InstanceTemplate.Parent = this;
            InstanceTemplate._Initialize(_Engine, (NativeObjectTemplateProxy *)V8NetProxy.GetFunctionInstanceTemplateProxy(_NativeFunctionTemplateProxy));

            PrototypeTemplate        = _Engine.CreateObjectTemplate <ObjectTemplate>();
            PrototypeTemplate.Parent = this;
            PrototypeTemplate._Initialize(_Engine, (NativeObjectTemplateProxy *)V8NetProxy.GetFunctionPrototypeTemplateProxy(_NativeFunctionTemplateProxy));

            OnInitialized();
        }
        public self_document()
        {
            InitializeComponent();

            //txt_gender.Choices = gender_choices;
            template = new InstanceTemplate();

            var args = new InstanceArgs("api/auth/users/", User.Get().authentication.username, User.Api, "个人资料", Deleteable: false);

            args.margin = new Thickness(0, 10, 0, 10);
            args.items.Add(new InstanceArgs.Item("id", "用户名", "text"));
            args.items.Add(new InstanceArgs.Item("name", "姓名", "text", EditAbleStatus.Writeable));
            args.items.Add(new InstanceArgs.Item("gender", "性别", "choice", EditAbleStatus.Writeable, data: gender_choices));
            args.items.Add(new InstanceArgs.Item("register_time", "注册时间", "text"));
            args.items.Add(new InstanceArgs.Item("last_login_time", "最近登录", "text"));

            template.Construct(args);
            ContentGrid.Children.Add(template);

            template2 = new InstanceTemplate();
            var args2 = new InstanceArgs("api/auth/students/", User.Get().authentication.username, User.Api, "学生信息", Deleteable: false);

            args2.margin = new Thickness(0, 10, 0, 10);
            args2.items.Add(new InstanceArgs.Item("classs_name_related", "班级", "text"));
            args2.items.Add(new InstanceArgs.Item("course_name_related", "课程列表", "multitext"));
            template2.Construct(args2);
            ContentGrid2.Children.Add(template2);
        }
Exemple #10
0
        public instance()
        {
            InitializeComponent();

            template = new InstanceTemplate();
            var args = new InstanceArgs("api/classes/", null, User.Api, Title,
                                        Margin: new Thickness(0, 10, 0, 10));

            args.items.Add(new InstanceArgs.Item("id", "班级编号", "text"));
            args.items.Add(new InstanceArgs.Item("grade", "年级", "text"));
            args.items.Add(new InstanceArgs.Item("college", "学院", "text"));
            args.items.Add(new InstanceArgs.Item("major", "专业", "text"));
            args.items.Add(new InstanceArgs.Item("number", "班号", "text"));
            template.Construct(args);
            ContentGrid.Children.Add(template);

            list_temp = new ListTemplate();
            var largs = new ListArgs(null, User.Api, "学生列表");

            largs.columns.Add(new ListArgs.Column("id", "学号", customaction: HyperlinkToStudent));
            largs.columns.Add(new ListArgs.Column("name", "姓名", customaction: HyperlinkToStudent));
            list_temp.Construct(largs);
            ListGrid.Children.Add(list_temp);

            list_temp2 = new ListTemplate();
            var largs2 = new ListArgs(null, User.Api, "辅导员列表");

            largs2.columns.Add(new ListArgs.Column("id", "工号", customaction: HyperlinkToInstructor));
            largs2.columns.Add(new ListArgs.Column("name", "姓名", customaction: HyperlinkToInstructor));
            list_temp2.Construct(largs2);
            ListGrid2.Children.Add(list_temp2);
        }
Exemple #11
0
        private InstanceTemplate GetUserSettings()
        {
            InstanceTemplate match = this._model.TemplateSettings.UserSettings.FirstOrDefault(i =>
                                                                                              i.TemplateName == this._nodeDefinition.Connection.TemplateFileName &&
                                                                                              i.Connection.ParentKey == this._nodeDefinition.TemplateNode.IdsHierarchy
                                                                                              );

            return(match);
        }
Exemple #12
0
        protected NodeResultReader()
        {
            this._msSqlAuditor   = null;
            this._storageManager = null;

            this.GroupDefinition = null;
            this.TemplateNode    = null;
            this.Settings        = null;
        }
Exemple #13
0
        private frmUserSettingsNode()
        {
            this._model               = null;
            this._node                = null;
            this._nodeDefinition      = null;
            this._template            = null;
            this._userSettingsManager = null;

            InitializeComponent();
        }
Exemple #14
0
        public DataTable[] GetGroupSelectResultsFromServer(
            SqlProcessor sqlProcessor,
            InstanceInfo serverInstance,
            QueryInfo queryInfo,
            TemplateNodeQueryInfo query
            )
        {
            DataTable[] tables = null;
            ErrorInfo   error  = null;

            Debug.Assert(IsInstance);
            Debug.Assert(GroupQueries.Contains(query));

            var db = this._model.GetVaultProcessor(ConnectionGroup).CurrentStorage;

            InstanceTemplate settings = GetUserSettings();

            //looking for user settings for parameter values
            query.ReadParametersFrom(settings);

            try
            {
                tables = sqlProcessor.ExecuteSql(
                    serverInstance,
                    queryInfo,
                    GetDefaultDatabase(),
                    queryInfo.Parameters,
                    query.ParameterValues,
                    fromGroupSelect: true
                    );
            }
            catch (Exception ex)
            {
                error  = new ErrorInfo(ex);
                tables = null;
            }

            Int64?queryId = db.QueryGroupDirectory.GetQueryId(
                query.TemplateNode,
                query,
                serverInstance,
                DateTime.Now,
                false
                );

            db.SaveMeta(queryId, error, tables);

            if (tables != null && tables.Length < 0)
            {
                throw new InvalidTemplateException(query + " returned no recordsets.");
            }

            return(tables);
        }
 /// <summary>Snippet for Get</summary>
 public void Get()
 {
     // Snippet: Get(string, string, CallSettings)
     // Create client
     InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
     // Initialize request argument(s)
     string project          = "";
     string instanceTemplate = "";
     // Make the request
     InstanceTemplate response = instanceTemplatesClient.Get(project, instanceTemplate);
     // End snippet
 }
 /// <summary>Snippet for Insert</summary>
 public void Insert()
 {
     // Snippet: Insert(string, InstanceTemplate, CallSettings)
     // Create client
     InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
     // Initialize request argument(s)
     string           project = "";
     InstanceTemplate instanceTemplateResource = new InstanceTemplate();
     // Make the request
     Operation response = instanceTemplatesClient.Insert(project, instanceTemplateResource);
     // End snippet
 }
Exemple #17
0
 public void FinalizeDataHolder()
 {
     if (RepopPosition == new Vector3())
     {
         RepopMapId = MapId.End;
     }
     if (!IsInstance)
     {
         return;
     }
     InstanceTemplate = new InstanceTemplate(this);
     InstanceMgr.InstanceInfos.Add(this);
 }
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetInstanceTemplateRequest, CallSettings)
     // Create client
     InstanceTemplatesClient instanceTemplatesClient = InstanceTemplatesClient.Create();
     // Initialize request argument(s)
     GetInstanceTemplateRequest request = new GetInstanceTemplateRequest
     {
         Project          = "",
         InstanceTemplate = "",
     };
     // Make the request
     InstanceTemplate response = instanceTemplatesClient.Get(request);
     // End snippet
 }
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetAsync()
        {
            // Snippet: GetAsync(string, string, CallSettings)
            // Additional: GetAsync(string, string, CancellationToken)
            // Create client
            InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();

            // Initialize request argument(s)
            string project          = "";
            string instanceTemplate = "";
            // Make the request
            InstanceTemplate response = await instanceTemplatesClient.GetAsync(project, instanceTemplate);

            // End snippet
        }
        /// <summary>Snippet for InsertAsync</summary>
        public async Task InsertAsync()
        {
            // Snippet: InsertAsync(string, InstanceTemplate, CallSettings)
            // Additional: InsertAsync(string, InstanceTemplate, CancellationToken)
            // Create client
            InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();

            // Initialize request argument(s)
            string           project = "";
            InstanceTemplate instanceTemplateResource = new InstanceTemplate();
            // Make the request
            Operation response = await instanceTemplatesClient.InsertAsync(project, instanceTemplateResource);

            // End snippet
        }
Exemple #21
0
        public admin_schedule_instance()
        {
            InitializeComponent();
            //生成概要信息区域
            template = new InstanceTemplate();
            var args = new InstanceArgs("api/schedule/system-schedules/", null, User.Api, Title);

            args.margin = new Thickness(0, 10, 0, 10);
            args.items.Add(new InstanceArgs.Item("id", "编号", "text"));
            args.items.Add(new InstanceArgs.Item("year", "学年", "text", EditAbleStatus.Writeable));
            args.items.Add(new InstanceArgs.Item("term", "学期", "text", EditAbleStatus.Writeable));
            args.items.Add(new InstanceArgs.Item("begin", "开始时间", "text", EditAbleStatus.Writeable));
            args.items.Add(new InstanceArgs.Item("end", "结束时间", "text", EditAbleStatus.Writeable));
            template.Construct(args);
            ContentGrid.Children.Add(template);
            //生成列表区域
            list_temp = new ListTemplate();
            var clargs = new CreateArgs("api/schedule/system-schedule-items/", User.Api, "创建时间表项");

            clargs.items.Add(new CreateArgs.Item("no", "节次", "text"));
            clargs.items.Add(new CreateArgs.Item("begin", "上课时间", "text"));
            clargs.items.Add(new CreateArgs.Item("end", "下课时间", "text"));
            clargs.items.Add(new CreateArgs.Item("system_schedule", "系统时间表", "hidden", data: "system_schedule"));

            var largs = new ListArgs("api/schedule/system-schedule-items/", User.Api, "时间表项", Createable: true, Createargs: clargs);

            largs.columns.Add(new ListArgs.Column("id", "编号", customaction: UpdateScheduleItemInstance));
            largs.columns.Add(new ListArgs.Column("no", "节次", customaction: UpdateScheduleItemInstance));
            largs.columns.Add(new ListArgs.Column("begin", "上课时间"));
            largs.columns.Add(new ListArgs.Column("end", "下课时间"));

            list_temp.Construct(largs);
            ListGrid.Children.Add(list_temp);
            //生成项的详情区域
            instance_temp = new InstanceTemplate();
            var iargs = new InstanceArgs("api/schedule/system-schedule-items/", null, User.Api, "表项信息");

            iargs.items.Add(new InstanceArgs.Item("id", "编号", "text"));
            iargs.items.Add(new InstanceArgs.Item("no", "节次", "text", EditAbleStatus.Writeable));
            iargs.items.Add(new InstanceArgs.Item("begin", "上课时间", "text", EditAbleStatus.Writeable));
            iargs.items.Add(new InstanceArgs.Item("end", "下课时间", "text", EditAbleStatus.Writeable));
            iargs.deleteaction = () => {       //当按下子项的删除按钮时
                InstanceGrid.Children.Clear(); //仅仅是不显示该区域。
                list_temp.UpdateData();        //刷新列表。
            };

            instance_temp.Construct(iargs);
        }
        public modify()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.CourseManage)
            };
            template = new InstanceTemplate();
            var args = new InstanceArgs("api/courses/basic/", null, User.Api, Title, Onlywrite: true);

            args.items.Add(new InstanceArgs.Item("id", "课程编号", "text"));
            args.items.Add(new InstanceArgs.Item("name", "课程名称", "text"));
            args.items.Add(new InstanceArgs.Item("teacher", "教师(工号)", "text"));
            args.items.Add(new InstanceArgs.Item("as_student_set", "学生(工号)", "multitext"));
            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Exemple #23
0
        public manager_document()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.StudentManage)
            };

            //txt_gender.Choices = gender_choices;
            template = new InstanceTemplate();

            var args = new InstanceArgs("api/auth/users/", null, User.Api, Title, Deleteable: true, Onlywrite: true);

            args.margin = new Thickness(0, 10, 0, 10);
            args.items.Add(new InstanceArgs.Item("name", "姓名", "text"));
            args.items.Add(new InstanceArgs.Item("gender", "性别", "choice", data: gender_choices.ToArray()));
            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
        /// <summary>Snippet for GetAsync</summary>
        public async Task GetRequestObjectAsync()
        {
            // Snippet: GetAsync(GetInstanceTemplateRequest, CallSettings)
            // Additional: GetAsync(GetInstanceTemplateRequest, CancellationToken)
            // Create client
            InstanceTemplatesClient instanceTemplatesClient = await InstanceTemplatesClient.CreateAsync();

            // Initialize request argument(s)
            GetInstanceTemplateRequest request = new GetInstanceTemplateRequest
            {
                Project          = "",
                InstanceTemplate = "",
            };
            // Make the request
            InstanceTemplate response = await instanceTemplatesClient.GetAsync(request);

            // End snippet
        }
        public void ReadParametersFrom(InstanceTemplate settings)
        {
            if (settings != null)
            {
                var querySettings = settings.Connection.Activity.Parameters
                                    .Where(i => i.Key == IdsHierarchy && i.Type == ParameterInfoType.Parameter && i.Value != null);

                foreach (var parameterInfo in querySettings)
                {
                    var parameter = ParameterValues.FirstOrDefault(p => p.Name == parameterInfo.Parameter);

                    if (parameter != null)
                    {
                        parameter.UserValue = parameterInfo.Value;
                    }
                }
            }
        }
        public other_document()
        {
            InitializeComponent();

            //txt_gender.Choices = gender_choices;
            template = new InstanceTemplate();

            var args = new InstanceArgs("api/auth/users/", null, User.Api, "个人资料", Deleteable: false);

            args.margin = new Thickness(0, 10, 0, 10);
            args.items.Add(new InstanceArgs.Item("id", "用户名", "text"));
            args.items.Add(new InstanceArgs.Item("name", "姓名", "text"));
            args.items.Add(new InstanceArgs.Item("gender", "性别", "choice", data: gender_choices.ToArray()));
            args.items.Add(new InstanceArgs.Item("register_time", "注册时间", "text"));
            args.items.Add(new InstanceArgs.Item("last_login_time", "最近登录", "text"));

            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Exemple #27
0
        public modify()
        {
            InitializeComponent();
            default_auth = new AuthSetting[] {
                new AuthSetting(Authority.ClassManage)
            };
            template = new InstanceTemplate();
            var args = new InstanceArgs("api/classes/", null, User.Api, Title, Onlywrite: true);

            args.items.Add(new InstanceArgs.Item("id", "班级编号", "text"));
            args.items.Add(new InstanceArgs.Item("grade", "年级", "text"));
            args.items.Add(new InstanceArgs.Item("college", "学院", "text"));
            args.items.Add(new InstanceArgs.Item("major", "专业", "text"));
            args.items.Add(new InstanceArgs.Item("number", "班号", "text"));
            args.items.Add(new InstanceArgs.Item("as_instructor_set", "辅导员(工号)", "multitext"));
            args.items.Add(new InstanceArgs.Item("as_student_set", "学生(学号)", "multitext"));
            template.Construct(args);
            ContentGrid.Children.Add(template);
        }
Exemple #28
0
        private InstanceTemplate GetUserSettings(bool createIfNotExists = false)
        {
            var existing = Program.Model.TemplateSettings.UserSettings.FirstOrDefault(
                i => i.TemplateName == ConnectionGroup.TemplateFileName &&
                i.Connection.ParentKey == IdsHierarchy
                );

            if (existing == null && createIfNotExists)
            {
                existing = new InstanceTemplate
                {
                    TemplateName = ConnectionGroup.TemplateFileName,
                    Connection   = { ParentKey = IdsHierarchy }
                };

                Program.Model.TemplateSettings.UserSettings.Add(existing);
            }

            return(existing);
        }
Exemple #29
0
        public void FinalizeDataHolder()
        {
            //if (NormalResetDelay > 0 && HeroicResetDelay == 0)
            //{
            //    HeroicResetDelay = NormalResetDelay;
            //}

            if (RepopPosition == default(Vector3))
            {
                RepopMapId = MapId.End;
            }

            if (IsInstance)
            {
                InstanceTemplate = new InstanceTemplate(this);
                InstanceMgr.InstanceInfos.Add(this);
            }

            //ArrayUtil.Set(ref World.s_mapInfos, (uint)Id, this);
        }
Exemple #30
0
        public frmUserSettingsNode(MsSqlAuditorModel model, TreeNode node) : this()
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            this._node           = node;
            this._nodeDefinition = node.Tag as ConcreteTemplateNodeDefinition;

            if (this._nodeDefinition == null)
            {
                throw new ArgumentException("Template is not specified for the node.");
            }

            this._model               = model;
            this._template            = GetUserSettings();
            this._userSettingsManager = new UserSettingsManager(
                this._model.Settings.InterfaceLanguage
                );
        }