标签: auto-generate

在 C++ 中自动生成 ID

// AnE.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<conio.h>
#include<string.h>
#include<stdlib.h>
#include<iostream>
using namespace std;


// The maximum number of patients in queue
#define MAXPATIENTS 30


// define structure for patient information
struct patient

{
   char FirstName[50];
   char LastName[50];
   char ID[20];
};


// define class for queue
class queue
{
   public:
   queue (void);
   int RegisterPatien (patient p);
   int RegisterPatientAtBeginning (patient p);
   patient GetNextPatient (void);
   int CancelAll (patient * p);
   void OutputList (void);
   char DepartmentName[50]; …
Run Code Online (Sandbox Code Playgroud)

c++ auto-generate

1
推荐指数
1
解决办法
3万
查看次数

覆盖部分类中的抽象方法

我有一个名为的抽象类PersonAbstract.它有一个名为的抽象属性Age

abstract public int Age { get; set; }
Run Code Online (Sandbox Code Playgroud)

两个类调用CustomerEmployee扩展PersonAbstract.

CustomerEmployee使用Linq-to-SQL创建,因此它们具有自动生成的代码.

这两个的自动生成代码:

public int Age
{
   get
   {
      return this._age;
   }
   set
   {
      this._age = value;
   }
}
Run Code Online (Sandbox Code Playgroud)

我向部分类添加功能EmployeeCustomer使用它.

public partial class Employee: PersonAbstract
{
.....
Run Code Online (Sandbox Code Playgroud)

如何更改此结构,以便继承的类(EmployeeCustomer)使其person属性覆盖抽象类中的person属性而不触及自动生成的代码?

编辑:

问题是我希望两个类共享一些父类的代码.所以我一直在尝试在实现具有Age属性的接口和两个子类之间添加带有共享代码的抽象类.但该代码需要访问该Age属性.因此抽象类必须使用Age属性的抽象实例来实现接口,子类重写它.如果这不可能,我怎样才能达到预期的效果呢?

c# inheritance abstract-class partial-classes auto-generate

0
推荐指数
1
解决办法
1474
查看次数

在python中生成文件名

我感觉这个问题以前已经回答过很多次了,但我找不到任何东西。

我有一个脚本,它将文本作为命令行参数,然后生成包含文本的图像。它为在命令行中输入的每个单词生成图像,但我不知道如何保存它们。我想这样拯救他们;第一个图像将保存为 0001.png,第二个图像将保存为 0002.png 等等,我该怎么做?

python text file auto-generate python-3.x

0
推荐指数
1
解决办法
2710
查看次数

有没有办法让Python生成多个if语句?

我只需要在每个if语句中为每个数字添加+30.我需要其中的36个,有没有办法让乌龟在陈述或类似的东西上做得更多?我真的被卡住了,手动方式会很疯狂.

例如:

if 0 <= x <=30 and 0 <= y <= 30:
      turtle.drawsstuff

if 30 <= x <=60 and 0 <= y <= 60:

etc.
Run Code Online (Sandbox Code Playgroud)

python if-statement auto-generate

-2
推荐指数
1
解决办法
98
查看次数