| TITLE | INTERNAL NAME |
|---|---|
| Approval Status | _ModerationStatus |
| Approver Comments | _ModerationComments |
| Check In Comment | _CheckinComment |
| Checked Out To | CheckoutUser |
| Checked Out To | CheckedOutTitle |
| Checked Out To | LinkCheckedOutTitle |
| Content Type | ContentType |
| Content Type ID | ContentTypeId |
| Copy Source | _CopySource |
| Created | Created |
| Created | Created_x0020_Date |
| Created By | Author |
| Document Created By | Created_x0020_By |
| Document Modified By | Modified_x0020_By |
| Edit | Edit |
| Edit Menu Table End | _EditMenuTableEnd |
| Edit Menu Table Start | _EditMenuTableStart |
| Effective Permissions Mask | PermMask |
| Encoded Absolute URL | EncodedAbsUrl |
| File Size | File_x0020_Size |
| File Size | FileSizeDisplay |
| File Type | File_x0020_Type |
| GUID | GUID |
| Has Copy Destinations | _HasCopyDestinations |
| Html File Link | xd_ProgID |
| HTML File Type | HTML_x0020_File_x0020_Type |
| ID | ID |
| ID of the User who has the item Checked Out | CheckedOutUserId |
| Instance ID | InstanceID |
| Is Checked out to local | IsCheckedoutToLocal |
| Is Current Version | _IsCurrentVersion |
| Is Signed | xd_Signature |
| Item Type | FSObjType |
| Level | _Level |
| Merge | Combine |
| Modified | Modified |
| Modified | Last_x0020_Modified |
| Modified By | Editor |
| Name | FileLeafRef |
| Name | LinkFilenameNoMenu |
| Name | LinkFilename |
| Name | BaseName |
| Order | Order |
| owshiddenversion | owshiddenversion |
| Path | FileDirRef |
| ProgId | ProgId |
| Property Bag | MetaInfo |
| Relink | RepairDocument |
| ScopeId | ScopeId |
| Select | SelectTitle |
| Select | SelectFilename |
| Server Relative URL | ServerUrl |
| Shared File Index | _SharedFileIndex |
| Source Name (Converted Document) | ParentLeafName |
| Source Url | _SourceUrl |
| Source Version (Converted Document) | ParentVersionString |
| Template Link | TemplateUrl |
| Title | Title |
| Type | DocIcon |
| UI Version | _UIVersion |
| Unique Id | UniqueId |
| URL Path | FileRef |
| Version | _UIVersionString |
| Virus Status | VirusStatus |
| Workflow Instance ID | WorkflowInstanceID |
| Workflow Version | WorkflowVersion |
Tuesday, 16 January 2018
LIST OF INTERNAL NAMES FOR SHAREPOINT FIELDS
Wednesday, 27 December 2017
Useful ideas for working with SharePoint and MS files
For saving any MS file directly into our SharePoint site,
please refer this URL : https://support.office.com/en-us/article/Save-a-file-to-a-SharePoint-library-32204d9f-55ea-4232-a32b-aa7e046afcdd#__toc251675678
For saving files in your email attachments directly into
your document library, we need to configure : https://us.flow.microsoft.com/en-us/galleries/public/templates/f7a46809e53c42108034e56acf83bb79/save-my-email-attachments-to-a-sharepoint-document-library/
Wednesday, 13 December 2017
CRUD Operation in sharepoint using AngularJS
HTML PART
<link type="text/css" rel="stylesheet" href="/SiteAssets/bootstrap.min.css">
<script type="text/javascript" src="/SiteAssets/jquery.min.js"></script>
<script type="text/javascript" src="/SiteAssets/bootstrap.min.js"></script>
<script type="text/javascript" src="/SiteAssets/angular.js"></script>
<script type="text/javascript" src="/SiteAssets/SPCRUD.js"></script>
<div ng-app="spApp" style="width:50%">
<h3>View Employee Detail</h3>
<hr />
<div ng-controller="viewItemsController">
<table>
<thead>
<tr>
<th>S.No</th>
<th>Name</th>
<th>Age</th>
<th>Gender</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="employee in employees">
<td>{{employee.ID}}</td>
<td>{{employee.Name}}</td>
<td>{{employee.Age}}</td>
<td>{{employee.Gender}}</td>
<td>{{employee.Salary}}</td>
</tr>
</tbody>
</table>
</div>
<hr />
<h3>Add Employees</h3>
<div ng-controller="addItemsController">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-5" for="Ename">Employee Name :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Ename" ng-model="name" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Eage">Age :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Eage" ng-model="age" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Egen">Gender :</label>
<div class="col-sm-7">
<label><input type="radio" id="Emale" name="Egen" ng-model="gender" ng-value="'Male'">Male</label>
<label><input type="radio" id="EFemale" name="Egen" ng-model="gender" ng-value="'Female'">Female</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Esal">Salary :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Esal" ng-model="salary">
</div>
</div>
<div class="form-group">
<div class="col-sm-5">
</div>
<div class="col-sm-3">
<input type="button" class="btn btn-default form-control" id="btnAddEmployee" value="Add Employee" ng-click="addEmployee()">
</div>
</div>
</div>
</div>
<hr/>
<h3>Edit Employees</h3>
<div ng-controller="editItemsController">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-5" for="itemId">ID :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="itemId" ng-model="itemId">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Ename">Employee Name :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Ename" ng-model="name" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Eage">Age :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Eage" ng-model="age" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Egen">Gender :</label>
<div class="col-sm-7">
<label><input type="radio" id="Emale" name="Egen" ng-model="gender" ng-value="'Male'">Male</label>
<label><input type="radio" id="EFemale" name="Egen" ng-model="gender" ng-value="'Female'">Female</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Esal">Salary :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Esal" ng-model="salary">
</div>
</div>
<div class="form-group">
<div class="col-sm-5">
</div>
<div class="col-sm-3">
<input type="button" class="btn btn-default form-control" id="btnEditEmployee" value="Edit Employee" ng-click="editEmployee()">
</div>
</div>
</div>
</div>
<hr/>
<h3>Delete Employees</h3>
<div ng-controller="delItemsController">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-5" for="itemId">ID :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="itemId" ng-model="itemId">
</div>
</div>
<div class="form-group">
<div class="col-sm-5">
</div>
<div class="col-sm-3">
<input type="button" class="btn btn-default form-control" id="btnDelEmployee" value="Delete Employee" ng-click="delEmployee()">
</div>
</div>
</div>
</div>
</div>
Angular JS Part
/// <reference path="/SiteAssets/angular.js" />
var listName = "AngularCRUD";
var spApp = angular
.module("spApp", [])
.controller("viewItemsController", function ($scope, $http,$log) {
debugger;
var url = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('"+ listName +"')/items?$select=Name,Age,Gender,Salary,ID";
$http(
{
method: "GET",
url: url,
headers: { "accept": "application/json;odata=verbose" }
}
).then(function (response, status, headers, config) {
$scope.employees = response.data.d.results;
$log.info(response);
},function (reason, status, headers, config) {
});
})
.controller("addItemsController", function ($scope, $http) {
var url = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('"+ listName +"')/items";
var vm = $scope;
vm.addEmployee = function () {
debugger;
return $http({
headers: { "Accept": "application/json; odata=verbose", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val() },
method: "POST",
url: url,
data: {
'Name': vm.name,
'Age': vm.age,
'Gender': vm.gender,
'Salary': vm.salary
}
})
.then(saveEmployee)
.catch(function (message) {
console.log("addEmployee() error: " + message);
});
function saveEmployee(data, status, headers, config) {
alert("Item Added Successfully");
vm.name = "";
vm.age = "";
vm.gender = "";
vm.salary = "";
}
}
})
.controller("editItemsController", function ($scope, $http) {
debugger;
var vm = $scope;
vm.editEmployee = function () {
debugger;
var data = {
'__metadata': {
'type': 'SP.Data.'+ listName +'ListItem'
},
'Name': vm.name,
'Age': vm.age,
'Gender': vm.gender,
'Salary': vm.salary
};
return $http({
headers: {
"Accept": "application/json; odata=verbose",
"Content-Type": "application/json; odata=verbose",
"X-HTTP-Method": "MERGE",
"X-RequestDigest": document.getElementById("__REQUESTDIGEST").value,
"Content-Length": data.length,
'IF-MATCH': "*"
},
method: "POST",
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('"+ listName +"')/items(" + vm.itemId + ")",
data: data
})
.then(saveEmployee)
.catch(function (message) {
console.log("editEmployee() error: " + message);
});
function saveEmployee(data, status, headers, config) {
alert("Item Edited Successfully");
return data.data.d;
}
}
})
.controller("delItemsController", function ($scope, $http) {
var vm = $scope;
vm.delEmployee = function () {
return $http({
headers: {
"X-HTTP-Method": "DELETE",
"X-RequestDigest": document.getElementById("__REQUESTDIGEST").value,
'IF-MATCH': "*"
},
method: "POST",
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('"+ listName +"')/items(" + vm.itemId + ")"
})
.then(saveEmployee)
.catch(function (message) {
console.log("delEmployee() error: " + message);
});
function saveEmployee(data, status, headers, config) {
alert("Item Deleted Successfully");
return data.data.d;
}
}
});
<link type="text/css" rel="stylesheet" href="/SiteAssets/bootstrap.min.css">
<script type="text/javascript" src="/SiteAssets/jquery.min.js"></script>
<script type="text/javascript" src="/SiteAssets/bootstrap.min.js"></script>
<script type="text/javascript" src="/SiteAssets/angular.js"></script>
<script type="text/javascript" src="/SiteAssets/SPCRUD.js"></script>
<div ng-app="spApp" style="width:50%">
<h3>View Employee Detail</h3>
<hr />
<div ng-controller="viewItemsController">
<table>
<thead>
<tr>
<th>S.No</th>
<th>Name</th>
<th>Age</th>
<th>Gender</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="employee in employees">
<td>{{employee.ID}}</td>
<td>{{employee.Name}}</td>
<td>{{employee.Age}}</td>
<td>{{employee.Gender}}</td>
<td>{{employee.Salary}}</td>
</tr>
</tbody>
</table>
</div>
<hr />
<h3>Add Employees</h3>
<div ng-controller="addItemsController">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-5" for="Ename">Employee Name :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Ename" ng-model="name" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Eage">Age :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Eage" ng-model="age" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Egen">Gender :</label>
<div class="col-sm-7">
<label><input type="radio" id="Emale" name="Egen" ng-model="gender" ng-value="'Male'">Male</label>
<label><input type="radio" id="EFemale" name="Egen" ng-model="gender" ng-value="'Female'">Female</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Esal">Salary :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Esal" ng-model="salary">
</div>
</div>
<div class="form-group">
<div class="col-sm-5">
</div>
<div class="col-sm-3">
<input type="button" class="btn btn-default form-control" id="btnAddEmployee" value="Add Employee" ng-click="addEmployee()">
</div>
</div>
</div>
</div>
<hr/>
<h3>Edit Employees</h3>
<div ng-controller="editItemsController">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-5" for="itemId">ID :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="itemId" ng-model="itemId">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Ename">Employee Name :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Ename" ng-model="name" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Eage">Age :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Eage" ng-model="age" >
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Egen">Gender :</label>
<div class="col-sm-7">
<label><input type="radio" id="Emale" name="Egen" ng-model="gender" ng-value="'Male'">Male</label>
<label><input type="radio" id="EFemale" name="Egen" ng-model="gender" ng-value="'Female'">Female</label>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-5" for="Esal">Salary :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="Esal" ng-model="salary">
</div>
</div>
<div class="form-group">
<div class="col-sm-5">
</div>
<div class="col-sm-3">
<input type="button" class="btn btn-default form-control" id="btnEditEmployee" value="Edit Employee" ng-click="editEmployee()">
</div>
</div>
</div>
</div>
<hr/>
<h3>Delete Employees</h3>
<div ng-controller="delItemsController">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-5" for="itemId">ID :</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="itemId" ng-model="itemId">
</div>
</div>
<div class="form-group">
<div class="col-sm-5">
</div>
<div class="col-sm-3">
<input type="button" class="btn btn-default form-control" id="btnDelEmployee" value="Delete Employee" ng-click="delEmployee()">
</div>
</div>
</div>
</div>
</div>
Angular JS Part
/// <reference path="/SiteAssets/angular.js" />
var listName = "AngularCRUD";
var spApp = angular
.module("spApp", [])
.controller("viewItemsController", function ($scope, $http,$log) {
debugger;
var url = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('"+ listName +"')/items?$select=Name,Age,Gender,Salary,ID";
$http(
{
method: "GET",
url: url,
headers: { "accept": "application/json;odata=verbose" }
}
).then(function (response, status, headers, config) {
$scope.employees = response.data.d.results;
$log.info(response);
},function (reason, status, headers, config) {
});
})
.controller("addItemsController", function ($scope, $http) {
var url = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('"+ listName +"')/items";
var vm = $scope;
vm.addEmployee = function () {
debugger;
return $http({
headers: { "Accept": "application/json; odata=verbose", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val() },
method: "POST",
url: url,
data: {
'Name': vm.name,
'Age': vm.age,
'Gender': vm.gender,
'Salary': vm.salary
}
})
.then(saveEmployee)
.catch(function (message) {
console.log("addEmployee() error: " + message);
});
function saveEmployee(data, status, headers, config) {
alert("Item Added Successfully");
vm.name = "";
vm.age = "";
vm.gender = "";
vm.salary = "";
}
}
})
.controller("editItemsController", function ($scope, $http) {
debugger;
var vm = $scope;
vm.editEmployee = function () {
debugger;
var data = {
'__metadata': {
'type': 'SP.Data.'+ listName +'ListItem'
},
'Name': vm.name,
'Age': vm.age,
'Gender': vm.gender,
'Salary': vm.salary
};
return $http({
headers: {
"Accept": "application/json; odata=verbose",
"Content-Type": "application/json; odata=verbose",
"X-HTTP-Method": "MERGE",
"X-RequestDigest": document.getElementById("__REQUESTDIGEST").value,
"Content-Length": data.length,
'IF-MATCH': "*"
},
method: "POST",
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('"+ listName +"')/items(" + vm.itemId + ")",
data: data
})
.then(saveEmployee)
.catch(function (message) {
console.log("editEmployee() error: " + message);
});
function saveEmployee(data, status, headers, config) {
alert("Item Edited Successfully");
return data.data.d;
}
}
})
.controller("delItemsController", function ($scope, $http) {
var vm = $scope;
vm.delEmployee = function () {
return $http({
headers: {
"X-HTTP-Method": "DELETE",
"X-RequestDigest": document.getElementById("__REQUESTDIGEST").value,
'IF-MATCH': "*"
},
method: "POST",
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('"+ listName +"')/items(" + vm.itemId + ")"
})
.then(saveEmployee)
.catch(function (message) {
console.log("delEmployee() error: " + message);
});
function saveEmployee(data, status, headers, config) {
alert("Item Deleted Successfully");
return data.data.d;
}
}
});
Monday, 11 December 2017
Format code shortcut for Visual Studio?
To answer the specific question, in C# you are likely to be using the C# keyboard mapping scheme, which will use these hotkeys by default:
Ctrl+E, Ctrl+D to format the entire document.
Ctrl+E, Ctrl+F to format the selection.
You can change these in Tools > Options > Environment -> Keyboard (either by selecting a different "keyboard mapping scheme", or binding individual keys to the commands "Edit.FormatDocument" and "Edit.FormatSelection").
If you have not chosen to use the C# keyboard mapping scheme, then you may find the key shortcuts are different. For example, if you are not using the C# bindings, the keys are likely to be:
Ctrl + K + D (Entire document)
Ctrl + K + F (Selection only)
To find out which key bindings apply in YOUR copy of Visual Studio, look in the Edit > Advanced menu - the keys are displayed to the right of the menu items, so it's easy to discover what they are on your system.
For various sharepoint doubts
Please refer: http://sharepoint112.blogspot.in/
Access Modifiers And Default Access Modifiers In C#
We have the following access modifiers available in C#.
- Public
- Private
- Protected
- Internal
- Protected Internal
How to choose the appropriate access modifiers in our application is a big hurdle. Let’s try to find out the solution through few of the small implementations.
| Level of Implementation/Access modifiers types | At Namespace level | At class Level At function level |
| Public | yes | yes |
| Private | No | yes |
| Protected | No | yes |
| Internal | yes | yes |
| Protected Internal | No | yes |
I have tried to create a tabular view for simplification. Now, let’s try to explore what the table data shows.
The table column header shows where the implementation can be possible; i.e., at which level we are eligible to access which types of access modifiers.
Note: At function level everything is private; we cannot even explicitly declare private to a data member.
Implementation at Namespace level
Any element which can be defined atthe namespace level should have either public or internal access modifiers. Let’s prove the same.

Here we have tried to define a class of accessibility level as private, Interface with accessibility level as protected, enum with accessibility level as protected internal and a structure.
At the bottom of the screen we can clearly see the Error saying Error “Elements defined in a namespace cannot be explicitly declared as private, protected, or protected internal"
It means we are only left with the option of public or internal. Now how do we identify what is the default access modifiers for elements at namespace level? Friends, it is a very interesting and tricky interview question. I have been bombarded with the question, "What is the default access modifier in C#?" in many of the interviews I have appeared in as an interviewee.
I always thought it to be “internal,” however, I realized my conception was wrong when I tried to figure it out on my own. I understand when the question arises, what is the default access modifier in c#, we should ask the interviewer whether they want to know about the elements at namespace level or about the elements at class/function levels.
To get into the appropriate answer of this question, let refer few of the definition that MSDN site suggests.
The table column header shows where the implementation can be possible; i.e., at which level we are eligible to access which types of access modifiers.
Note: At function level everything is private; we cannot even explicitly declare private to a data member.
Implementation at Namespace level
Any element which can be defined atthe namespace level should have either public or internal access modifiers. Let’s prove the same.
Here we have tried to define a class of accessibility level as private, Interface with accessibility level as protected, enum with accessibility level as protected internal and a structure.
At the bottom of the screen we can clearly see the Error saying Error “Elements defined in a namespace cannot be explicitly declared as private, protected, or protected internal"
It means we are only left with the option of public or internal. Now how do we identify what is the default access modifiers for elements at namespace level? Friends, it is a very interesting and tricky interview question. I have been bombarded with the question, "What is the default access modifier in C#?" in many of the interviews I have appeared in as an interviewee.
I always thought it to be “internal,” however, I realized my conception was wrong when I tried to figure it out on my own. I understand when the question arises, what is the default access modifier in c#, we should ask the interviewer whether they want to know about the elements at namespace level or about the elements at class/function levels.
To get into the appropriate answer of this question, let refer few of the definition that MSDN site suggests.
| Within Namespace | Outside Namespace | |
| Public | Access is not restricted. | Accessible outside namespace. |
| Private | Access is limited to containing type. | Not accessible outside the namespace. |
| Protected | Access is limited to the containing class or types derived from the containing class. | |
| Internal | Access is limited to current assembly only. | Not accessible. |
| Protected Internal | Access is limited to the current assembly or types derived from the containing class. | Outside the namespace, only accessible to the types derived from the containing class. |
So far we have concluded that any element in namespace level is either public or internal. However, we have not yet reached any concrete statement yet.
However, let’s see outside “CheckAccessModifiers” assembly if we are able to access the Namespace level elements.
Steps:
However, let’s see outside “CheckAccessModifiers” assembly if we are able to access the Namespace level elements.
Steps:
- We have created two classes named MyCustomClass and MyCustomClass1 in namespace “CheckAccessModifiers”.
- Build the project. Create one more console project (in our example it is OutSideAssembly) at solution level.
- Add a reference of “OutSideAssembly” to “CheckAccessModifiers”.
- Include the namespace (using CheckAccessModifier)
- In Main () method try to access the elements of “CheckAccessModifiers” Namespace.
Let’s see the below example. Here we have created another class named MyCustomClass1 and tried to access the members of MyCustomClass.
We are only able to see “MyCustomClass1”.
Findings
The reference table from MSDN says, internal is only accessible in current assembly. Public modifiers can be accessed anywhere. If we recall it properly in our very first example, we saw elements at Namespace level can either be public or internal.
We had two classes named MyCustomClass and MyCustomClass1. The type of access modifiers they hold is unknown/default and public. Since at name space level we cannot use private/protected internal/protected.
MyCustomClass1 is accessible in namespace “OutSideAssembly” since it is declared as public, which means the default access modifier in C# at Namespace level element is “Internal”.
Implementation at Class Level and Function Level
To understand this concept, we have created three classes withinthe namespace “CheckAccessModifiers.” Currently, MyCustomClass is holding some data members of different access levels. MyCustomClass2 is inheriting from MyCustomClass.
We end up with two scenarios again. First we will check the behavior of the data members available in MyCustomClass within same namespace but inside different classes.
Scenario 1: (Within Namespace, outside class- In our case it is MyCustomClass1)
After creating the object, we can see only fifthNumber, firstNumber and fouthNumber is available to us.
I.e. only members having modifiers either public/protected internal/internal is accessible in other classes.
Scenario 2: (Within Namespace, outside class inheriting from base class- in our case it is MyCustomClass2).
We are again having access to fifth, first, fourth and third variable. I.e. only members having modifiers either public/protected internal/internal/Protected is accessible in other classes.
Now we end up with a question, if public/protected internal/internal is available anywhere in the namespace how do we choose the appropriate access modifier at class level?
Let’s check the behavior outside the Namespace. We will follow to same steps and go to Namespace “OutSideAssembly”.
Below is the structure of classes in “OutSideAssembly” Assembly.
We have two more classes named Program and MyCustomClass3. MyCustomClass3 is inheriting from MyCustomClass. Our intention is to check the availability of data members outside the namespace.
Inside program class, when we try to access the following, is output.
Only firstNumber variable is available. This justifies the definition that public members have no restriction at all.
Let’s see the behavior inside MyCustomClass3.
We are able to access first, fifth, and third variable.
On derived class examples whether it is within the namespace or outside the namespace, we saw that members with accessibility protected and protected internal is available in derived class.
Then how to choose when to Choose Protected and when to choose protected internal?
Solution
Friends this part is bit interesting, when we want any member to be available only in derived class within the same assembly but not to a normal class in other assembly, then one should go with Protected; however, if one is looking for a member which will be available anywhere in the current assembly but only in derived class in the outside namespace then one should choose protected internal.
Conclusion
Default access modifiers at Namespace level are internal.
Default access modifiers at Class level are private.
Default access modifiers at function level are private; we are not allowed to use even private keywords explicitly.
How to Create your own run commands?
There is a simple and easy way to create your own run command..
1. Open C:\Windows.
2. Create a shortcut of the app you want to create run command into that folder.
3. Rename that app as your wish(without space).
4. Open Run box(win + R) and type that name it will open that app.
1. Open C:\Windows.
2. Create a shortcut of the app you want to create run command into that folder.
3. Rename that app as your wish(without space).
4. Open Run box(win + R) and type that name it will open that app.
Subscribe to:
Posts (Atom)
Featured post
Data connections in Infopath forms
https://www.qdoscc.com/blog/how-automatically-retrieve-current-username-infopath-sharepoint-list-form
Popular Posts
-
https://msdn.microsoft.com/en-us/library/office/bb862071(v=office.14).aspx https://support.office.com/en-us/article/examples-of-common-fo...
-
TITLE INTERNAL NAME Approval Status _ModerationStatus Approver Comments _ModerationComments Check In Comment _CheckinComment Checked O...
-
For saving any MS file directly into our SharePoint site, please refer this URL : https://support.office.com/en-us/article/Save-a-file-to-...